Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
nubsuki committed Feb 20, 2025
1 parent bdc8193 commit 0a5556c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ytvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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': [{
Expand Down
38 changes: 38 additions & 0 deletions ytvd.spec
Original file line number Diff line number Diff line change
@@ -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,
)

0 comments on commit 0a5556c

Please sign in to comment.