Skip to content

Commit

Permalink
record: Download missing segments after automatic resume
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDrHax committed May 25, 2021
1 parent f552430 commit 8875399
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions twitch_utils/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ def create_timeline(vod_id, parts):


def record(vod_id: str, stream: Stream, vod: Stream, parts: int = 0) -> int:
resumed = parts > 0
stream_result = -1
missing_part = None

while stream_result != 0:
if parts == 0:
print('Starting download of live stream')
else:
resumed = parts > 0

if resumed:
print('Resuming download of live stream')
else:
print('Starting download of live stream')

stream_proc = stream.download_async(generate_filename(vod_id, parts))
parts += 1
Expand Down

0 comments on commit 8875399

Please sign in to comment.