ports/www/py-pafy/files/patch-pafy_backend__youtube__dl.py
Joseph Mingrone 80e4e8275e
Ports that depend on youtube-dl: Depend on yt-dlp
yt-dlp [1] is a youtube-dl fork with additional features and fixes.  For
ports that depend on www/youtube-dl switch the dependency to www/yt-dlp.
For ports that have an optional dependency on www/youtube-dl, create a
new OPTIONS_RADIO that includes www/yt-dlp and make it the default.

[1] https://github.com/yt-dlp/yt-dlp

Other changes:
- www/yt-dlp: Turn the symlink option on by default
- www/py-pafy: Fix build when depending on www/yt-dlp

PR:		259944
Reported by:	Oleh Vinichenko <moonlapse81@gmail.com>
Reviewed by:	diizzy, Oleh Vinichenko <moonlapse81@gmail.com>,
		VVD <vvd@unislabs.com>
Approved by:	0mp, adridg (kde@), rm, tcberner (multimedia@),
		yuri (maintainers)
		acm and nivit (maintainers, timeout)
Differential Revision:	https://reviews.freebsd.org/D33090
2021-12-06 10:09:50 -04:00

14 lines
465 B
Python

--- pafy/backend_youtube_dl.py.orig 2019-11-20 14:42:31 UTC
+++ pafy/backend_youtube_dl.py
@@ -10,7 +10,10 @@ if sys.version_info[:2] >= (3, 0):
else:
uni = unicode
-import youtube_dl
+if sys.platform.startswith('freebsd'):
+ # FreeBSD installs youtube_dl as a zip archive
+ sys.path.insert(1, '%%LOCALBASE%%/bin/youtube-dl')
+import yt_dlp
from . import g
from .backend_shared import BasePafy, BaseStream, remux, get_status_string, get_size_done