Skip to content

Commit b95070c

Browse files
authored
Update series.py
1 parent a256f83 commit b95070c

File tree

1 file changed

+5
-4
lines changed
  • StreamingCommunity/Api/Service/discoveryeu

1 file changed

+5
-4
lines changed

StreamingCommunity/Api/Service/discoveryeu/series.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
7171
console.print(f"[red]Unsupported streaming type. Playbackk info: {playback_info}")
7272
return None, False
7373

74-
#Check the type of stream
74+
# Check the type of stream
75+
status = None
7576
if playback_info['type'] == 'dash':
76-
77-
# Generate license headers
7877
license_headers = generate_license_headers(playback_info['license_token'])
7978

8079
# Download the episode
@@ -91,17 +90,19 @@ def download_video(index_season_selected: int, index_episode_selected: int, scra
9190

9291
# Get final status
9392
status = dash_process.get_status()
93+
9494
elif playback_info['type'] == 'hls':
95+
9596
api = DiscoveryEUAPI()
9697
headers = api.get_request_headers()
98+
9799
# Download the episode
98100
status = HLS_Downloader(
99101
m3u8_url=playback_info['mpd_url'], #mpd_url is just a typo: it is a hls
100102
headers=headers,
101103
output_path=os.path.join(mp4_path, mp4_name),
102104
).start()
103105

104-
105106
if status['error'] is not None and status['path']:
106107
try:
107108
os.remove(status['path'])

0 commit comments

Comments
 (0)