Skip to content

Commit

Permalink
Update stream.py
Browse files Browse the repository at this point in the history
  • Loading branch information
g0ldyy authored Nov 21, 2024
1 parent 1ea68b7 commit f6fb223
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions comet/api/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ async def stream(request: Request, b64config: str, type: str, id: str):
season = int(info[1])
episode = int(info[2])

year = None
year_end = None
try:
kitsu = False
if id == "kitsu":
Expand All @@ -86,8 +88,6 @@ async def stream(request: Request, b64config: str, type: str, id: str):
metadata = await get_metadata.json()
name = metadata["data"]["attributes"]["canonicalTitle"]
season = 1
year = None
year_end = None
else:
get_metadata = await session.get(
f"https://v3.sg.media-imdb.com/suggestion/a/{id}.json"
Expand All @@ -107,7 +107,6 @@ async def stream(request: Request, b64config: str, type: str, id: str):
name = element["l"]
year = element.get("y")

year_end = None
if "yr" in element:
year_end = int(element["yr"].split("-")[1])
except Exception as e:
Expand Down

0 comments on commit f6fb223

Please sign in to comment.