From 0a5556c45b266ea221f9c8d5a738b3da9eba1a3d Mon Sep 17 00:00:00 2001 From: nubsuki Date: Thu, 20 Feb 2025 14:45:23 +0530 Subject: [PATCH] Updated --- ytvd.py | 5 +++++ ytvd.spec | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ytvd.spec diff --git a/ytvd.py b/ytvd.py index 90850b0..26b8e8a 100644 --- a/ytvd.py +++ b/ytvd.py @@ -6,6 +6,9 @@ import webbrowser import threading +# Detect platform and set FFmpeg path +ffmpeg_path = os.path.join(os.path.dirname(__file__), "ffmpeg", "bin") + def fetch_qualities(): """Fetch available video qualities for the given URL.""" video_url = url_entry.get() @@ -65,6 +68,7 @@ def download_video(): return ydl_opts = { + 'ffmpeg_location': ffmpeg_path, 'format': f'bestvideo[height={video_quality.replace("p", "")}][vcodec^=avc1]+bestaudio[acodec^=mp4a]/best', 'outtmpl': os.path.join(output_folder, '%(title)s.%(ext)s'), 'merge_output_format': 'mp4', @@ -121,6 +125,7 @@ def download_mp3(): # Configure ydl_opts for MP3 download ydl_opts = { + 'ffmpeg_location': ffmpeg_path, 'format': 'bestaudio/best', # Download the best available audio 'outtmpl': os.path.join(output_folder, '%(title)s.%(ext)s'), # Output file template 'postprocessors': [{ diff --git a/ytvd.spec b/ytvd.spec new file mode 100644 index 0000000..2059a3b --- /dev/null +++ b/ytvd.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['ytvd.py'], + pathex=[], + binaries=[], + datas=[('ffmpeg', 'ffmpeg'), ('icon.png', '.'), ('icon.ico', '.')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='ytvd', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +)