ports/www/py-pafy/files/patch-pafy_pafy.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
483 B
Python

--- pafy/pafy.py.orig 2019-11-20 14:42:31 UTC
+++ pafy/pafy.py
@@ -45,7 +45,10 @@ Pafy = None
backend = "internal"
if os.environ.get("PAFY_BACKEND") != "internal":
try:
- 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
backend = "youtube-dl"
except ImportError:
raise ImportError(