diff --git a/www/yt-dlp/Makefile b/www/yt-dlp/Makefile index 39c1d711bfd1..8200cfe7b481 100644 --- a/www/yt-dlp/Makefile +++ b/www/yt-dlp/Makefile @@ -1,44 +1,45 @@ PORTNAME= yt-dlp DISTVERSION= 2022.06.22.1 +PORTREVISION= 1 CATEGORIES= www MAINTAINER= yuri@FreeBSD.org COMMENT= Command-line program for downloading videos from various platforms LICENSE= UNLICENSE LICENSE_FILE= ${WRKSRC}/LICENSE PY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}brotli>0:archivers/py-brotli@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}certifi>0:security/py-certifi@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}mutagen>0:audio/py-mutagen@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pycryptodomex>0:security/py-pycryptodomex@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}websockets>0:devel/py-websockets@${PY_FLAVOR} BUILD_DEPENDS= ${PY_DEPENDS} RUN_DEPENDS= ${PY_DEPENDS} USES= gmake python:3.7+ shebangfix USE_GITHUB= yes SHEBANG_GLOB= devscripts/*.py MAKE_ARGS= PYTHON=${PYTHON_CMD} NO_ARCH= yes OPTIONS_DEFINE= FFMPEG RTMPDUMP SYMLINK OPTIONS_DEFAULT= FFMPEG RTMPDUMP SYMLINK OPTIONS_SUB= yes FFMPEG_RUN_DEPENDS= ffprobe:multimedia/ffmpeg RTMPDUMP_DESC= Use rtmpdump to download rtmp video streams RTMPDUMP_RUN_DEPENDS= rtmpdump:multimedia/rtmpdump SYMLINK_DESC= Install youtube-dl symbolic link for executable SYMLINK_CONFLICTS= youtube_dl post-install-SYMLINK-on: @${RLN} ${STAGEDIR}${PREFIX}/bin/yt-dlp ${STAGEDIR}${PREFIX}/bin/youtube-dl .include diff --git a/www/yt-dlp/files/patch-yt__dlp_____init____.py b/www/yt-dlp/files/patch-yt__dlp_____init____.py deleted file mode 100644 index 3e4437de00c6..000000000000 --- a/www/yt-dlp/files/patch-yt__dlp_____init____.py +++ /dev/null @@ -1,32 +0,0 @@ ---- yt_dlp/__init__.py.orig 2022-06-22 00:50:42 UTC -+++ yt_dlp/__init__.py -@@ -879,20 +879,20 @@ def _real_main(argv=None): - return - - with YoutubeDL(ydl_opts) as ydl: -- pre_process = opts.update_self or opts.rm_cachedir -+ pre_process = opts.rm_cachedir - actual_use = all_urls or opts.load_info_filename - - if opts.rm_cachedir: - ydl.cache.remove() - -- updater = Updater(ydl) -- if opts.update_self and updater.update() and actual_use: -- if updater.cmd: -- return updater.restart() -- # This code is reachable only for zip variant in py < 3.10 -- # It makes sense to exit here, but the old behavior is to continue -- ydl.report_warning('Restart yt-dlp to use the updated version') -- # return 100, 'ERROR: The program must exit for the update to complete' -+ #updater = Updater(ydl) -+ #if opts.update_self and updater.update() and actual_use: -+ # if updater.cmd: -+ # return updater.restart() -+ # # This code is reachable only for zip variant in py < 3.10 -+ # # It makes sense to exit here, but the old behavior is to continue -+ # ydl.report_warning('Restart yt-dlp to use the updated version') -+ # # return 100, 'ERROR: The program must exit for the update to complete' - - if not actual_use: - if pre_process: diff --git a/www/yt-dlp/files/patch-yt__dlp_options.py b/www/yt-dlp/files/patch-yt__dlp_options.py deleted file mode 100644 index 7f7fdfb82562..000000000000 --- a/www/yt-dlp/files/patch-yt__dlp_options.py +++ /dev/null @@ -1,13 +0,0 @@ ---- yt_dlp/options.py.orig 2022-06-22 01:17:57 UTC -+++ yt_dlp/options.py -@@ -313,10 +313,6 @@ def create_parser(): - action='version', - help='Print program version and exit') - general.add_option( -- '-U', '--update', -- action='store_true', dest='update_self', -- help='Update this program to latest version') -- general.add_option( - '--no-update', - action='store_false', dest='update_self', - help='Do not update (default)') diff --git a/www/yt-dlp/files/patch-yt__dlp_update.py b/www/yt-dlp/files/patch-yt__dlp_update.py new file mode 100644 index 000000000000..605de73d672c --- /dev/null +++ b/www/yt-dlp/files/patch-yt__dlp_update.py @@ -0,0 +1,13 @@ +- this patch prevents -U from updating yt-dlp - it makes it "unrecognized" + +--- yt_dlp/update.py.orig 2022-06-22 01:54:04 UTC ++++ yt_dlp/update.py +@@ -29,7 +29,7 @@ def _get_variant_and_executable_path(): + + path = os.path.dirname(__file__) + if isinstance(__loader__, zipimporter): +- return 'zip', os.path.join(path, '..') ++ return 'unknown', os.path.join(path, '..') + elif (os.path.basename(sys.argv[0]) in ('__main__.py', '-m') + and os.path.exists(os.path.join(path, '../.git/HEAD'))): + return 'source', path