Skip to content

Commit

Permalink
Fix ffmpeg not found on some Windows machine (#4)
Browse files Browse the repository at this point in the history
Improve progress display, fixing some blank characters being shown on Windows 10 systems
Bump yt-dlp to 2024.3.10
Bump FFMPEG to N-114087-gac61231757-20240310
  • Loading branch information
aliencaocao committed Mar 11, 2024
1 parent 471198b commit 71f1a5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version: 2023.11.16.1
Version: 2024.3.10
CompanyName: Billy Cao
FileDescription: YT-DLP GUI
InternalName: YT-DLP GUI
Expand Down
9 changes: 5 additions & 4 deletions yt-dlp-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def get_res_path(relative_path: str) -> str:
'no-audio-multistreams': True,
# 'check_formats': True,
'fixup': 'detect_or_warn',
'extractor_args': {'youtube': {'skip': ['dash', 'hls']}},
'extractor_args': {'youtube': {'skip': ['dash', 'hls']},},
'ffmpeg_location': get_res_path('ffmpeg.exe') if sys.platform == 'win32' else 'ffmpeg',
}
percent_str_regex = re.compile(r'\d{1,3}\.\d{1,2}%')

Expand Down Expand Up @@ -236,11 +237,11 @@ def start_task(self):

def progress_hook(self, d: dict):
global ongoing_task
if d['status'] == 'downloading':
if d['status'] == 'downloading' and '_default_template' in d:
percent_str = percent_str_regex.search(d['_percent_str'])
if percent_str:
percent_str = percent_str.group()
self.status.set(f'Downloading: {percent_str} at {d["_speed_str"]} ETA {d["_eta_str"]}')
self.status.set(f'Downloading: {d["_default_template"]}')
self.progress.set(int(float(percent_str.rstrip('%'))))
elif d['status'] == 'finished': # may have postprocessing later but can start downloading next task already since postprocessing no need internet and is usually fast
if self in download_queue: download_queue.remove(self)
Expand All @@ -256,7 +257,7 @@ def progress_hook(self, d: dict):
def postprocessor_hook(self, d: dict):
global ongoing_task
if d['status'] == 'started' or d['status'] == 'processing':
self.status.set('Processing')
self.status.set('Post-processing')
else:
if self in download_queue: download_queue.remove(self)
self.status.set('Finished')
Expand Down

0 comments on commit 71f1a5e

Please sign in to comment.