Replaced get_imdb_movie_data with get_imdb_title for better naming consistency and added get_imdb_title_data to streamline IMDb metadata processing. Updated related code to accommodate these changes and ensure proper functionality of IMDb interactions.

This commit is contained in:
mhdzumair
2024-12-14 21:33:53 +05:30
parent 43e2c0ccac
commit ff4be3865e
5 changed files with 60 additions and 21 deletions
@@ -51,7 +51,7 @@ class SportVideoParserPipeline:
"created_at": date_obj.strftime("%Y-%m-%d"),
"year": date_obj.year,
"languages": [re.sub(r"[ .]", "", item["language"])],
"is_imdb": False,
"is_search_imdb_title": False,
"resolution": resolution,
}
)
@@ -46,7 +46,7 @@ class BaseParserPipeline:
item.update(
dict(
type="movie",
is_imdb=False,
is_search_imdb_title=False,
genres=[self.event_name.upper()],
is_add_title_to_poster=True,
)
@@ -212,10 +212,10 @@ class UFCParserPipeline(BaseParserPipeline):
def __init__(self):
super().__init__("ufc")
def update_imdb_data(self, torrent_data: dict):
async def update_imdb_data(self, torrent_data: dict):
year = torrent_data.get("date").year
title = torrent_data.get("event")
tmdb_data = search_tmdb(title, year)
tmdb_data = await search_tmdb(title, year)
if not tmdb_data:
if not torrent_data["poster"]:
torrent_data["poster"] = random.choice(