-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug_episode.py
31 lines (27 loc) · 1.16 KB
/
debug_episode.py
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
from cli_battery.app.direct_api import DirectAPI
import logging
logging.basicConfig(level=logging.DEBUG)
show_imdb = "tt5594440" # People Magazine Investigates
season = 8
episode = 10
# Try to get episode metadata directly
print("\nTrying to get show metadata to find episode IMDb ID:")
show_metadata, source = DirectAPI.get_show_metadata(show_imdb)
if show_metadata:
print(f"Source: {source}")
print(f"Show metadata: {show_metadata}")
# Look for season 8 episode 10
seasons = show_metadata.get('seasons', {})
if str(season) in seasons:
season_data = seasons[str(season)]
print(f"\nSeason {season} data:")
for ep in season_data.get('episodes', {}).values():
if ep.get('episode_number') == episode:
print(f"Found episode {episode}:")
print(ep)
if 'imdb_id' in ep:
print(f"\nTrying to get episode metadata for {ep['imdb_id']}:")
episode_metadata, source = DirectAPI.get_episode_metadata(ep['imdb_id'])
print(f"Source: {source}")
print(f"Episode metadata: {episode_metadata}")
break