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