diff --git a/VERSION b/VERSION index 6f39582cd..0518d30f4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-build63 +2.1.0-build64 diff --git a/modules/builder.py b/modules/builder.py index 0d87e8d5b..49a8158ab 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1609,7 +1609,7 @@ def _imdb(self, method_name, method_data): if res: interests.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ev\\d+ e.g. ev0000292 or be one of {', '.join([e for e in imdb.interest_options])}") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ev\\d+ e.g. in0000092 or be one of {', '.join([e for e in imdb.interest_options])}") if interests: new_dictionary[lower_method] = interests elif search_attr == "company": diff --git a/modules/imdb.py b/modules/imdb.py index af1eafd79..171af835b 100644 --- a/modules/imdb.py +++ b/modules/imdb.py @@ -108,6 +108,219 @@ "News", "Short", "Western", "Sport", "Reality-TV", "Horror", "Fantasy", "Film-Noir", "Music", "Romance", "Talk-Show", "Thriller", "War", "Sci-Fi", "Musical", "Mystery", "Game-Show" ]} +interest_options = { + "action": "in0000001", + "action_epic": "in0000002", + "b_action": "in0000003", + "car_action": "in0000004", + "disaster": "in0000005", + "martial_arts": "in0000006", + "one_person_army_action": "in0000007", + "superhero": "in0000008", + "sword_&_sandal": "in0000009", + "war": "in0000010", + "war_epic": "in0000011", + "adventure": "in0000012", + "desert_adventure": "in0000013", + "dinosaur_adventure": "in0000014", + "adventure_epic": "in0000015", + "globetrotting_adventure": "in0000016", + "jungle_adventure": "in0000017", + "mountain_adventure": "in0000018", + "quest": "in0000019", + "road_trip": "in0000020", + "sea_adventure": "in0000021", + "swashbuckler": "in0000022", + "teen_adventure": "in0000023", + "urban_adventure": "in0000024", + "adult_animation": "in0000025", + "animation": "in0000026", + "anime": "in0000027", + "computer_animation": "in0000028", + "hand_drawn_animation": "in0000029", + "stop_motion_animation": "in0000030", + "body_swap_comedy": "in0000031", + "buddy_comedy": "in0000032", + "buddy_cop": "in0000033", + "comedy": "in0000034", + "dark_comedy": "in0000035", + "farce": "in0000036", + "high_concept_comedy": "in0000037", + "mockumentary": "in0000038", + "parody": "in0000039", + "quirky_comedy": "in0000040", + "raunchy_comedy": "in0000041", + "satire": "in0000042", + "screwball_comedy": "in0000043", + "sitcom": "in0000044", + "sketch_comedy": "in0000045", + "slapstick": "in0000046", + "stand_up": "in0000047", + "stoner_comedy": "in0000048", + "teen_comedy": "in0000049", + "caper": "in0000050", + "cop_drama": "in0000051", + "crime": "in0000052", + "drug_crime": "in0000053", + "film_noir": "in0000054", + "gangster": "in0000055", + "heist": "in0000056", + "police_procedural": "in0000057", + "true_crime": "in0000058", + "crime_documentary": "in0000059", + "documentary": "in0000060", + "docuseries": "in0000061", + "faith_&_spirituality_documentary": "in0000062", + "food_documentary": "in0000063", + "history_documentary": "in0000064", + "military_documentary": "in0000065", + "music_documentary": "in0000066", + "nature_documentary": "in0000067", + "political_documentary": "in0000068", + "science_&_technology_documentary": "in0000069", + "sports_documentary": "in0000070", + "travel_documentary": "in0000071", + "biography": "in0000072", + "coming_of_age": "in0000073", + "costume_drama": "in0000074", + "docudrama": "in0000075", + "drama": "in0000076", + "epic": "in0000077", + "financial_drama": "in0000078", + "historical_epic": "in0000079", + "history": "in0000080", + "legal_drama": "in0000081", + "medical_drama": "in0000082", + "period_drama": "in0000083", + "political_drama": "in0000084", + "prison_drama": "in0000085", + "psychological_drama": "in0000086", + "showbiz_drama": "in0000087", + "soap_opera": "in0000088", + "teen_drama": "in0000089", + "tragedy": "in0000090", + "workplace_drama": "in0000091", + "animal_adventure": "in0000092", + "family": "in0000093", + "dark_fantasy": "in0000095", + "fantasy_epic": "in0000096", + "fairy_tale": "in0000097", + "fantasy": "in0000098", + "supernatural_fantasy": "in0000099", + "sword_&_sorcery": "in0000100", + "teen_fantasy": "in0000101", + "beauty_competition": "in0000102", + "cooking_competition": "in0000103", + "quiz_show": "in0000104", + "game_show": "in0000105", + "survival_competition": "in0000106", + "talent_competition": "in0000107", + "b_horror": "in0000108", + "body_horror": "in0000109", + "folk_horror": "in0000110", + "found_footage_horror": "in0000111", + "horror": "in0000112", + "monster_horror": "in0000113", + "psychological_horror": "in0000114", + "slasher_horror": "in0000115", + "splatter_horror": "in0000116", + "supernatural_horror": "in0000117", + "teen_horror": "in0000118", + "vampire_horror": "in0000119", + "werewolf_horror": "in0000120", + "witch_horror": "in0000121", + "zombie_horror": "in0000122", + "beauty_makeover": "in0000123", + "cooking_&_food": "in0000124", + "home_improvement": "in0000125", + "lifestyle": "in0000126", + "talk_show": "in0000127", + "travel": "in0000128", + "concert": "in0000129", + "music": "in0000130", + "classic_musical": "in0000131", + "jukebox_musical": "in0000132", + "musical": "in0000133", + "pop_musical": "in0000134", + "rock_musical": "in0000135", + "bumbling_detective": "in0000136", + "cozy_mystery": "in0000137", + "hard_boiled_detective": "in0000138", + "mystery": "in0000139", + "suspense_mystery": "in0000140", + "whodunnit": "in0000141", + "business_reality_tv": "in0000142", + "crime_reality_tv": "in0000143", + "dating_reality_tv": "in0000144", + "docusoap_reality_tv": "in0000145", + "hidden_camera": "in0000146", + "paranormal_reality_tv": "in0000147", + "reality_tv": "in0000148", + "dark_romance": "in0000149", + "romantic_epic": "in0000150", + "feel_good_romance": "in0000151", + "romance": "in0000152", + "romantic_comedy": "in0000153", + "steamy_romance": "in0000154", + "teen_romance": "in0000155", + "tragic_romance": "in0000156", + "alien_invasion": "in0000157", + "artificial_intelligence": "in0000158", + "cyberpunk": "in0000159", + "dystopian_sci_fi": "in0000160", + "kaiju": "in0000161", + "sci_fi": "in0000162", + "sci_fi_epic": "in0000163", + "space_sci_fi": "in0000164", + "steampunk": "in0000165", + "time_travel": "in0000166", + "baseball": "in0000167", + "basketball": "in0000168", + "boxing": "in0000169", + "extreme_sport": "in0000170", + "football": "in0000171", + "motorsport": "in0000172", + "soccer": "in0000173", + "sport": "in0000174", + "water_sport": "in0000175", + "conspiracy_thriller": "in0000176", + "cyber_thriller": "in0000177", + "erotic_thriller": "in0000178", + "giallo": "in0000179", + "legal_thriller": "in0000180", + "political_thriller": "in0000181", + "psychological_thriller": "in0000182", + "serial_killer": "in0000183", + "spy": "in0000184", + "survival": "in0000185", + "thriller": "in0000186", + "classical_western": "in0000187", + "contemporary_western": "in0000188", + "western_epic": "in0000189", + "spaghetti_western": "in0000190", + "western": "in0000191", + "holiday": "in0000192", + "holiday_animation": "in0000193", + "holiday_comedy": "in0000194", + "holiday_family": "in0000195", + "holiday_romance": "in0000196", + "gun_fu": "in0000197", + "kung_fu": "in0000198", + "samurai": "in0000199", + "wuxia": "in0000200", + "isekai": "in0000201", + "iyashikei": "in0000202", + "josei": "in0000203", + "mecha": "in0000204", + "seinen": "in0000205", + "shōnen": "in0000206", + "shōjo": "in0000207", + "slice_of_life": "in0000208", + "korean_drama": "in0000209", + "telenovela": "in0000210", + "news": "in0000211", + "short": "in0000212", +} topic_options = { "alternate_version": "ALTERNATE_VERSION", "award": "AWARD", @@ -145,221 +358,6 @@ "national_film_board_preserved": {"eventId": "ev0000468"}, "razzie": {"eventId": "ev0000558"}, } - -interest_options = { - "action": {"eventId": "in0000001"}, - "action_epic": {"eventId": "in0000002"}, - "b_action": {"eventId": "in0000003"}, - "car_action": {"eventId": "in0000004"}, - "disaster": {"eventId": "in0000005"}, - "martial_arts": {"eventId": "in0000006"}, - "one_person_army_action": {"eventId": "in0000007"}, - "superhero": {"eventId": "in0000008"}, - "sword_&_sandal": {"eventId": "in0000009"}, - "war": {"eventId": "in0000010"}, - "war_epic": {"eventId": "in0000011"}, - "adventure": {"eventId": "in0000012"}, - "desert_adventure": {"eventId": "in0000013"}, - "dinosaur_adventure": {"eventId": "in0000014"}, - "adventure_epic": {"eventId": "in0000015"}, - "globetrotting_adventure": {"eventId": "in0000016"}, - "jungle_adventure": {"eventId": "in0000017"}, - "mountain_adventure": {"eventId": "in0000018"}, - "quest": {"eventId": "in0000019"}, - "road_trip": {"eventId": "in0000020"}, - "sea_adventure": {"eventId": "in0000021"}, - "swashbuckler": {"eventId": "in0000022"}, - "teen_adventure": {"eventId": "in0000023"}, - "urban_adventure": {"eventId": "in0000024"}, - "adult_animation": {"eventId": "in0000025"}, - "animation": {"eventId": "in0000026"}, - "anime": {"eventId": "in0000027"}, - "computer_animation": {"eventId": "in0000028"}, - "hand_drawn_animation": {"eventId": "in0000029"}, - "stop_motion_animation": {"eventId": "in0000030"}, - "body_swap_comedy": {"eventId": "in0000031"}, - "buddy_comedy": {"eventId": "in0000032"}, - "buddy_cop": {"eventId": "in0000033"}, - "comedy": {"eventId": "in0000034"}, - "dark_comedy": {"eventId": "in0000035"}, - "farce": {"eventId": "in0000036"}, - "high_concept_comedy": {"eventId": "in0000037"}, - "mockumentary": {"eventId": "in0000038"}, - "parody": {"eventId": "in0000039"}, - "quirky_comedy": {"eventId": "in0000040"}, - "raunchy_comedy": {"eventId": "in0000041"}, - "satire": {"eventId": "in0000042"}, - "screwball_comedy": {"eventId": "in0000043"}, - "sitcom": {"eventId": "in0000044"}, - "sketch_comedy": {"eventId": "in0000045"}, - "slapstick": {"eventId": "in0000046"}, - "stand_up": {"eventId": "in0000047"}, - "stoner_comedy": {"eventId": "in0000048"}, - "teen_comedy": {"eventId": "in0000049"}, - "caper": {"eventId": "in0000050"}, - "cop_drama": {"eventId": "in0000051"}, - "crime": {"eventId": "in0000052"}, - "drug_crime": {"eventId": "in0000053"}, - "film_noir": {"eventId": "in0000054"}, - "gangster": {"eventId": "in0000055"}, - "heist": {"eventId": "in0000056"}, - "police_procedural": {"eventId": "in0000057"}, - "true_crime": {"eventId": "in0000058"}, - "crime_documentary": {"eventId": "in0000059"}, - "documentary": {"eventId": "in0000060"}, - "docuseries": {"eventId": "in0000061"}, - "faith_&_spirituality_documentary": {"eventId": "in0000062"}, - "food_documentary": {"eventId": "in0000063"}, - "history_documentary": {"eventId": "in0000064"}, - "military_documentary": {"eventId": "in0000065"}, - "music_documentary": {"eventId": "in0000066"}, - "nature_documentary": {"eventId": "in0000067"}, - "political_documentary": {"eventId": "in0000068"}, - "science_&_technology_documentary": {"eventId": "in0000069"}, - "sports_documentary": {"eventId": "in0000070"}, - "travel_documentary": {"eventId": "in0000071"}, - "biography": {"eventId": "in0000072"}, - "coming_of_age": {"eventId": "in0000073"}, - "costume_drama": {"eventId": "in0000074"}, - "docudrama": {"eventId": "in0000075"}, - "drama": {"eventId": "in0000076"}, - "epic": {"eventId": "in0000077"}, - "financial_drama": {"eventId": "in0000078"}, - "historical_epic": {"eventId": "in0000079"}, - "history": {"eventId": "in0000080"}, - "legal_drama": {"eventId": "in0000081"}, - "medical_drama": {"eventId": "in0000082"}, - "period_drama": {"eventId": "in0000083"}, - "political_drama": {"eventId": "in0000084"}, - "prison_drama": {"eventId": "in0000085"}, - "psychological_drama": {"eventId": "in0000086"}, - "showbiz_drama": {"eventId": "in0000087"}, - "soap_opera": {"eventId": "in0000088"}, - "teen_drama": {"eventId": "in0000089"}, - "tragedy": {"eventId": "in0000090"}, - "workplace_drama": {"eventId": "in0000091"}, - "animal_adventure": {"eventId": "in0000092"}, - "family": {"eventId": "in0000093"}, - "dark_fantasy": {"eventId": "in0000095"}, - "fantasy_epic": {"eventId": "in0000096"}, - "fairy_tale": {"eventId": "in0000097"}, - "fantasy": {"eventId": "in0000098"}, - "supernatural_fantasy": {"eventId": "in0000099"}, - "sword_&_sorcery": {"eventId": "in0000100"}, - "teen_fantasy": {"eventId": "in0000101"}, - "beauty_competition": {"eventId": "in0000102"}, - "cooking_competition": {"eventId": "in0000103"}, - "quiz_show": {"eventId": "in0000104"}, - "game_show": {"eventId": "in0000105"}, - "survival_competition": {"eventId": "in0000106"}, - "talent_competition": {"eventId": "in0000107"}, - "b_horror": {"eventId": "in0000108"}, - "body_horror": {"eventId": "in0000109"}, - "folk_horror": {"eventId": "in0000110"}, - "found_footage_horror": {"eventId": "in0000111"}, - "horror": {"eventId": "in0000112"}, - "monster_horror": {"eventId": "in0000113"}, - "psychological_horror": {"eventId": "in0000114"}, - "slasher_horror": {"eventId": "in0000115"}, - "splatter_horror": {"eventId": "in0000116"}, - "supernatural_horror": {"eventId": "in0000117"}, - "teen_horror": {"eventId": "in0000118"}, - "vampire_horror": {"eventId": "in0000119"}, - "werewolf_horror": {"eventId": "in0000120"}, - "witch_horror": {"eventId": "in0000121"}, - "zombie_horror": {"eventId": "in0000122"}, - "beauty_makeover": {"eventId": "in0000123"}, - "cooking_&_food": {"eventId": "in0000124"}, - "home_improvement": {"eventId": "in0000125"}, - "lifestyle": {"eventId": "in0000126"}, - "talk_show": {"eventId": "in0000127"}, - "travel": {"eventId": "in0000128"}, - "concert": {"eventId": "in0000129"}, - "music": {"eventId": "in0000130"}, - "classic_musical": {"eventId": "in0000131"}, - "jukebox_musical": {"eventId": "in0000132"}, - "musical": {"eventId": "in0000133"}, - "pop_musical": {"eventId": "in0000134"}, - "rock_musical": {"eventId": "in0000135"}, - "bumbling_detective": {"eventId": "in0000136"}, - "cozy_mystery": {"eventId": "in0000137"}, - "hard_boiled_detective": {"eventId": "in0000138"}, - "mystery": {"eventId": "in0000139"}, - "suspense_mystery": {"eventId": "in0000140"}, - "whodunnit": {"eventId": "in0000141"}, - "business_reality_tv": {"eventId": "in0000142"}, - "crime_reality_tv": {"eventId": "in0000143"}, - "dating_reality_tv": {"eventId": "in0000144"}, - "docusoap_reality_tv": {"eventId": "in0000145"}, - "hidden_camera": {"eventId": "in0000146"}, - "paranormal_reality_tv": {"eventId": "in0000147"}, - "reality_tv": {"eventId": "in0000148"}, - "dark_romance": {"eventId": "in0000149"}, - "romantic_epic": {"eventId": "in0000150"}, - "feel_good_romance": {"eventId": "in0000151"}, - "romance": {"eventId": "in0000152"}, - "romantic_comedy": {"eventId": "in0000153"}, - "steamy_romance": {"eventId": "in0000154"}, - "teen_romance": {"eventId": "in0000155"}, - "tragic_romance": {"eventId": "in0000156"}, - "alien_invasion": {"eventId": "in0000157"}, - "artificial_intelligence": {"eventId": "in0000158"}, - "cyberpunk": {"eventId": "in0000159"}, - "dystopian_sci_fi": {"eventId": "in0000160"}, - "kaiju": {"eventId": "in0000161"}, - "sci_fi": {"eventId": "in0000162"}, - "sci_fi_epic": {"eventId": "in0000163"}, - "space_sci_fi": {"eventId": "in0000164"}, - "steampunk": {"eventId": "in0000165"}, - "time_travel": {"eventId": "in0000166"}, - "baseball": {"eventId": "in0000167"}, - "basketball": {"eventId": "in0000168"}, - "boxing": {"eventId": "in0000169"}, - "extreme_sport": {"eventId": "in0000170"}, - "football": {"eventId": "in0000171"}, - "motorsport": {"eventId": "in0000172"}, - "soccer": {"eventId": "in0000173"}, - "sport": {"eventId": "in0000174"}, - "water_sport": {"eventId": "in0000175"}, - "conspiracy_thriller": {"eventId": "in0000176"}, - "cyber_thriller": {"eventId": "in0000177"}, - "erotic_thriller": {"eventId": "in0000178"}, - "giallo": {"eventId": "in0000179"}, - "legal_thriller": {"eventId": "in0000180"}, - "political_thriller": {"eventId": "in0000181"}, - "psychological_thriller": {"eventId": "in0000182"}, - "serial_killer": {"eventId": "in0000183"}, - "spy": {"eventId": "in0000184"}, - "survival": {"eventId": "in0000185"}, - "thriller": {"eventId": "in0000186"}, - "classical_western": {"eventId": "in0000187"}, - "contemporary_western": {"eventId": "in0000188"}, - "western_epic": {"eventId": "in0000189"}, - "spaghetti_western": {"eventId": "in0000190"}, - "western": {"eventId": "in0000191"}, - "holiday": {"eventId": "in0000192"}, - "holiday_animation": {"eventId": "in0000193"}, - "holiday_comedy": {"eventId": "in0000194"}, - "holiday_family": {"eventId": "in0000195"}, - "holiday_romance": {"eventId": "in0000196"}, - "gun_fu": {"eventId": "in0000197"}, - "kung_fu": {"eventId": "in0000198"}, - "samurai": {"eventId": "in0000199"}, - "wuxia": {"eventId": "in0000200"}, - "isekai": {"eventId": "in0000201"}, - "iyashikei": {"eventId": "in0000202"}, - "josei": {"eventId": "in0000203"}, - "mecha": {"eventId": "in0000204"}, - "seinen": {"eventId": "in0000205"}, - "shōnen": {"eventId": "in0000206"}, - "shōjo": {"eventId": "in0000207"}, - "slice_of_life": {"eventId": "in0000208"}, - "korean_drama": {"eventId": "in0000209"}, - "telenovela": {"eventId": "in0000210"}, - "news": {"eventId": "in0000211"}, - "short": {"eventId": "in0000212"}, -} - base_url = "https://www.imdb.com" git_base = "https://raw.githubusercontent.com/Kometa-Team/IMDb-Awards/master" search_hash_url = "https://raw.githubusercontent.com/Kometa-Team/IMDb-Hash/master/HASH" @@ -542,7 +540,7 @@ def check_constraint(bases, mods, constraint, lower="", translation=None, range_ elif isinstance(translation, tuple): out[constraint][f"{imdb_mod}{lower}"] = [d.replace(translation[0], translation[1]) for d in data[full_attr]] elif isinstance(translation, dict): - out[constraint][f"{imdb_mod}{lower}"] = [translation[d] for d in data[full_attr]] + out[constraint][f"{imdb_mod}{lower}"] = [translation[d] if d in translation else d for d in data[full_attr]] if range_data: out[constraint][range_name[i]] = range_data @@ -559,6 +557,7 @@ def check_constraint(bases, mods, constraint, lower="", translation=None, range_ check_constraint("title", [("", "searchTerm")], "titleTextConstraint") check_constraint(["rating", "votes"], [("gte", "min"), ("lte", "max")], "userRatingsConstraint", range_name=["aggregateRatingRange", "ratingsCountRange"]) check_constraint("genre", [("", "all"), ("any", "any"), ("not", "exclude")], "genreConstraint", lower="GenreIds", translation=genre_options) + check_constraint("interests", [("", "all"), ("any", "any"), ("not", "exclude")], "interestConstraint", lower="InterestIds", translation=interest_options) check_constraint("topic", [("", "all"), ("any", "any"), ("not", "no")], "withTitleDataConstraint", lower="DataAvailable", translation=topic_options) check_constraint("alternate_version", [("", "all"), ("any", "any")], "alternateVersionMatchingConstraint", lower="AlternateVersionTextTerms") check_constraint("crazy_credit", [("", "all"), ("any", "any")], "crazyCreditMatchingConstraint", lower="CrazyCreditTextTerms")