qytdl: force using yt_dlp

Fix #43814
This commit is contained in:
Đoàn Trần Công Danh 2023-05-10 08:51:03 +07:00
parent 2dee97687b
commit 2e9e4d4d6d
2 changed files with 68 additions and 2 deletions

View File

@ -0,0 +1,67 @@
--- a/src/config.py
+++ b/src/config.py
@@ -11,7 +11,7 @@ def default_opts():
"profile" : "auto",
"fallback" : ["auto"],
"duplicates" : "false",
- "module" : "youtube_dl",
+ "module" : "yt_dlp",
"playlistFolder" : "true",
"theme" : "default",
}
@@ -64,7 +64,7 @@ def write_config( opts ):
"download_path" : opts.get( "downloadPath", userPath ),
"\n# Which system installation (module) used to download": None,
"# (youtube_dl, yt_dlp, etc.)" : None,
- "module" : opts.get( "module", "youtube_dl" ),
+ "module" : "yt_dlp",
"\n# Allow duplicate URLs into queue (true/false)" : None,
"allow_duplicates" : opts.get( "duplicates", "false" ),
"\n# Each playlist gets its own subdirectory (true/false)" : None,
@@ -125,7 +125,7 @@ def read_options( opts ):
## Default section
section = cfg[ "DEFAULT" ]
opts[ "downloadPath" ] = section.get( "download_path", userPath )
- opts[ "module" ] = section.get( "module", "youtube_dl" )
+ opts[ "module" ] = "yt_dlp"
opts[ "duplicates" ] = section.get( "allow_duplicates", "false" )
opts[ "playlistFolder" ] = section.get( "playlist_folder", "true" )
--- a/src/main_widget.py
+++ b/src/main_widget.py
@@ -330,9 +330,9 @@ class MainWidget( QWidget ):
print( "Module:\t%s" % opts[ "module" ] )
except ImportError:
- ydl_module = youtube_dl
+ ydl_module = yt_dlp
if self.debug:
- print( "Module:\tyoutube_dl")
+ print( "Module:\tyt_dlp")
ydl_opts = self.ydl_opts( profile )
@@ -539,9 +539,9 @@ class MainWidget( QWidget ):
## Just grab this here for convenience's sake
if not self.debug:
- ydl = youtube_dl.YoutubeDL( { "quiet" : True } )
+ ydl = yt_dlp.YoutubeDL( { "quiet" : True } )
else:
- ydl = youtube_dl.YoutubeDL()
+ ydl = yt_dlp.YoutubeDL()
for url in urls:
--- a/src/util.py
+++ b/src/util.py
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
import sys, os
-import youtube_dl
-from youtube_dl.utils import DownloadError
+import yt_dlp
+from yt_dlp.utils import DownloadError
#### RE-ENABLE if you want to enable possible internal YDL
#import internal_ydl

View File

@ -1,8 +1,7 @@
# Template file for 'qytdl' # Template file for 'qytdl'
pkgname=qytdl pkgname=qytdl
version=1.6 version=1.6
revision=1 revision=2
build_style=gnu-makefile
pycompile_dirs="usr/share/qytdl/src" pycompile_dirs="usr/share/qytdl/src"
depends="desktop-file-utils python3-PyQt5 yt-dlp" depends="desktop-file-utils python3-PyQt5 yt-dlp"
short_desc="Simple Qt (PyQt5) frontend to Youtube-DL" short_desc="Simple Qt (PyQt5) frontend to Youtube-DL"