Use readlines() over readline() to avoid while
This commit is contained in:
parent
fedd88ce4c
commit
8b4e7a7410
@ -47,9 +47,8 @@ def get_static_download_size(url : str) -> int:
|
||||
lines = reversed(process.stdout.readlines())
|
||||
|
||||
for line in lines:
|
||||
line = line.decode().lower()
|
||||
if 'content-length:' in line:
|
||||
_, content_length = line.split('content-length:')
|
||||
if 'content-length:' in line.decode().lower():
|
||||
_, content_length = line.decode().lower().split('content-length:')
|
||||
return int(content_length)
|
||||
|
||||
return 0
|
||||
|
@ -25,9 +25,8 @@ def run_ffmpeg_with_progress(args: List[str], update_progress : UpdateProgress)
|
||||
lines = process.stdout.readlines()
|
||||
|
||||
for line in lines:
|
||||
line = line.decode().lower()
|
||||
if 'frame=' in line:
|
||||
_, frame_number = line.split('frame=')
|
||||
if 'frame=' in line.decode().lower():
|
||||
_, frame_number = line.decode().lower().split('frame=')
|
||||
update_progress(int(frame_number))
|
||||
|
||||
if log_level == 'debug':
|
||||
|
Loading…
Reference in New Issue
Block a user