-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtmdb.lua
5082 lines (4913 loc) · 314 KB
/
tmdb.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- TMDb+ Lib Scraper
----------------
-- 公共部分
-- 脚本信息
info = {
["name"] = "TMDb+Lib",
["id"] = "Kikyou.l.TMDb",
["desc"] = "TMDb+ 资料刮削脚本 - Edited by: kafovin \n"..
"从 The Movie Database (TMDb) 刮削影剧元数据,也可设置选择刮削fanart的媒体图片、Jellyfin/Emby的本地元数据、TVmaze的剧集演员。",
-- "▲与0.2.2-版本不兼容▲ 建议搜索旧关联用`本地数据库`,仅刮削详旧资料细信息时设置`搜索-关键词作标题`为`1`。",
["version"] = "0.2.29", -- 0.2.29.221005_build
["min_kiko"] = "0.9.1",
}
-- 设置项
-- `key`为设置项的`key`,`value`是一个`table`。设置项值`value`的类型都是字符串。
-- 由于加载脚本后的特性,在脚本中,可以直接通过`settings["xxxx"]`获取设置项的值。
settings = {
["api_key"] = {
["title"] = "API - TMDb的API密钥",
["default"] = "<<API_Key_Here>>",
["desc"] = "[必填项] 在`themoviedb.org`注册账号,并把个人设置中的API申请到的\n"..
"`API 密钥` (api key) 填入此项。 ( `https://www.themoviedb.org/settings/api`,一般为一串字母数字)",
["group"]="API授权",
},
["api_key_fanart"] = {
["title"] = "API - fanart的API密钥",
["default"] = "<<API_Key_Here>>",
["desc"] = "[选填项] 在 `fanart.tv` 注册账号,并把页面`https://fanart.tv/get-an-api-key/`中申请到的\n"..
"`Personal API Keys` 填入此项。(一般为一串字母数字)\n"..
"注意:若需要跳过刮削fanart.tv的图片,请将设置项 `元数据 - 图片主要来源` 设为 `TMDb_only`。",
["group"]="API授权",
},
-- ["api_key_trakt"] = {
-- ["title"] = "API - Trakt的API密钥",
-- ["default"] = "<<API_Key_Here>>",
-- ["desc"] = "[选填项] 在 `trakt.tv` 注册账号,并把页面`https://trakt.tv/oauth/applications`中申请到的\n"..
-- "`Client ID` 填入此项。(一般为一串字母数字)\n"..
-- "注意:目前Trakt用于 用户记录,例如 评分媒体、标记媒体为 稍后看/已看过/已收集。",
-- ["group"]="API授权",
-- },
-- ["search_keyword_process"] = {
-- ["title"] = "搜索 - 关键词处理",
-- ["default"] = "filename",
-- ["desc"] = "输入的字符经过何种处理作为关键词,来搜索媒体(不含集序号)。\n"..
-- "filename:作为除去拓展名的文件名 (默认)。 plain:不处理,作为单纯的标题关键词(搜索请不要输入季序号等)。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "filename,plain",
-- ["group"]="搜索",
-- },
-- ["search_keyword_astitle"] = {
-- ["title"] = "搜索 - 关键词作标题",
-- ["default"] = "0",
-- ["desc"] = "搜索的关键词是否作为标题。\n 0:不使用 (默认)。 1:使用关键词作为标题。",
-- ["choices"] = "0,1",
-- ["group"]="搜索",
-- },
-- ["search_list_season_all"] = {
-- ["title"] = "搜索 - 显示更多季",
-- ["default"] = "1",
-- ["desc"] = "搜索操作中 在没识别到季序号时,是否显示全部季数。\n".."当且仅当 `搜索 - 关键词处理` 设置为 `filename`时有效。\n"..
-- "0:没识别到季序号时,仅显示第1季、或特别篇。 1:没识别到季序号时,显示全部季数 (默认)。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "0,1",
-- ["group"]="搜索",
-- },
-- ["search_list_season_epgroup"] = {
-- ["title"] = "搜索 - 显示剧集其他版本",
-- ["default"] = "0",
-- ["desc"] = "搜索操作中 是否搜索并显示 剧集其他版本及其各季。其他版本会把剧集以不同方式分季(如:原播出时间、故事线、数字出版等)。\n"..
-- "0:不显示其他版本的季数 (默认)。 1:显示剧集其他版本及其各季数。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "0,1",
-- ["group"]="搜索",
-- },
-- ["search_type"] = {
-- ["title"] = "搜索 - 媒体类型",
-- ["default"] = "multi",
-- ["desc"] = "搜索的数据仅限此媒体类型。\n movie:电影。 multi:电影/剧集 (默认)。 tv:剧集。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "movie,multi,tv",
-- ["group"]="搜索",
-- },
["match_source"] = {
["title"] = "匹配 - 数据来源",
["default"] = "online_TMDb_filename",
["desc"] = "自动匹配本地媒体文件的数据来源。值为<local_Emby_nfo>时需要用软件Emby提前刮削过。\n" ..
"local_Emby_nfo:来自Jellyfin/Emby在刮削TMDb媒体后 在本地媒体文件同目录存储元数据的 .nfo格式文件(内含.xml格式文本) (不稳定/可能不兼容);\n" ..
"online_TMDb_filename:从文件名模糊识别关键词,再用TMDb的API刮削元数据 (不稳定) (默认)。 (* ̄▽ ̄)", -- 丢弃`person`的演员搜索结果
["choices"] = "local_Emby_nfo,online_TMDb_filename",
["group"]="匹配",
},
["match_priority"] = {
["title"] = "匹配 - 备用媒体类型",
["default"] = "multi",
["desc"] = "模糊匹配文件名信息时,类型待定的媒体以此类型匹配,仅适用于匹配来源为`online_TMDb_filename`的匹配操作。\n" ..
"此情况发生于文件名在描述 所有的电影、以及一些情况的剧集正篇或特别篇 的时候。\n" ..
-- "other:识别为`其他`类型的集(不同于本篇/特别篇),置于剧集特别篇或电影中。\n" ..
"movie:电影。multi:采用刮削时排序靠前的影/剧 (默认)。tv:剧集。single:以对话框确定影/剧某一种 (不稳定)。",
["choices"] = "movie,multi,single,tv",
-- "movie,multi,tv,movie_other,multi_other,tv_other"
["group"]="匹配",
},
["metadata_lang"] = {
["title"] = "元数据 - 语言地区",
["default"] = "zh-CN",
["desc"] = "按此`语言编码-地区编码`搜索元数据资料,主要指简介、海报、搜索的标题等。看着有很多语言,其实大部分都缺乏资料。\n" ..
"注意:再次关联导致标题改变时,弹幕仍然按照旧标题识别,请使用`搜索 - 关键词作标题`的功能重新搜索详细信息。\n" ..
"zh-CN:中文(中国),(默认)。zh-HK:中文(香港特區,中國)。zh-TW:中文(台灣省,中國)。\n" ..
"en-US:English(US)。es-ES:español(España)。fr-FR:Français(France)。ja-JP:日本語(日本)。ru-RU:Русский(Россия)。",
["choices"] = "af-ZA,ar-AE,ar-SA,be-BY,bg-BG,bn-BD,ca-ES,ch-GU,cn-CN,cs-CZ,cy-GB,da-DK" ..
",de-AT,de-CH,de-DE,el-GR,en-AU,en-CA,en-GB,en-IE,en-NZ,en-US,eo-EO,es-ES,es-MX,et-EE" ..
",eu-ES,fa-IR,fi-FI,fr-CA,fr-FR,ga-IE,gd-GB,gl-ES,he-IL,hi-IN,hr-HR,hu-HU,id-ID,it-IT" ..
",ja-JP,ka-GE,kk-KZ,kn-IN,ko-KR,ky-KG,lt-LT,lv-LV,ml-IN,mr-IN,ms-MY,ms-SG,nb-NO,nl-BE" ..
",nl-NL,no-NO,pa-IN,pl-PL,pt-BR,pt-PT,ro-RO,ru-RU,si-LK,sk-SK,sl-SI,sq-AL,sr-RS,sv-SE" ..
",ta-IN,te-IN,th-TH,tl-PH,tr-TR,uk-UA,vi-VN,zh-CN,zh-HK,zh-SG,zh-TW,zu-ZA",
-- ["choices"] = "ar-SA,de-DE,en-US,es-ES,fr-FR,it-IT,ja-JP,ko-KR,pt-PT,ru-RU,zh-CN,zh-HK,zh-TW",
-- ["choices"] = "en-US,fr-FR,ja-JP,ru-RU,zh-CN,zh-HK,zh-TW",
["group"]="元数据 - 语言",
},
["metadata_info_update_keep"] = {
["title"] = "元数据 - 更新时维持更改",
["default"] = "0",
["desc"] = "更新资料夹元数据时,对于之前的编辑的更改(例如描述、演职员表等),是否保留。\n" ..
"0:不保留 (默认)。 1:保留(当前不支持此功能)。",
["choices"] = "0",
["group"]="元数据 - 其他",
},
["metadata_info_origin_title"] = {
["title"] = "元数据 - 标题优先原语言",
["default"] = "0",
["desc"] = "媒体的标题 是否优先使用媒体原语言。(不论此项的设置,更新详细信息时 始终维持已有的标题。)\n" ..
"注意:再次关联导致标题改变时,弹幕仍然按照旧标题识别,请使用`搜索 - 关键词作标题`的功能重新搜索详细信息。\n"..
"0:优先使用刮削时`元数据 - 语言`所设定的语言 (默认)。 1:优先使用原语言。",
["choices"] = "0,1",
["group"]="元数据 - 语言",
},
["metadata_info_origin_image"] = {
["title"] = "元数据 - 图片优先原语言",
["default"] = "0",
["desc"] = "媒体的图片 是否优先使用媒体原语言。\n"..
"0:优先使用刮削时`元数据 - 语言`所设定的语言 (默认)。 1:优先使用原语言。 2:优先使用无语言。",
["choices"] = "0,1,2",
["group"]="元数据 - 语言",
},
["metadata_image_priority"]={
["title"] = "元数据 - 图片主要来源",
["default"] = "TMDb_only",
["desc"] = "元数据的图片源是使用TMDb还是fanart,需要各自的api密钥。\n"..
"其中,fanart的网络连接比较缓慢 (经常会加载失败)、图片种类更多 (可完全覆盖TMDb中所有图片种类)。\n"..
"fanart_prior:图片优先fanart,(由于fanart的图片种类较多,因此TMDb的图片通常会被忽略)。\n"..
"TMDb_only:图片仅TMDb,(不会从fanart刮削图片,仅此项不需要 fanart的API密钥) (默认)。\n"..
"TMDb_prior:图片优先TMDb,TMDb提供海报、背景,其他的由fanart提供。",
["choices"] = "fanart_prior,TMDb_only,TMDb_prior",
["group"]="元数据 - 图片",
},
["metadata_show_imgtype"] = {
["title"] = "元数据 - 显示的图片种类",
["default"] = "background",
["desc"] = "仅限资料夹的右键菜单里`显示媒体元数据`弹出窗口中 所显示的那一张图片的种类。\n"..
"当 `元数据 - 图片主要来源` 设置为`TMDb_only`时,仅海报、背景、标志可用。\n"..
"当 `元数据 - 图片主要来源` 设置为`fanart_prior`或`TMDb_prior`时,以下均有效(除非图片未刮削到)。\n" ..
"poster: 海报。banner: 横幅。thumb: 缩略图。background: 背景 (默认)。\n"..
"logo: 标志。art: 艺术图。otherart: 其他艺术图。",
-- "logo: 标志。logoL: 标志*。art: 艺术图。artL: 艺术图*。otherart: 其他艺术图。",
["choices"] = "poster,banner,thumb,background,logo,art,otherart",
-- ["choices"] = "poster,banner,thumb,background,logo,logoL,art,artL,otherart",
["group"]="元数据 - 图片",
},
["metadata_castcrew_castcount"]={
["title"] = "元数据 - 演员总数至多为",
["default"] = "12",
["desc"] = "元数据的演员表至多保留多少演员 (默认 12)。\n"..
"其中,数目>0时,为至多保留的数目;数目=0时,不保留;数目<0时,保留所有;小数,则向负无穷方向取整。",
["group"]="元数据 - 演职员",
},
["metadata_castcrew_crewcount"]={
["title"] = "元数据 - 职员总数至多为",
["default"] = "12",
["desc"] = "元数据的职员表至多保留多少职员 (默认 12)。\n"..
"其中,数目>0时,为至多保留的数目;数目=0时,不保留;数目<0时,保留所有;小数,则向负无穷方向取整。",
["group"]="元数据 - 演职员",
},
["metadata_castcrew_season_aggregate"]={
["title"] = "元数据 - 本季所有演职员",
["default"] = "0",
["desc"] = "元数据对于剧集某季的演职员表,是否也包括所有单集的演职员。\n"..
"0:仅包括出现于或负责本季整季的演职员 (默认)。 1:包含前者,以及出现于或负责各集的演职员(按默认顺序)。",
["choices"] = "0,1",
["group"]="元数据 - 演职员",
},
["metadata_castcrew_source_cast"]={
["title"] = "元数据 - 演员来源",
["default"] = "TMDb_season",
["desc"] = "元数据中演员表的数据来源。\n"..
"TMDb_season:本电影或剧集本季的演员表 来自TMDb (默认)。\n"..
"TVmaze_show:剧集本季的演员表 来自TVmaze 对应的本剧集整剧(不是本季),本电影 来源取默认,仅英文。",
["choices"] = "TMDb_season,TVmaze_show",
["group"]="元数据 - 演职员",
},
}
scriptmenus = {
{["title"]="检测连接", ["id"]="detect_valid_api"},
{["title"]="使用方法", ["id"]="link_repo_usage"},
{["title"]="关于", ["id"]="display_dialog_about"},
}
searchsettings = {
["search_keyword_astitle"] = {
["title"] = "关键词作弹幕池标题 ",
["default"] = "0",
["desc"] = "搜索的关键词是否作为标题。\n 不选(0):不使用 (默认)。 选中(1):使用关键词作为标题。",
-- ["choices"] = "0,1",
["save"]=false,
["display_type"] = 3,
},
["search_keyword_process"] = {
["title"] = "关键词作文件名识别 | ",
["default"] = "1",
-- ["default"] = "filename",
["desc"] = "输入的字符经过何种处理作为关键词,来搜索媒体(不含集序号)。\n"..
"不选(0):不处理,作为单纯的标题关键词(搜索请不要输入季序号等)。 选中(1):作为除去拓展名的文件名 (默认)。", -- 丢弃`person`的演员搜索结果
-- "filename:作为除去拓展名的文件名 (默认)。 plain:不处理,作为单纯的标题关键词(搜索请不要输入季序号等)。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "filename,plain",
["save"]=true,
["display_type"] = 3,
},
["search_list_season_all"] = {
["title"] = "显示更多季 ",
["default"] = "1",
["desc"] = "搜索操作中 在没识别到季序号时,是否显示全部季数。\n".."当且仅当 `搜索 - 关键词处理` 设置为 `filename`时有效。\n"..
"不选(0):没识别到季序号时,仅显示第1季、或特别篇。 选中(1):没识别到季序号时,显示全部季数 (默认)。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "0,1",
["save"]=false,
["display_type"] = 3,
},
["search_list_season_epgroup"] = {
["title"] = "显示其他版本 | ",
["default"] = "0",
["desc"] = "搜索操作中 是否搜索并显示 剧集其他版本及其各季。其他版本会把剧集以不同方式分季(如:原播出时间、故事线、数字出版等)。\n"..
"不选(0):不显示其他版本的季数 (默认)。 选中(1):显示剧集其他版本及其各季数。", -- 丢弃`person`的演员搜索结果
-- ["choices"] = "0,1",
["save"]=false,
["display_type"] = 3,
},
["search_type"] = {
["title"] = "媒体类型",
["default"] = "电影/剧集",
-- ["default"] = "multi",
["desc"] = "搜索的数据仅限此媒体类型。\n 电影:仅电影。 电影/剧集:电影 或 剧集 (默认)。 剧集:仅剧集。", -- 丢弃`person`的演员搜索结果
-- ["desc"] = "搜索的数据仅限此媒体类型。\n movie:电影。 multi:电影/剧集 (默认)。 tv:剧集。", -- 丢弃`person`的演员搜索结果
["choices"] = "电影/剧集,电影,剧集",
-- ["choices"] = "movie,multi,tv",
["save"]=false,
["display_type"] = 1,
},
}
-- 不会 在运行函数内更新值
Metadata_search_page = 1 -- 元数据搜索第几页。 默认:第 1 页
Metadata_search_adult = false -- Choose whether to inlcude adult content in the results when searching metadata. Default: false
-- 会 在运行函数内更新值
Metadata_info_origin_title = true -- 是否使用源语言标题
Metadata_info_origin_image = true -- 是否使用源语言图片 --仅fanart图片
Metadata_person_max_cast = 16 -- 演员表最多保留
Metadata_person_max_crew = 16 -- 职员表最多保留
Metadata_show_imgtype="background" -- 图片类型使用背景
Tag_rating_on_region = {"FR", "GB", "HK", "RU","US",}
NM_HIDE = 1 -- 一段时间后自动隐藏
NM_PROCESS = 2 -- 显示busy动画
NM_SHOWCANCEL = 4 -- 显示cancel按钮
NM_ERROR = 8 -- 错误信息
NM_DARKNESS_BACK = 16 -- 显示暗背景,阻止用户执行其他操作
Array={}
Kikoplus={}
Path={}
-- 说明: 三目运算符 ((condition) and {trueCDo} or {falseCDo})[1] === (condition)?(trueCDo):(falseCDo)
-- (() and{} or{})[1]
-- TMDb图片配置
Image_tmdb = {
["prefix"]= "https://image.tmdb.org/t/p/", -- 网址前缀
-- path="https://image.tmdb.org/t/p/" .. "size" .. "/q1w2e3.png"
["min_ix"]= 2, -- 尺寸索引
["mid_ix"]= 5,
["max_ix"]= 7,
["background"]= {"w300","w300","w780","w780","w1280","w1280","original"}, -- 影/剧剧照
["logo"]= {"w45","w92","w154","w185","w300","w500","original"}, -- /company/id - /network/id - 出品公司/电视网标志
["poster"]= {"w92","w154","w185","w342","w500","w780","original"}, -- 影/剧海报
["profile"]= {"w45","w45","w185","w185","h632","h632","original"}, -- /person/id 演员肖像
["still"]= {"w92","w92","w185","w185","w300","w300","original"}, -- /tv/id/season/sNum/episode/eNum 单集剧照
}
Image_fanart = {
["prefix"]= "https://assets.fanart.tv/",
["size"]= {"preview","fanart"},
["min_ix"]= 1, -- 尺寸索引
["mid_ix"]= 1,
["max_ix"]= 2,
["len_preix_size"]= 31, -- https://assets.fanart.tv/fanart (30) not https
-- image_path="/movies/id/type/title-name-q1w2e3.png" "/tv/id/type/title-name-q1w2e3.png"
["movie"]={"movieposter","moviebanner","moviethumb","moviebackground",
"hdmovielogo","movielogo","hdmovieclearart","movieart","moviedisc",},
["tv"]={"tvposter","tvbanner","tvthumb","showbackground",
"hdtvlogo","clearlogo","hdclearart","clearart","characterart",},
["season"]={"seasonposter","seasonbanner","seasonthumb ","showbackground",},
["type_zh"]={
["movieposter"]="电影海报",["moviebanner"]="电影横幅",["moviethumb"]="电影缩略图",["moviebackground"]="电影背景",
["hdmovielogo"]="电影标志",["movielogo"]="电影标志*",["hdmovieclearart"]="电影艺术图",["movieart"]="电影艺术图*",["moviedisc"]="电影光盘",
["tvposter"]="剧集海报",["tvbanner"]="剧集横幅",["tvthumb"]="剧集缩略图",["showbackground"]="剧/季背景",["tvbackground"]="剧/季背景",["tvlogo"]="剧集标志",
["hdtvlogo"]="剧集标志",["clearlogo"]="剧集标志*",["hdclearart"]="剧集艺术图",["clearart"]="剧集艺术图*",["characterart"]="剧集角色图",
["seasonposter"]="本季海报",["seasonbanner"]="本季横幅",["seasonthumb"]="本季缩略图",["seasonbackground"]="本季背景",["seasonlogo"]="本季标志",
},
}
Translation = {
["und-XX"] = {
["language"]={ [""]= "Others", ["Unknown"]= "Unknown", ["cmn"]="Mandarin", ["mis"]="", ["mul"]="Multi Languages", ["und"]="Undetermined", ["zxx"]="No Language", ["xx"]="No Language", ["00"]="No Language", },
["region"]={ [""]= "Others", ["Unknown"]= "Unknown", ["XX"]="Undetermined", ["XZ"]="International Water", ["ZZ"]="未识别", ["International"]="International", },
["media_genre"] = {[""]= "Others", ["Unknown"]= "Unknown", ["Adult"]= "Adult", },
["media_status"] = { [""]= "Others", ["Unknown"]= "Unknown", },
["media_type"] = { [""]= "Others", ["Unknown"]= "Unknown", },
["character_gsub"] = { {"^$","Unknown Character"}, },
["department"] = { [""]= "Others", ["Unknown"]= "Unknown", },
["credit_job"] = { [""]= "Others", ["Unknown"]= "Unknown", },
["media_type_epgroup"] = { [1]= "Original air date", [2]= "Absolute", [3]= "DVD", [4]= "Digital", [5]= "Story arc", [6]= "Production", [7]= "TV", [""]= "Others", ["Unknown"]= "Unknown", },
},
}
Translation["zh-CN"] = {
["language"]={
["aa"]= "阿法尔语", ["ab"]= "阿布哈兹语", ["af"]= "南非荷兰语", ["ak"]= "阿坎语", ["sq"]= "阿尔巴尼亚语", ["am"]= "阿姆哈拉语", ["ar"]= "阿拉伯语", ["an"]= "阿拉贡语", ["hy"]= "亚美尼亚语", ["as"]= "阿萨姆语", ["av"]= "阿瓦尔语", ["ae"]= "阿维斯陀语", ["ay"]= "艾马拉语", ["az"]= "阿塞拜疆语", ["ba"]= "巴什基尔语",
["bm"]= "班巴拉语", ["eu"]= "巴斯克语", ["be"]= "白俄罗斯语", ["bn"]= "孟加拉语", ["bh"]= "比哈尔语", ["bi"]= "比斯拉玛语", ["bs"]= "波斯尼亚语", ["br"]= "布里多尼语", ["bg"]= "保加利亚语", ["my"]= "缅甸语", ["ca"]= "加泰罗尼亚语", ["ch"]= "查莫罗语", ["ce"]= "车臣语", ["zh"]= "汉语", ["cu"]= "教会斯拉夫语",
["cv"]= "楚瓦什语", ["kw"]= "康沃尔语", ["co"]= "科西嘉语", ["cr"]= "克里语", ["cs"]= "捷克语", ["da"]= "丹麦语", ["dv"]= "迪维希语", ["nl"]= "荷兰语", ["dz"]= "不丹语", ["en"]= "英语", ["eo"]= "世界语", ["et"]= "爱沙尼亚语", ["ee"]= "埃维语", ["fo"]= "法罗语", ["fj"]= "斐济语", ["fi"]= "芬兰语", ["fr"]= "法语",
["fy"]= "弗里西亚语", ["ff"]= "富拉语", ["ka"]= "格鲁吉亚语", ["de"]= "德语", ["gd"]= "苏格兰盖尔语", ["ga"]= "爱尔兰语", ["gl"]= "加利西亚语", ["gv"]= "马恩岛语", ["el"]= "现代希腊语", ["gn"]= "瓜拉尼语", ["gu"]= "古吉拉特语", ["ht"]= "海地克里奥尔语", ["ha"]= "豪萨语", ["he"]= "希伯来语", ["hz"]= "赫雷罗语",
["hi"]= "印地语", ["ho"]= "希里莫图语", ["hr"]= "克罗地亚语", ["hu"]= "匈牙利语", ["ig"]= "伊博语", ["is"]= "冰岛语", ["io"]= "伊多语", ["ii"]= "四川彝语", ["iu"]= "伊努伊特语", ["ie"]= "国际语E", ["ia"]= "拉丁国际语", ["id"]= "印尼语", ["ik"]= "依努庇克语", ["it"]= "意大利语", ["jv"]= "爪哇语", ["ja"]= "日语",
["kl"]= "格陵兰语", ["kn"]= "卡纳达语", ["ks"]= "克什米尔语", ["kr"]= "卡努里语", ["kk"]= "哈萨克语", ["km"]= "高棉语", ["ki"]= "基库尤语", ["rw"]= "基尼阿万达语", ["ky"]= "吉尔吉斯语", ["kv"]= "科米语", ["kg"]= "刚果语", ["ko"]= "朝鲜语", ["kj"]= "宽亚玛语", ["ku"]= "库尔德语", ["lo"]= "老挝语", ["la"]= "拉丁语",
["lv"]= "拉脱维亚语", ["li"]= "林堡语", ["ln"]= "林加拉语", ["lt"]= "立陶宛语", ["lb"]= "卢森堡语", ["lu"]= "卢巴-加丹加语", ["lg"]= "干达语", ["mk"]= "马其顿语", ["mh"]= "马绍尔语", ["ml"]= "马拉雅拉姆语", ["mi"]= "毛利语", ["mr"]= "马拉提语", ["ms"]= "马来语", ["mg"]= "马达加斯加语", ["mt"]= "马耳他语",
["mo"]= "摩尔达维亚语", ["mn"]= "蒙古语", ["na"]= "蒙古语", ["nv"]= "纳瓦霍语", ["nr"]= "南恩德贝勒语", ["nd"]= "北恩德贝勒语", ["ng"]= "恩敦加语", ["ne"]= "尼泊尔语", ["nn"]= "新挪威语", ["nb"]= "挪威布克莫尔语", ["no"]= "书面挪威语", ["ny"]= "尼扬贾语", ["oc"]= "奥克语", ["oj"]= "奥杰布瓦语", ["or"]= "奥利亚语",
["om"]= "奥洛莫语", ["os"]= "奥塞梯语", ["pa"]= "旁遮普语", ["fa"]= "波斯语", ["pi"]= "巴利语", ["pl"]= "波兰语", ["pt"]= "葡萄牙语", ["ps"]= "普什图语", ["qu"]= "凯楚亚语", ["rm"]= "利托-罗曼语", ["ro"]= "罗马尼亚语", ["rn"]= "基隆迪语", ["ru"]= "俄语", ["sg"]= "桑戈语", ["sa"]= "梵语", ["si"]= "僧加罗语",
["sk"]= "斯洛伐克语", ["sl"]= "斯洛文尼亚语", ["se"]= "北萨莫斯语", ["sm"]= "萨摩亚语", ["sn"]= "绍纳语", ["sd"]= "信德语", ["so"]= "索马里语", ["st"]= "南索托语", ["es"]= "西班牙语", ["sc"]= "撒丁语", ["sr"]= "塞尔维亚语", ["ss"]= "斯瓦特语", ["su"]= "巽他语", ["sw"]= "斯瓦希里语", ["sv"]= "瑞典语",
["ty"]= "塔希提语", ["ta"]= "泰米尔语", ["tt"]= "塔塔尔语", ["te"]= "泰卢固语", ["tg"]= "塔吉克语", ["tl"]= "塔加洛语", ["th"]= "泰语", ["bo"]= "藏语", ["ti"]= "提格里尼亚语", ["to"]= "汤加语", ["tn"]= "塞茨瓦纳语", ["ts"]= "宗加语", ["tk"]= "土库曼语", ["tr"]= "土耳其语", ["tw"]= "特威语", ["ug"]= "维吾尔语",
["uk"]= "乌克兰语", ["ur"]= "乌尔都语", ["uz"]= "乌兹别克语", ["ve"]= "文达语", ["vi"]= "越南语", ["vo"]= "沃拉普克语", ["cy"]= "威尔士语", ["wa"]= "沃伦语", ["wo"]= "沃洛夫语", ["xh"]= "科萨语", ["yi"]= "依地语", ["yo"]= "约鲁巴语", ["za"]= "壮语", ["zu"]= "祖鲁语",
["Unknown"]="未知", [""]="其他", ["cmn"]="普通话", ["mis"]="未识别", ["mul"]="多语言", ["und"]="未确定", ["zxx"]="无语言", ["xx"]="无语言", ["00"]="无语言",
},
["region"]={
["AC"]= "阿森松岛", ["AD"]= "安道尔", ["AE"]= "阿拉伯联合酋长国", ["AF"]= "阿富汗", ["AG"]= "安提瓜和巴布达", ["AI"]= "安圭拉", ["AL"]= "阿尔巴尼亚", ["AM"]= "亚美尼亚", ["AN"]= "荷属安的列斯群岛", ["AO"]= "安哥拉", ["AQ"]= "南极洲", ["AR"]= "阿根廷", ["AS"]= "美属萨摩亚", ["AT"]= "奥地利", ["AU"]= "澳大利亚",
["AW"]= "阿鲁巴", ["AX"]= "奥兰群岛", ["AZ"]= "阿塞拜疆", ["BA"]= "波斯尼亚和黑塞哥维那", ["BB"]= "巴巴多斯", ["BD"]= "孟加拉国", ["BE"]= "比利时", ["BF"]= "布基纳法索", ["BG"]= "保加利亚", ["BH"]= "巴林", ["BI"]= "布隆迪", ["BJ"]= "贝宁", ["BL"]= "圣巴泰勒米", ["BM"]= "百慕大", ["BN"]= "文莱", ["BO"]= "玻利维亚",
["BQ"]= "荷兰加勒比区", ["BR"]= "巴西", ["BS"]= "巴哈马", ["BT"]= "不丹", ["BV"]= "布维特岛", ["BW"]= "博茨瓦纳", ["BY"]= "白俄罗斯", ["BZ"]= "伯利兹", ["CA"]= "加拿大", ["CC"]= "科科斯(基林)群岛", ["CD"]= "刚果(金)", ["CF"]= "中非共和国", ["CG"]= "刚果(布)", ["CH"]= "瑞士", ["CI"]= "科特迪瓦",
["CK"]= "库克群岛", ["CL"]= "智利", ["CM"]= "喀麦隆", ["CN"]= "中国", ["CO"]= "哥伦比亚", ["CP"]= "克利珀顿岛", ["CR"]= "哥斯达黎加", ["CU"]= "古巴", ["CV"]= "佛得角", ["CW"]= "库拉索", ["CX"]= "圣诞岛", ["CY"]= "塞浦路斯", ["CZ"]= "捷克共和国", ["DE"]= "德国", ["DG"]= "迪戈加西亚岛", ["DJ"]= "吉布提",
["DK"]= "丹麦", ["DM"]= "多米尼克", ["DO"]= "多米尼加共和国", ["DZ"]= "阿尔及利亚", ["EA"]= "休达及梅利利亚", ["EC"]= "厄瓜多尔", ["EE"]= "爱沙尼亚", ["EG"]= "埃及", ["EH"]= "西撒哈拉", ["ER"]= "厄立特里亚", ["ES"]= "西班牙", ["ET"]= "埃塞俄比亚", ["EU"]= "欧盟", ["FI"]= "芬兰", ["FJ"]= "斐济", ["FK"]= "马尔维纳斯群岛",
["FM"]= "密克罗尼西亚", ["FO"]= "法罗群岛", ["FR"]= "法国", ["GA"]= "加蓬", ["GB"]= "英国", ["GD"]= "格林纳达", ["GE"]= "格鲁吉亚", ["GF"]= "法属圭亚那", ["GG"]= "根西岛", ["GH"]= "加纳", ["GI"]= "直布罗陀", ["GL"]= "格陵兰", ["GM"]= "冈比亚", ["GN"]= "几内亚", ["GP"]= "瓜德罗普", ["GQ"]= "赤道几内亚", ["GR"]= "希腊",
["GS"]= "南乔治亚岛和南桑威齐群岛", ["GT"]= "危地马拉", ["GU"]= "关岛", ["GW"]= "几内亚比绍", ["GY"]= "圭亚那", ["HK"]= "中国香港特别行政区", ["HM"]= "赫德岛和麦克唐纳群岛", ["HN"]= "洪都拉斯", ["HR"]= "克罗地亚", ["HT"]= "海地", ["HU"]= "匈牙利", ["IC"]= "加纳利群岛", ["ID"]= "印度尼西亚", ["IE"]= "爱尔兰",
["IL"]= "以色列", ["IM"]= "曼岛", ["IN"]= "印度", ["IO"]= "英属印度洋领地", ["IQ"]= "伊拉克", ["IR"]= "伊朗", ["IS"]= "冰岛", ["IT"]= "意大利", ["JE"]= "泽西岛", ["JM"]= "牙买加", ["JO"]= "约旦", ["JP"]= "日本", ["KE"]= "肯尼亚", ["KG"]= "吉尔吉斯斯坦", ["KH"]= "柬埔寨", ["KI"]= "基里巴斯", ["KM"]= "科摩罗",
["KN"]= "圣基茨和尼维斯", ["KP"]= "朝鲜", ["KR"]= "韩国", ["KW"]= "科威特", ["KY"]= "开曼群岛", ["KZ"]= "哈萨克斯坦", ["LA"]= "老挝", ["LB"]= "黎巴嫩", ["LC"]= "圣卢西亚", ["LI"]= "列支敦士登", ["LK"]= "斯里兰卡", ["LR"]= "利比里亚", ["LS"]= "莱索托", ["LT"]= "立陶宛", ["LU"]= "卢森堡", ["LV"]= "拉脱维亚",
["LY"]= "利比亚", ["MA"]= "摩洛哥", ["MC"]= "摩纳哥", ["MD"]= "摩尔多瓦", ["ME"]= "黑山共和国", ["MF"]= "法属圣马丁", ["MG"]= "马达加斯加", ["MH"]= "马绍尔群岛", ["MK"]= "马其顿", ["ML"]= "马里", ["MM"]= "缅甸", ["MN"]= "蒙古", ["MO"]= "中国澳门特别行政区", ["MP"]= "北马里亚纳群岛", ["MQ"]= "马提尼克",
["MR"]= "毛里塔尼亚", ["MS"]= "蒙特塞拉特", ["MT"]= "马耳他", ["MU"]= "毛里求斯", ["MV"]= "马尔代夫", ["MW"]= "马拉维", ["MX"]= "墨西哥", ["MY"]= "马来西亚", ["MZ"]= "莫桑比克", ["NA"]= "纳米比亚", ["NC"]= "新喀里多尼亚", ["NE"]= "尼日尔", ["NF"]= "诺福克岛", ["NG"]= "尼日利亚", ["NI"]= "尼加拉瓜", ["NL"]= "荷兰",
["NO"]= "挪威", ["NP"]= "尼泊尔", ["NR"]= "瑙鲁", ["NU"]= "纽埃", ["NZ"]= "新西兰", ["OM"]= "阿曼", ["PA"]= "巴拿马", ["PE"]= "秘鲁", ["PF"]= "法属波利尼西亚", ["PG"]= "巴布亚新几内亚", ["PH"]= "菲律宾", ["PK"]= "巴基斯坦", ["PL"]= "波兰", ["PM"]= "圣皮埃尔和密克隆群岛", ["PN"]= "皮特凯恩群岛", ["PR"]= "波多黎各",
["PS"]= "巴勒斯坦", ["PT"]= "葡萄牙", ["PW"]= "帕劳", ["PY"]= "巴拉圭", ["QA"]= "卡塔尔", ["QO"]= "大洋洲外围群岛", ["RE"]= "留尼汪", ["RO"]= "罗马尼亚", ["RS"]= "塞尔维亚", ["RU"]= "俄罗斯", ["RW"]= "卢旺达", ["SA"]= "沙特阿拉伯", ["SB"]= "所罗门群岛", ["SC"]= "塞舌尔", ["SD"]= "苏丹", ["SE"]= "瑞典",
["SG"]= "新加坡", ["SH"]= "圣赫勒拿", ["SI"]= "斯洛文尼亚", ["SJ"]= "斯瓦尔巴特和扬马延", ["SK"]= "斯洛伐克", ["SL"]= "塞拉利昂", ["SM"]= "圣马力诺", ["SN"]= "塞内加尔", ["SO"]= "索马里", ["SR"]= "苏里南", ["SS"]= "南苏丹", ["ST"]= "圣多美和普林西比", ["SV"]= "萨尔瓦多", ["SX"]= "荷属圣马丁", ["SY"]= "叙利亚",
["SZ"]= "斯威士兰", ["TA"]= "特里斯坦-达库尼亚群岛", ["TC"]= "特克斯和凯科斯群岛", ["TD"]= "乍得", ["TF"]= "法属南部领地", ["TG"]= "多哥", ["TH"]= "泰国", ["TJ"]= "塔吉克斯坦", ["TK"]= "托克劳", ["TL"]= "东帝汶", ["TM"]= "土库曼斯坦", ["TN"]= "突尼斯", ["TO"]= "汤加", ["TR"]= "土耳其", ["TT"]= "特立尼达和多巴哥",
["TV"]= "图瓦卢", ["TW"]= "中国台湾", ["TZ"]= "坦桑尼亚", ["UA"]= "乌克兰", ["UG"]= "乌干达", ["UM"]= "美国本土外小岛屿", ["US"]= "美国", ["UY"]= "乌拉圭", ["UZ"]= "乌兹别克斯坦", ["VA"]= "梵蒂冈", ["VC"]= "圣文森特和格林纳丁斯", ["VE"]= "委内瑞拉", ["VG"]= "英属维京群岛", ["VI"]= "美属维京群岛", ["VN"]= "越南",
["VU"]= "瓦努阿图", ["WF"]= "瓦利斯和富图纳", ["WS"]= "萨摩亚", ["XK"]= "科索沃地区", ["YE"]= "也门", ["YT"]= "马约特", ["ZA"]= "南非", ["ZM"]= "赞比亚", ["ZW"]= "津巴布韦",
[""]="其他", ["Unknown"]="未知", ["XX"]="未确定", ["XZ"]="国际水域", ["ZZ"]="未识别", ["International"]="国际",
},
-- 媒体所属的流派类型,tmdb的id编号->类型名 的对应
["media_genre"] = {
[28] = "动作", [10759] = "动作冒险", [12] = "冒险", [16] = "动画",
[35] = "喜剧", [80] = "犯罪", [99] = "纪录", [18] = "剧情",
[10751] = "家庭", [14] = "奇幻", [36] = "历史", [27] = "恐怖", [10762] = "少儿",
[10402] = "音乐", [9648] = "悬疑", [10763] = "新闻", [10764] = "真人", [10749] = "爱情",
[10765] = "幻想", [878] = "科幻", [10766] = "连续剧", [10770] = "电视电影",
[10767] = "访谈", [53] = "惊悚", [10752] = "战争", [10768] = "战争政治", [37] = "西部",
[""]="其他", ["Unknown"]= "未知", ["Adult"]= "成人",
},
["media_status"] = {
["Rumored"]= "传闻", ["Planned"]= "筹划",
["In Production"]= "开拍", ["TV In Production"]= "在摄制", ["Post Production"]= "后期制作",
["Pilot"]= "试播中", ["Returning Series"]= "更新中",
["Released"]= "已上映", ["Canceled"]="已取消", ["Ended"]="已完结",
[""]="其他", ["Unknown"]= "未知",
},
["media_type"] = {
["movie"]= "电影", ["tv"]= "剧集", ["Movie Video"]= "影像单篇",
["Scripted"]= "剧本类", ["Miniseries"]= "迷你剧类", ["Video"]= "影像合集",
["Reality"]= "真人节目", ["Talk Show"]="访谈节目", ["News"]= "新闻节目", ["Documentary"]= "纪录类",
[""]= "其他", ["Unknown"]= "未知",
},
["character_gsub"] = {
{"^$","未知角色"}, {"^Self$","自己"}, {"^Voice$","配音"}, {"^Cameo$","客串"}, {"^Special Guest$","特邀嘉宾"}, {"^Guest$","嘉宾"}, {"^Host$","主持"}, {"^Contestant$","参赛"}, {"^Performer$","演出"}, {"^Judge$","评委"},
{"Self %- ","自己 - "}, {" %(voice%)"," (配音)"}, {" %(cameo%)"," (客串)"}, {" %(special guest%)"," (特邀嘉宾)"}, {" %(guest%)"," (嘉宾)"}, {" %(host%)"," (主持)"},
{" %- Self"," - 自己"}, {" %- Voice"," - 配音"}, {" %- Cameo"," - 客串"}, {" %- Special Guest"," - 特邀嘉宾"}, {" %- Guest"," - 嘉宾"}, {" %- Host"," - 主持"},
{" %- Presenter"," - 主持"}, {" %- Various Characters"," - 各种角色"}, {" %- Participant"," - 参赛"}, {" %- Contestant"," - 参赛"}, {" %- Performer"," - 演出"}, {" %- Judge"," - 评委"},
},
["department"] = {
["Acting"]= "表演", ["Actors"]= "参演", ["Art"]= "美术", ["Camera"]= "摄像", ["Costume & Make-Up"]= "服化", ["Creator"]= "创作", ["Directing"]= "执导",
["Editing"]= "剪辑", ["Lighting"]= "灯光", ["Production"]= "制片", ["Sound"]= "声音", ["Visual Effects"]= "视效", ["Writing"]= "剧作", ["Crew"]= "职员",
[""]= "其他", ["Unknown"]= "未知",
},
["credit_job"] = {
["24 Frame Playback"]= "24 帧播放", ["2D Artist"]= "2D 艺术家", ["2D Sequence Supervisor"]= "2D 序列管理", ["2D Supervisor"]= "2D 监督员", ["3D Animator"]= "3D 动画师", ["3D Artist"]= "3D 艺术家", ["3D Coordinator"]= "3D 协调员",
["3D Digital Colorist"]= "3D 数码调色师", ["3D Director"]= "3D 导演", ["3D Editor"]= "3D 编辑器", ["3D Generalist"]= "3D 多样化", ["3D Modeller"]= "3D 建模", ["3D Sequence Supervisor"]= "3D 序列管理", ["3D Supervisor"]= "3D 总监",
["3D Tracking Layout"]= "3D 追踪图层", ["ADR & Dubbing"]= "配音", ["ADR Coordinator"]= "ADR 协调", ["ADR Editor"]= "ADR 编辑", ["ADR Engineer"]= "ADR 工程师", ["ADR Mixer"]= "配音混音", ["ADR Post Producer"]= "配音后期制作",
["ADR Recording Engineer"]= "配音录音师", ["ADR Recordist"]= "配音录音员", ["ADR Supervisor"]= "配音指导", ["ADR Voice Casting"]= "配音演员", ["Accountant"]= "会计", ["Accounting Clerk Assistant"]= "助理会计师",
["Accounting Supervisor"]= "财务主管", ["Accounting Trainee"]= "会计师", ["Acting Double"]= "动作替身", ["Action Director"]= "动作导演", ["Actor"]= "演员", ["Actor's Assistant"]= "演员助理", ["Adaptation"]= "改编",
["Additional Camera"]= "副摄像", ["Additional Casting"]= "临时演员", ["Additional Colorist"]= "额外调色师", ["Additional Construction"]= "副建造", ["Additional Construction Grip"]= "副建造师", ["Additional Dialogue"]= "副对白",
["Additional Director of Photography"]= "副摄影指导", ["Additional Editing"]= "副剪辑", ["Additional Editor"]= "额外编辑人", ["Additional Editorial Assistant"]= "副剪辑助理", ["Additional Effects Development"]= "副效果部",
["Additional First Assistant Camera"]= "副第一摄影助理", ["Additional Gaffer"]= "额外领班", ["Additional Grip"]= "副器械工", ["Additional Hairstylist"]= "副发型师", ["Additional Key Construction Grip"]= "副器械建造师",
["Additional Key Grip"]= "副器械师", ["Additional Lighting Technician"]= "副灯光工", ["Additional Music"]= "副音乐", ["Additional Music Supervisor"]= "副音乐总监", ["Additional Post-Production Supervisor"]= "副制作总监",
["Additional Photography"]= "副摄影", ["Additional Production Assistant"]= "副制作助理", ["Additional Production Sound Mixer"]= "副制作混音师", ["Additional Script Supervisor"]= "副剧本监制", ["Additional Set Dresser"]= "临时服装师",
["Additional Second Assistant Camera"]= "副第二摄影助理", ["Additional Second Assistant Director"]= "第二副导演", ["Additional Soundtrack"]= "副原声", ["Additional Writing"]= "副编剧", ["Administration"]= "行政",
["Administrative Assistant"]= "首席助理", ["Aerial Camera"]= "航拍镜头", ["Aerial Camera Technician"]= "航拍镜头技术支持", ["Aerial Coordinator"]= "航拍协调", ["Animal Coordinator"]= "动物协调员",
["Aerial Director of Photography"]= "航拍摄像导演", ["Animation"]= "动画", ["Animation Coordinator"]= "动画协调", ["Animation Department Coordinator"]= "动画部协调", ["Animation Director"]= "动画导演",
["Animation Fix Coordinator"]= "动画修复协调", ["Animation Manager"]= "动画经理", ["Animation Production Assistant"]= "动画摄制助理", ["Animation Supervisor"]= "动画总监", ["Animation Technical Director"]= "动画技术导演",
["Animatronic and Prosthetic Effects"]= "电子动物和假肢特效", ["Animatronics Designer"]= "动画设计师", ["Animatronics Supervisor"]= "动画咨询师", ["Apprentice Sound Editor"]= "实习声音编辑器", ["Armorer"]= "军械员",
["Archival Footage Coordinator"]= "档案影像协调", ["Archival Footage Research"]= "档案影像研究", ["Armory Coordinator"]= "军械协调员", ["Art Department Assistant"]= "艺术部助理", ["Art Department Coordinator"]= "艺术部协调",
["Art Department Manager"]= "艺术部经理", ["Art Direction"]= "艺术指导", ["Assistant Art Director"]= "助理艺术指导", ["Assistant Costume Designer"]= "助理服装设计师", ["Assistant Director"]= "副导演",
["Assistant Editor"]= "助理剪辑师", ["Assistant Location Manager"]= "外景制片助理", ["Assistant Makeup Artist"]= "化妆助理", ["Assistant Music Supervisor"]= "音乐总监助理", ["Assistant Picture Editor"]= "图片编辑助理",
["Assistant Production Coordinator"]= "制片协调人助理", ["Assistant Production Manager"]= "制片经理助理", ["Assistant Property Master"]= "助理道具管理员", ["Assistant Script"]= "脚本助理", ["Associate Producer"]= "助理制片人",
["Associate Choreographer"]= "助理编导", ["Author"]= "作者", ["Background Designer"]= "布景", ["Battle Motion Coordinator"]= "动作指导", ["Best Boy Electric"]= "照明助手", ["Best Boy Electrician"]= "照明助手", ["Book"]= "原著",
["Boom Operator"]= "录音话筒操作员", ["CG Engineer"]= "CG 工程师", ["CG Painter"]= "CG 绘画", ["CG Supervisor"]= "CG 总监", ["CGI Supervisor"]= "CGI 总监", ["Cableman"]= "电缆员", ["Cameo"]= "浮雕", ["Camera Intern"]= "见习摄像师",
["Camera Department Manager"]= "摄像经理", ["Camera Operator"]= "摄像师", ["Camera Supervisor"]= "摄像总监", ["Camera Technician"]= "摄像技术员", ["Carpenter"]= "木工", ["Casting"]= "选角", ["Casting Associate"]= "演员部助理",
["Character Technical Supervisor"]= "角色技术总监", ["Characters"]= "角色", ["Chef"]= "厨师", ["Chief Technician / Stop-Motion Expert"]= "主任技师 / 定格动画专家", ["Choreographer"]= "编舞", ["Cinematography"]= "摄影",
["Cloth Setup"]= "服装设定", ["Co-Art Director"]= "联合艺术总监", ["Co-Costume Designer"]= "联合服装设计", ["Co-Executive Producer"]= "联合执行制片人", ["Co-Producer"]= "联合制片人", ["Co-Writer"]= "联合编剧",
["Color Designer"]= "色彩师", ["Color Timer"]= "配光员", ["Comic Book"]= "漫画书", ["Commissioning Editor"]= "组稿编辑", ["Compositor"]= "合成", ["Conceptual Design"]= "概念设计", ["Construction Coordinator"]= "建筑协调",
["Construction Foreman"]= "建筑工头", ["Consulting Producer"]= "制片顾问", ["Costume Design"]= "服装设计", ["Costume Supervisor"]= "服装总监", ["Craft Service"]= "膳食服务", ["Creative Consultant"]= "创意顾问",
["Creative Producer"]= "创意制作", ["Creator"]= "创作人", ["Creature Design"]= "生物设计", ["Department Administrator"]= "部门主管", ["Development Manager"]= "部门经理", ["Dialect Coach"]= "方言教练", ["Dialogue"]= "对白",
["Dialogue Editor"]= "对白编辑", ["Digital Compositor"]= "数字合成", ["Digital Effects Supervisor"]= "数字效果总监", ["Digital Intermediate"]= "数字中间片", ["Directing Lighting Artist"]= "照明艺术指导",
["Digital Producer"]= "数字制作", ["Director"]= "导演", ["Director of Photography"]= "摄影指导", ["Documentation & Support"]= "文稿支持", ["Dolby Consultant"]= "杜比顾问", ["Dramaturgy"]= "剧作理论", ["Driver"]= "司机",
["Editor"]= "剪辑", ["Editorial Coordinator"]= "剪辑协调", ["Editorial Manager"]= "编辑经理", ["Editorial Production Assistant"]= "剪辑制作助理", ["Editorial Services"]= "剪辑服务", ["Editorial Staff"]= "剪辑人员",
["Electrician"]= "电工", ["Executive Consultant"]= "执行顾问", ["Executive In Charge Of Post Production"]= "执行后期制作主管", ["Executive In Charge Of Production"]= "执行制片主管", ["Executive Music Producer"]= "执行音乐制作",
["Executive Producer"]= "执行制片人", ["Executive Visual Effects Producer"]= "执行视效制作", ["Executive in Charge of Finance"]= "执行财务主管", ["Facial Setup Artist"]= "面妆艺术", ["First Assistant Camera"]= "第一助理摄像",
["Finance"]= "财政", ["First Assistant Editor"]= "第一助理剪辑", ["First Assistant Sound Editor"]= "第一助理音响编辑", ["Fix Animator"]= "固定动画师", ["Foley"]= "特殊音效", ["Graphic Novel Illustrator"]= "图文小说插画",
["Gaffer"]= "电工", ["Greensman"]= "植物道具员", ["Grip"]= "场务", ["Gun Wrangler"]= "枪支管理", ["Hair Department Head"]= "发型部主管", ["Hair Designer"]= "发型设计师", ["Hair Setup"]= "发型设置", ["Hairstylist"]= "发型师",
["Helicopter Camera"]= "直升机摄像", ["I/O Manager"]= "I/O 经理", ["I/O Supervisor"]= "I/O 总监", ["Idea"]= "创意", ["Imaging Science"]= "影像科学", ["Information Systems Manager"]= "信息系统经理", ["Interior Designer"]= "室内设计",
["Key Hair Stylist"]= "关键发型师", ["Keyboard Programmer"]= "键盘程序员", ["Layout"]= "布局", ["Lead Painter"]= "画家长", ["Leadman"]= "工长", ["Legal Services"]= "法律服务", ["Lighting Artist"]= "灯光艺术", ["Lighting Camera"]= "灯光摄影",
["Lighting Coordinator"]= "灯光协调", ["Lighting Manager"]= "灯光经理", ["Lighting Production Assistant"]= "灯光制作助理", ["Lighting Supervisor"]= "灯光总监", ["Lighting Technician"]= "灯光师", ["Line Producer"]= "现场制片人",
["Loader"]= "搬运工", ["Location Manager"]= "场地管理经理", ["Location Scout"]= "场地寻找", ["Machinist"]= "机械师", ["Makeup Artist"]= "化妆师", ["Makeup Department Head"]= "化妆部主管", ["Makeup Designer"]= "化妆设计",
["Makeup Effects"]= "化妆效果", ["Manager of Operations"]= "运营经理", ["Martial Arts Choreographer"]= "武术指导", ["Master Lighting Artist"]= "主灯光师", ["Mechanical & Creature Designer"]= "机械与生物设计师",
["Mix Technician"]= "混音技术员", ["Mixing Engineer"]= "混音师", ["Modeling"]= "模型", ["Motion Actor"]= "动作演员", ["Motion Capture Artist"]= "动作捕捉师", ["Music"]= "音乐", ["Music Director"]= "音乐指导",
["Music Editor"]= "音乐编辑", ["Music Supervisor"]= "音乐总监", ["Musical"]= "音乐", ["Novel"]= "小说", ["Opera"]= "歌剧", ["Orchestrator"]= "配器师", ["Original Music Composer"]= "原创音乐作曲", ["Original Story"]= "原创小说",
["Other"]= "其他", ["Painter"]= "画家", ["Photoscience Manager"]= "Photoscience 经理", ["Picture Car Coordinator"]= "车辆场景协调员", ["Post Production Assistant"]= "后期制作助理", ["Post Production Consulting"]= "后期制作顾问",
["Poem"]= "诗歌", ["Post Production Supervisor"]= "后期制作总监", ["Post-Production Manager"]= "后期制作经理", ["Producer"]= "制片人", ["Production Accountant"]= "制片助理", ["Production Artist"]= "制片艺术",
["Production Controller"]= "制片控制", ["Production Coordinator"]= "制片协调", ["Production Design"]= "制片设计", ["Production Director"]= "制片指导", ["Production Illustrator"]= "插画制作", ["Production Intern"]= "见习制片人",
["Production Manager"]= "制片主任", ["Production Office Assistant"]= "制片办公室助理", ["Production Office Coordinator"]= "制片办公室协调人", ["Production Sound Mixer"]= "现场混音师", ["Production Supervisor"]= "制片总监",
["Projection"]= "投影", ["Prop Maker"]= "道具制作", ["Property Master"]= "道具管理员", ["Propmaker"]= "道具制作", ["Prosthetic Supervisor"]= "假肢总监", ["Public Relations"]= "公共关系", ["Publicist"]= "公关",
["Pyrotechnic Supervisor"]= "烟火总监", ["Quality Control Supervisor"]= "质量控制总监", ["Radio Play"]= "广播剧", ["Recording Supervision"]= "录像总监", ["Researcher"]= "研究员", ["Rigging Gaffer"]= "吊具领班",
["Rigging Grip"]= "吊具场务", ["Scenario Writer"]= "剧作家", ["Scenic Artist"]= "布景工", ["Schedule Coordinator"]= "计划协调员", ["Score Engineer"]= "配乐师", ["Scoring Mixer"]= "配乐录音师", ["Screenplay"]= "剧本",
["Screenstory"]= "情节策划", ["Script"]= "剧本", ["Script Coordinator"]= "剧本协调", ["Script Editor"]= "剧本编辑", ["Script Supervisor"]= "剧本指导", ["Sculptor"]= "雕塑", ["Second Film Editor"]= "第二剪辑", ["Seamstress"]= "裁缝",
["Second Unit"]= "第二剧组", ["Second Unit Cinematographer"]= "第二剧组摄影师", ["Security"]= "安全", ["Senior Executive Consultant"]= "高级执行顾问", ["Sequence Artist"]= "序列艺术家", ["Sequence Lead"]= "序列指挥",
["Sequence Supervisor"]= "序列指导", ["Series Composition"]= "剧集构思", ["Series Director"]= "剧集导演", ["Series Writer"]= "剧集编剧", ["Set Costumer"]= "布景供应", ["Set Decoration"]= "布景装饰", ["Set Decoration Buyer"]= "布景装饰采购",
["Set Designer"]= "布景设计", ["Set Dressing Artist"]= "布景艺术", ["Set Dressing Manager"]= "布景经理", ["Set Dressing Production Assistant"]= "布景制作助理", ["Set Dressing Supervisor"]= "布景总监", ["Set Medic"]= "医疗组",
["Set Production Assistant"]= "布景师助理", ["Set Production Intern"]= "见习布景师", ["Sets & Props Artist"]= "布景及道具艺术", ["Sets & Props Supervisor"]= "布景及道具总监", ["Settings"]= "设置", ["Shading"]= "着色处理",
["Shoe Design"]= "鞋设计", ["Short Story"]= "短篇小说", ["Sign Painter"]= "签约画家", ["Simulation & Effects Artist"]= "模拟和效果师", ["Simulation & Effects Production Assistant"]= "模拟和效果制作助理", ["Software Engineer"]= "软件工程师",
["Software Team Lead"]= "软件团队主管", ["Songs"]= "歌曲", ["Sound"]= "声音", ["Sound Design Assistant"]= "声音设计助理", ["Sound Designer"]= "声音设计", ["Sound Director"]= "声音指导", ["Sound Editor"]= "声音编辑",
["Sound Engineer"]= "声响师", ["Sound Effects Editor"]= "音效编辑", ["Sound Mixer"]= "调音", ["Sound Montage Associate"]= "声音蒙太奇助理", ["Sound Re-Recording Mixer"]= "声音混录师", ["Sound Recordist"]= "录音师",
["Special Effects Coordinator"]= "特效协调", ["Special Effects"]= "特效", ["Special Effects Supervisor"]= "特效总监", ["Special Guest"]= "特邀嘉宾", ["Special Guest Director"]= "特邀指导", ["Special Sound Effects"]= "特殊音效",
["Stand In"]= "支援", ["Standby Painter"]= "待机画家", ["Steadicam Operator"]= "摄影稳定操作", ["Steadycam"]= "摄影稳定装置", ["Still Photographer"]= "静态摄像师", ["Story"]= "故事", ["Storyboard"]= "分镜", ["Studio Teacher"]= "片厂教师",
["Stunt Coordinator"]= "特技协调", ["Stunts"]= "特技", ["Stunt Double"]= "特技替身", ["Stunts Coordinator"]= "特技协调", ["Supervising Animator"]= "动画总监", ["Supervising Art Director"]= "艺术指导总监", ["Supervising Producer"]= "监制",
["Supervising Film Editor"]= "影片剪辑总监", ["Supervising Sound Editor"]= "声音编辑总监", ["Supervising Sound Effects Editor"]= "音效编辑总监", ["Supervising Technical Director"]= "技术指导总监", ["Supervisor of Production Resources"]= "制片资源主管",
["Systems Administrators & Support"]= "系统管理员及支持", ["Tattooist"]= "纹身", ["Technical Supervisor"]= "技术总监", ["Telecine Colorist"]= "胶转磁调色师", ["Teleplay"]= "电视剧剧本", ["Temp Music Editor"]= "临时音乐编辑",
["Temp Sound Editor"]= "临时声音编辑", ["Thanks"]= "感谢", ["Theatre Play"]= "剧院播放", ["Title Graphics"]= "标题图形", ["Translator"]= "翻译", ["Transportation Captain"]= "运输队长", ["Transportation Co-Captain"]= "运输联合队长",
["Transportation Coordinator"]= "运输协调员", ["Treatment"]= "文学脚本", ["Underwater Camera"]= "水下摄像", ["Unit Manager"]= "剧组经理", ["Unit Production Manager"]= "剧组制片主任", ["Unit Publicist"]= "剧组公关",
["Utility Stunts"]= "剧组特技", ["VFX Artist"]= "VFX 艺术", ["VFX Editor"]= "VFX 编辑", ["VFX Production Coordinator"]= "VFX 制作协调", ["VFX Supervisor"]= "VFX 总监", ["Video Assist Operator"]= "录像辅助操作员",
["Video Game"]= "电子游戏", ["Visual Development"]= "视觉部", ["Visual Effects"]= "视觉效果", ["Visual Effects Art Director"]= "视觉效果艺术指导", ["Visual Effects Coordinator"]= "视觉效果协调", ["Visual Effects Editor"]= "视觉效果编辑",
["Visual Effects Design Consultant"]= "视觉效果设计顾问", ["Visual Effects Producer"]= "视效制作", ["Visual Effects Supervisor"]= "视觉效果总监", ["Vocal Coach"]= "声乐教练", ["Voice"]= "语音", ["Wigmaker"]= "假发制作", ["Writer"]= "编剧",
["Character Designer"]= "角色设计", ["Original Concept"]= "原始概念", ["Original Series Design"]= "原始系列设计", ["Key Animation"]= "原画", ["Special Effects Makeup Artist"]= "特效化妆师", ["Storyboard Artist"]= "分镜师", ["Art Designer"]= "美术设计",
["Production Executive"]= "制片主管", ["Casting Director"]= "选角导演", ["Casting Consultant"]= "选角顾问", ["First Assistant Director"]= "第一副导演", ["Staff Writer"]= "特约编剧", ["Second Unit Director"]= "第二组导演", ["Floor Runner"]= "场地管理",
["Theme Song Performance"]= "主题曲演唱", ["Music Producer"]= "音乐制作人", ["Foley Editor"]= "拟音编辑", ["Foley Artist"]= "拟音师", ["Sound Effects"]= "音效", ["In Memory Of"]= "以纪念", ["Assistant Director of Photography"]= "摄影副导演",
["Additional Storyboarding"]= "副分镜", ["Key Costumer"]= "关键服饰师",
[""]= "其他", ["Unknown"]= "未知",
},
["media_type_epgroup"] = { [1]= "原播出版", [2]= "绝对数版", [3]= "光盘版", [4]= "数字版", [5]= "故事线版", [6]= "制作版", [7]= "电视版", [""]= "其他", ["Unknown"]= "未知", },
}
--[[
-- 媒体信息<table>
Anime_data = {
["media_title"] = (mediai["media_title"]) or (mediai["media_name"]), -- 标题
["interf_title"],
["original_title"] = (mediai["original_title"]) or (mediai["original_name"]),-- 原始语言标题
["media_id"] = tostring(mediai["id"]), -- 媒体的 tmdb id
["media_imdbid"] -- str: ^tt[0-9]{7}$
["media_type"] = mediai["media_type"], -- 媒体类型 movie tv person
["genre_ids"] = mediai["genre_ids"], -- 流派类型的编号 table/Array
["genre_names"], -- 流派类型 table/Array
["keyword_names"]
["release_date"] = mediai["release_date"] or mediai["air_date"] or mediai["first_air_date"], -- 首映/本季首播/发行日期
["overview"] = mediai["overview"], -- 剧情梗概 str
["overview_season"]
["overview_epgroup"]
["tagline"] -- str
["vote_average"] = mediai["vote_average"], -- 平均tmdb评分 num
["vote_count"] -- 评分人数 num
["content_rating"]
["rate_mpaa"], -- MPAA分级 str
["homepage_path"] --主页网址 str
["status"] -- 发行状态 str
["popularity_num"] -- 流行度 num
["runtime"] -- {num}
["imdb_id"]
["facebook_id"]
["instagram_id"]
["twitter_id"]
["tvdb_id"]
["original_language"] = mediai["original_language"], -- 原始语言 "en"
["spoken_language"] -- {str:iso_639_1, str:name}
["tv_language"] -- tv {"en"}
["origin_region"] -- tv 原始首播国家地区 {"US"}
["production_region"] -- {str:iso_3166_1, str:name}
["production_company"], -- 出品公司 - {num:id, str:logo_path, str:name, str:origin_region}
["tv_network"], -- 播映剧集的电视网 - {...}
--["person_staff"], -- "job1:name1;job2;name2;..."
--["tv_creator"] -- {num:id, str:credit_id, str:name, 1/2:gender, str:profile_path}
["person_crew"]
--["person_character"], -- { ["name"]=string, --人物名称 ["actor"]=string, --演员名称 ["link"]=string, --人物资料页URL ["imgurl"]=string --人物图片URL }
["person_cast"]
["mo_is_adult"] -- bool
["mo_is_video"] -- bool
["mo_belongs_to_collection"]-- {}
["mo_budget"] -- 预算 num
["mo_revenue"] -- 收入 num
["season_count"], -- 剧集的 总季数 num - 含 S00/Specials/特别篇/S05/Season 5/第 5 季
["season_number"], -- 本季的 季序数 /第几季 num - 0-specials
["season_title"], -- 本季的 季名称 str - "季 2" "Season 2" "Specials"
["episode_count"], -- 本季的 总集数 num
["episode_total"], -- 剧集所有季的 总集数 num
["tv_first_air_date"] = ["first_air_date"], -- 剧集首播/发行日期 str
["tv_in_production"] -- bool
["tv_last_air_date"] -- str
["tv_last_episode_to_air"] -- {num:episode_number, int:season_number, int:id, str:name, str:overview,
str:air_date, str:production_code, str/nil:still_path, num:vote_average, int:vote_count}
["tv_next_episode_to_air"] -- null or {...}
["tv_type"] -- str
["tv_is_epgroup"]
["tv_epgroup_id"]
["epgroup_title"]
["overview_epgroup"]
["season_count_eg"]
["episode_total_eg"]
["epgroup_type"]
-- Image_tmdb.prefix..Image_tmdb.poster[Image_tmdb.max_ix] .. data["image_path"]
["tmdb_art_path"]= { [tmdb_type] = { [origin]={url,lang}, [interf]={}, },} -- movieposter tvposter seasonposter moviebackground tvbackground
["fanart_path"] ={ [fanart_type] = { [origin]={url,lang,disc_type,season}, [interf]={}, },} -- seasonX:"0"/all/others
--
}]] --
---------------------
-- 资料脚本部分
-- copy (as template) from & thanks to "../library/bangumi.lua", "../danmu/bilibili.lua" in "KikoPlay/library"|KikoPlayScript
--
-- 完成搜索功能
-- keyword: string,搜索关键字
-- 返回:Array[AnimeLite]
function search(keyword,options)
local settings_search_type=""
if(options["search_type"] ~= "movie" and options["search_type"] ~= "tv") then
settings_search_type="multi"
else settings_search_type=options["search_type"]
end
local mediais={}
if options["search_keyword_process"] =="0" then options["search_keyword_process"]="plain"
elseif options["search_keyword_process"] =="1" then options["search_keyword_process"]="filename"
end
if options["search_type"] =="电影/剧集" then options["search_type"]="multi"
elseif options["search_type"] =="电影" then options["search_type"]="movie"
elseif options["search_type"] =="剧集" then options["search_type"]="tv"
end
if options["search_keyword_process"]=="plain" then
if options["search_keyword_astitle"] =="0" then
mediais= searchMediaInfo(keyword,options,settings_search_type)
elseif options["search_keyword_astitle"] =="1" then
mediais= searchMediaInfo(keyword,options,settings_search_type,keyword)
end
elseif true or options["search_keyword_process"]=="filename" then
local mType = "multi"
local mTitle,mSeason,mEp,mEpX,mTitleX,mEpType = "","","","","",""
local resMirbf= Path.getMediaInfoRawByFilename(keyword..".mkv")
mTitle=resMirbf[1] or ""
mSeason=resMirbf[2] or ""
mEp=resMirbf[3] or ""
mEpX=resMirbf[4] or ""
mTitleX=resMirbf[5] or ""
mEpType=resMirbf[6] or ""
local mIsSp=false -- 是否为特别篇
if mEpType~="" and mEpType~="EP" then
mIsSp=true
end
if mEp~="" or mSeason~="" then
mType="tv"
else
mType="multi"
end
local resultSearch
if options["search_keyword_astitle"] =="0" then
resultSearch= searchMediaInfo(mTitle,options,
((settings_search_type=="multi")and{mType}or{settings_search_type})[1])
elseif options["search_keyword_astitle"] =="1" then
resultSearch= searchMediaInfo(mTitle,options,
((settings_search_type=="multi")and{mType}or{settings_search_type})[1],keyword)
end
local mSeasonTv = ""
local tmpsSearchlSeasonall= options["search_list_season_all"]
for _, value in ipairs(resultSearch or {}) do
if mSeason =="" and value["media_type"] == "movie" then
table.insert(mediais, value)
goto continue_search_KMul_Mnfo
elseif value["media_type"]=="tv" then
if mSeason == "" then
if tmpsSearchlSeasonall=="0" then
mSeasonTv = ((mIsSp)and{0}or{1})[1]
elseif true or tmpsSearchlSeasonall=="1" then
end
else mSeasonTv = math.floor(tonumber(mSeason))
end
if value["season_number"] == mSeasonTv or tostring(value["season_number"]) == tostring(mSeasonTv) then
table.insert(mediais, value)
goto continue_search_KMul_Mnfo
elseif value["season_number"] == 0 or tostring(value["season_number"]) == tostring(0) or
value["season_number"] == 1 or tostring(value["season_number"]) == tostring(1) or
(string.isEmpty(mSeasonTv)) then
table.insert(mediais, value)
goto continue_search_KMul_Mnfo
else
goto continue_search_KMul_Mnfo
end
end
::continue_search_KMul_Mnfo::--continue_match_OMul_Mnfo
end
end
return mediais
end
function searchMediaInfo(keyword, options, settings_search_type, old_title)
-- kiko.log("[INFO] Searching <" .. keyword .. "> in " .. settings_search_type)
-- 获取 是否 元数据使用原语言标题
options = options or {}
local miotTmp = settings['metadata_info_origin_title']
if (miotTmp == '0') then
Metadata_info_origin_title = false
elseif (miotTmp == '1') then
Metadata_info_origin_title = true
end
-- http get 请求 参数
local query = {
["api_key"] = settings["api_key"],
["language"] = settings["metadata_lang"],
["query"] = string.gsub(keyword,"/\\%?"," "),
["page"] = Metadata_search_page,
["include_adult"] = Metadata_search_adult
}
local header = {["Accept"] = "application/json"}
if settings["api_key"] == "<<API_Key_Here>>" then
kiko.log("Wrong api_key! 请在脚本设置中填写正确的 TMDb的API密钥。")
kiko.message("[错误] 请在脚本设置中填写正确的 `TMDb的API密钥`!",1|8)
kiko.execute(true, "cmd", {"/c", "start", "https://www.themoviedb.org/settings/api"})
error("Wrong api_key! 请在脚本设置中填写正确的API密钥。")
end
-- 获取 http get 请求 - 查询特定媒体类型 特定关键字 媒体信息的 搜索结果列表
if(settings_search_type ~= "movie" and settings_search_type ~= "tv") then
settings_search_type="multi"
end
-- tmdb_search_multi
local err, reply = kiko.httpget(string.format("http://api.themoviedb.org/3/search/" .. settings_search_type),
query, header)
if err ~= nil or (reply or{}).hasError then
kiko.log("[ERROR] TMDb.API.reply-search."..settings_search_type..".httpget: "..err..
(((reply or{}).hasError) and{" <"..math.floor((reply or{}).statusCode).."> "..(reply or{}).errInfo} or{""})[1])
if tostring(err) == ("Host requires authentication") then
kiko.message("[错误] 请在脚本设置中填写正确的 `TMDb的API密钥`!",1|8)
kiko.execute(true, "cmd", {"/c", "start", "https://www.themoviedb.org/settings/api"})
end
error(err..(((reply or{}).hasError) and{" <"..math.floor((reply or{}).statusCode).."> "..(reply or{}).errInfo} or{""})[1])
end
--[[if reply["success"]=="false" or reply["success"]==false then
err = reply["status_message"]
kiko.log("[ERROR] TMDb.API.reply-search."..settings_search_type..": ".. err)
error(err)
end ]]--
-- json:reply -> Table:obj 获取的结果
local content = reply["content"]
local err, obj = kiko.json2table(content)
if err ~= nil then
kiko.log("[ERROR] TMDb.API.reply-search."..settings_search_type..".json2table: ".. err)
error(err)
end
-- Table:obj["results"] 搜索结果<table> -> Array:mediai
local mediais = {}
for _, mediai in pairs(obj['results'] or {}) do
if (mediai["media_type"] ~= 'tv' and mediai["media_type"] ~= 'movie' and settings_search_type == "multi") then
-- 跳过对 演员 的搜索 - 跳过 person
goto continue_search_a
end
-- 显示的媒体标题 title/name
local mediaName
if (Metadata_info_origin_title) then
mediaName = string.unescape(mediai["original_title"] or mediai["original_name"])
else
mediaName = string.unescape(mediai["title"] or mediai["name"])
end
-- local extra = {}
local data = {} -- 媒体信息
-- 媒体类型
if settings_search_type == "multi" then
data["media_type"] = mediai["media_type"] -- 媒体类型 movie tv person
elseif settings_search_type == "movie" then
data["media_type"] = "movie"
elseif settings_search_type == "tv" then
data["media_type"] = "tv"
else
data["media_type"] = mediai["media_type"] -- 媒体类型 movie tv person
end
data["media_title"] = string.unescape(mediai["title"]) or string.unescape(mediai["name"]) -- 标题
data.interf_title = string.unescape(mediai["title"]) or string.unescape(mediai["name"]) -- 标题
data["original_title"] = string.unescape(mediai["original_title"]) or string.unescape(mediai["original_name"]) -- 原始语言标题
data["media_id"] = string.format("%d", mediai["id"]) -- 媒体的 tmdb id
data["release_date"] = mediai["release_date"] or mediai["first_air_date"] -- 首映/首播/发行日期
data["original_language"] = mediai["original_language"] -- 原始语言
data["origin_region"] = table.deepCopy(mediai["origin_country"]) or{} -- 原始首映/首播国家地区
if not string.isEmpty(mediai.overview) and mediai.overview~=mediai.title and mediai.overview~=mediai.original_title then
data["overview"] = (string.isEmpty(mediai.overview) and{""} or{ string.gsub(mediai["overview"], "\r?\n\r?\n", "\n") })[1] -- 剧情梗概
end
data["vote_average"] = mediai["vote_average"] -- 平均tmdb评分
-- 图片链接
local tmpTmdbartImgpath= nil
if not string.isEmpty(mediai.poster_path) then
tmpTmdbartImgpath=(table.isEmpty(tmpTmdbartImgpath) and{ {} }or{ tmpTmdbartImgpath })[1]
tmpTmdbartImgpath[data.media_type.."poster"]={}
tmpTmdbartImgpath[data.media_type.."poster"].interf= {
["url"]= mediai.poster_path,
["lang"]= "und", --string.sub(settings["metadata_lang"],1,2),
}
end
if not string.isEmpty(mediai.backdrop_path) then
tmpTmdbartImgpath=(table.isEmpty(tmpTmdbartImgpath) and{ {} }or{ tmpTmdbartImgpath })[1]
tmpTmdbartImgpath[data.media_type.."background"]={}
tmpTmdbartImgpath[data.media_type.."background"].interf= {
["url"]= mediai.backdrop_path,
["lang"]= "und",
}
end
data.tmdb_art_path = (table.isEmpty(tmpTmdbartImgpath) and{ nil }or{ tmpTmdbartImgpath })[1]
--? OTHER_INFO
-- data["vote_count"] = tonumber(mediai["vote_count"]or"")
-- data["popularity_num"] = tonumber(mediai["popularity"]or"")
data["mo_is_adult"]= (( mediai["adult"]==nil or mediai["adult"]=="" )and{ nil }or{ tostring(mediai["adult"])=="true" })[1]
data["mo_is_video"]= (( mediai["video"]==nil or mediai["video"]=="" )and{ nil }or{ tostring(mediai["video"])=="true" })[1]
data.update_info= {}
data.update_info.version= info.version
data.update_info.timestamp= os.time()
data.update_info.level_detail= "scrape"
-- season_number, episode_count,
if data["media_type"] == "movie" then
-- movie - 此条搜索结果是电影
-- 把电影视为单集电视剧
data["season_number"] = 1
data["episode_count"] = 1
data["season_count"] = 1
data["episode_total"] = 1
data["season_title"] = data["original_title"]
local queryMo = {
["api_key"] = settings["api_key"],
["language"] = settings["metadata_lang"]
}
-- info
local objMo= Kikoplus.httpgetMediaId(queryMo,data["media_type"].."/"..data["media_id"])
--? OTHER_INFO m&t of mo
-- genre_ids -> genre_names
data["genre_names"] = {} -- 流派类型 table/Array
-- 流派类型 id ->名称
for key, value in pairs(mediai["genres"] or {}) do -- key-index value-id
if not string.isEmpty(value.name) then
table.insert(data["genre_names"],((Translation[settings["metadata_lang"]] or{}).media_genre or{})[value.id] or value.name)
end
end
data["runtime"] = ( objMo["runtime"]==nil or objMo["runtime"]=="" )and{ nil }or{ tostring(objMo["runtime"]) }
data["homepage_path"]= (( objMo["homepage"]==nil or objMo["homepage"]=="" )and{ nil }or{ objMo["homepage"] })[1]
for index, value in ipairs(objMo["production_companies"] or {}) do
data["production_company"]=data["production_company"]or{}
table.insert(data["production_company"],{
-- ["id"]= tonumber(value["id"]or""),
-- ["logo_path"]= (( value["logo_path"]==nil or value["logo_path"]=="" )and{ nil }or{ value["logo_path"] })[1],
["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
["origin_region"] = (( value["origin_country"]==nil or value["origin_country"]=="" )and{ nil }or{ value["origin_country"] })[1],
})
end
for index, value in ipairs(objMo["production_countries"] or {}) do
data["production_region"]=data["production_region"]or {}
table.insert(data["production_region"],{
["iso_3166_1"]= (( value["iso_3166_1"]==nil or value["iso_3166_1"]=="" )and{ nil }or{ value["iso_3166_1"] })[1],
-- ["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
})
end
for index, value in ipairs(objMo["spoken_languages"] or {}) do
data["spoken_language"]=data["spoken_language"]or {}
if not string.isEmpty(value.iso_639_1) then
table.insert(data["spoken_language"],{
["iso_639_1"]= (( value["iso_639_1"]==nil or value["iso_639_1"]=="" )and{ nil }or{ value["iso_639_1"] })[1],
-- ["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
-- ["english_name"]= (( value["english_name"]==nil or value["english_name"]=="" )and{ nil }or{ value["english_name"] })[1],
})
end
end
if string.isEmpty(data.original_language) then
data.original_language = ((data.spoken_language or{})[1] or{}).iso_639_1
end
data.status= ( string.isEmpty(objMo.status) and{ "Unknown" }or{ objMo.status })[1]
--? OTHER_INFO mo
data["mo_belongs_to_collection"] = table.deepCopy(objMo["belongs_to_collection"]) or{}
data["mo_budget"] = tonumber(objMo["budget"]or"")
data["media_imdbid"]= (( objMo["imdb_id"]==nil or objMo["imdb_id"]=="" )and{ nil }or{ objMo["imdb_id"] })[1]
data["mo_revenue"] = tonumber(objMo["revenue"]or"")
objMo.tagline= string.gsub(objMo.tagline or"", "[\n\r]", "")
if string.isEmpty(objMo.tagline) or objMo.tagline==objMo.title or objMo.tagline==objMo.original_title then
data.tagline= nil
elseif true then
data.tagline= string.gsub(objMo.tagline or"", "[\n\r]", "")
end
local media_data_json
-- 把媒体信息<table>转为json的字符串
err, media_data_json = kiko.table2json(table.deepCopy(data) or{})
if err ~= nil then
kiko.log(string.format("[ERROR] table2json: %s", err))
end
-- kiko.log(string.format("[INFO] mediaName: [ %s ], data:\n%s", mediaNameSeason, table.toStringBlock(data)));
-- get "Movie Name (YYYY)"
if data["release_date"] ~= nil and data["release_date"] ~= "" then
mediaName = mediaName .. string.format(' (%s)', string.sub(data["release_date"], 1, 4))
end
local mediaLang={data["original_language"]}
Array.extendUnique(mediaLang,data["spoken_language"],"iso_639_1")
Array.extendUnique(mediaLang,data["tv_language"])
local mediaRegion=table.deepCopy(data["origin_region"]) or{}
Array.extendUnique(mediaRegion,data["production_region"],"iso_3166_1")
mediaLang={mediaLang[1] or nil}
mediaRegion={mediaRegion[1] or nil}
for index, value in ipairs(mediaLang) do
mediaLang[index]= ((Translation[settings["metadata_lang"]] or{}).language or{})[value] or value
end
for index, value in ipairs(mediaRegion) do
mediaRegion[index]= ((Translation[settings["metadata_lang"]] or{}).region or{})[value] or value
end
table.insert(mediais, {
["name"] = (( string.isEmpty(old_title) )and{ mediaName }or{ old_title })[1],
["data"] = media_data_json,
["extra"] = "类型:" .. (((Translation[settings["metadata_lang"]] or{}).media_type or{})[data.media_type] or data.media_type or (Translation["und-XX"]).media_type["Unknown"] or"") ..
((data.mo_is_video==true or data.mo_is_video=="true") and{ ", ".. (((Translation[settings["metadata_lang"]] or{}).media_type or{})["Movie Video"] or"Video Movie") }or{ "" })[1] ..
" | 首映:" .. ((data["release_date"] or "") .. " " .. (data["first_air_date"] or "")) ..
" | 语言:" .. Array.toStringLine(mediaLang) .. "; " .. Array.toStringLine(mediaRegion) ..
" | 状态:" .. (((Translation[settings["metadata_lang"]] or{}).media_status or{})[data.status] or data.status or (Translation["und-XX"] or{}).media_status["Unknown"] or "") ..
"\r\n简介:" .. string.gsub(data.overview or"", "\r?\n", " ")..
(( string.isEmpty(old_title) )and{ "" }or{ "\r\n弃用的标题:" ..mediaName })[1],
["scriptId"] = "Kikyou.l.TMDb",
["media_type"] = data["media_type"],
})
elseif data["media_type"] == "tv" then
-- tv
local queryTv = {
["api_key"] = settings["api_key"],
["language"] = settings["metadata_lang"],
["append_to_response"] = ((options["search_list_season_epgroup"]=="1") and{"episode_groups"}or{""})[1],
}
local objTv=Kikoplus.httpgetMediaId(queryTv,data["media_type"] .. "/" .. data["media_id"])
-- info
data["tv_first_air_date"] = data["release_date"]
data["season_count"] = objTv["number_of_seasons"]
data["episode_total"] = objTv["number_of_episodes"]
if tonumber(data.season_count) then
data.season_count= math.floor(tonumber(data.season_count))
end
if tonumber(data.episode_total) then
data.episode_total= math.floor(tonumber(data.episode_total))
end
--? OTHER_INFO m&t of tv
-- genre_ids -> genre_names
data["genre_names"] = {} -- 流派类型 table/Array
-- 流派类型 id ->名称
for key, value in pairs(mediai["genres"] or {}) do -- key-index value-id
if not string.isEmpty(value.name) then
table.insert(data["genre_names"],((Translation[settings["metadata_lang"]] or{}).media_genre or{})[value.id] or value.name)
end
end
data["runtime"] = table.deepCopy(objTv["episode_run_time"]) or{}
data["homepage_path"]= (( objTv["homepage"]==nil or objTv["homepage"]=="" )and{ nil }or{ objTv["homepage"] })[1]
for index, value in ipairs(objTv["production_companies"] or {}) do
data["production_company"]=data["production_company"] or {}
table.insert(data["production_company"],{
-- ["id"]= tonumber(value["id"]or""),
-- ["logo_path"]= (( value["logo_path"]==nil or value["logo_path"]=="" )and{ nil }or{ value["logo_path"] })[1],
["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
["origin_region"] = (( value["origin_country"]==nil or value["origin_country"]=="" )and{ nil }or{ value["origin_country"] })[1],
})
end
for index, value in ipairs(objTv["production_countries"] or {}) do
data["production_region"]=data["production_region"] or {}
table.insert(data["production_region"],{
["iso_3166_1"]= (( value["iso_3166_1"]==nil or value["iso_3166_1"]=="" )and{ nil }or{ value["iso_3166_1"] })[1],
-- ["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
})
end
for index, value in ipairs(objTv["spoken_languages"] or {}) do
data["spoken_language"]=data["spoken_language"] or {}
table.insert(data["spoken_language"],{
["iso_639_1"]= (( value["iso_639_1"]==nil or value["iso_639_1"]=="" )and{ nil }or{ value["iso_639_1"] })[1],
-- ["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
-- ["english_name"]= (( value["english_name"]==nil or value["english_name"]=="" )and{ nil }or{ value["english_name"] })[1],
})
end
data.status= ( string.isEmpty(objTv.status) and{ "Unknown" }or{ objTv.status })[1]
--? OTHER_INFO tv
for _, value in ipairs(objTv["created_by"] or {}) do
data["person_crew"]=data["person_crew"] or {}
table.insert(data["person_crew"],{
-- ["gender"]= (( tonumber(value["gender"])==1 or tonumber(value["gender"])==2 )and{ tonumber(value["gender"]) }or{ nil })[1],
["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
["original_name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
["profile_path"]= (( value["profile_path"]==nil or value["profile_path"]=="" )and{ nil }or{ value["profile_path"] })[1],
["department"]= "Writing",
["job"]={"Creator"},
["id"] = tonumber(value["id"]or""),
-- ["credit_id"]= (( value["credit_id"]==nil or value["credit_id"]=="" )and{ nil }or{ value["credit_id"] })[1],
})
end
data["tv_in_production"]= (( objTv["in_production"]==nil or objTv["in_production"]=="" )and{ nil }or{ tostring(objTv["in_production"])=="true" })[1]
data["tv_language"] = table.deepCopy(objTv["languages"]) or{}
data["tv_last_air_date"]= (( objTv["last_air_date"]==nil or objTv["last_air_date"]=="" )and{ nil }or{ objTv["last_air_date"] })[1]
-- data["tv_last_episode_to_air"] = table.deepCopy(objTv["last_episode_to_air"]) or{}
-- data["tv_next_episode_to_air"]= table.deepCopy(objTv["next_episode_to_air"]) or{}
for index, value in ipairs(objTv["networks"] or {}) do
data["tv_network"]=data["tv_network"] or {}
table.insert(data["tv_network"],{
-- ["id"]= tonumber(value["id"]or""),
-- ["logo_path"]= (( value["logo_path"]==nil or value["logo_path"]=="" )and{ nil }or{ value["logo_path"] })[1],
["name"]= (( value["name"]==nil or value["name"]=="" )and{ nil }or{ value["name"] })[1],
["origin_region"] = (( value["origin_country"]==nil or value["origin_country"]=="" )and{ nil }or{ value["origin_country"] })[1],
})
end
data["tv_type"]= (( objTv["type"]==nil or objTv["type"]=="" )and{ "Unknown" }or{ objTv["type"] })[1]
objTv.tagline= string.gsub(objTv.tagline or"", "[\n\r]", "")
if string.isEmpty(objTv.tagline) or objTv.tagline==objTv.title or objTv.tagline==objTv.original_title then
data.tagline= nil
elseif true then
data.tagline= string.gsub(objTv.tagline or"", "\n", "")
end
-- Table:obj -> Array:mediai
-- local tvSeasonsIxs = {}
for _, tvSeasonsIx in pairs(objTv['seasons'] or {}) do
data["tv_season_id"] = tonumber(tvSeasonsIx.id or"")
if tonumber(data.tv_season_id) then
data.tv_season_id= math.floor(tonumber(data.tv_season_id))
end
data.tv_is_epgroup = false
local mediaNameSeason = mediaName -- 形如 "剧集名"
data["release_date"] = tvSeasonsIx["air_date"] -- 首播日期
data["season_title"] = tvSeasonsIx["name"]
if not string.isEmpty(tvSeasonsIx.overview) and tvSeasonsIx.overview~=data.overview and
tvSeasonsIx.overview~=mediai.title and tvSeasonsIx.overview~=mediai.original_title then
data.overview_season = string.gsub(tvSeasonsIx.overview, "\r?\n\r?\n", "\n")
end
tmpTmdbartImgpath= nil
if not string.isEmpty(tvSeasonsIx.poster_path) then
tmpTmdbartImgpath= {}
tmpTmdbartImgpath.seasonposter={}
tmpTmdbartImgpath.seasonposter.interf= {
["url"]= tvSeasonsIx.poster_path,
["lang"]= "und", --string.sub(settings["metadata_lang"],1,2),
}
end
if not table.isEmpty(tmpTmdbartImgpath) then
Array.extend(data.tmdb_art_path,tmpTmdbartImgpath)
end
data["season_number"] = math.floor(tvSeasonsIx["season_number"])
data["episode_count"] = math.floor(tvSeasonsIx["episode_count"]) -- of this season
if tonumber(data.season_number) then
data.season_number= math.floor(tonumber(data.season_number))
end
if tonumber(data.episode_count) then
data.episode_count= math.floor(tonumber(data.episode_count))
end
local seasonNameNormal -- 是否为 普通的季名称 S00/Specials/特别篇/S05/Season 5/第 5 季