From abbc1d2cb8cd4bbda90b919b5d6f89a499bf1f03 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Sun, 25 Oct 2020 08:18:02 +0100 Subject: [PATCH] youtube-dlc youtube-dlc Signed-off-by: Daniel Engberg --- www/youtube_dlc/Makefile | 41 ++++++++++ www/youtube_dlc/distinfo | 3 + www/youtube_dlc/files/extrapatch-manpages | 34 ++++++++ www/youtube_dlc/files/patch-Makefile | 78 +++++++++++++++++++ .../files/patch-youtube__dlc_____init____.py | 29 +++++++ .../files/patch-youtube__dlc_options.py | 13 ++++ www/youtube_dlc/pkg-descr | 5 ++ www/youtube_dlc/pkg-message | 8 ++ www/youtube_dlc/pkg-plist | 6 ++ 9 files changed, 217 insertions(+) create mode 100644 www/youtube_dlc/Makefile create mode 100644 www/youtube_dlc/distinfo create mode 100644 www/youtube_dlc/files/extrapatch-manpages create mode 100644 www/youtube_dlc/files/patch-Makefile create mode 100644 www/youtube_dlc/files/patch-youtube__dlc_____init____.py create mode 100644 www/youtube_dlc/files/patch-youtube__dlc_options.py create mode 100644 www/youtube_dlc/pkg-descr create mode 100644 www/youtube_dlc/pkg-message create mode 100644 www/youtube_dlc/pkg-plist diff --git a/www/youtube_dlc/Makefile b/www/youtube_dlc/Makefile new file mode 100644 index 000000000000..06ffe2c615f3 --- /dev/null +++ b/www/youtube_dlc/Makefile @@ -0,0 +1,41 @@ +# $FreeBSD$ + +PORTNAME= youtube_dlc +DISTVERSION= 2020.10.24-6 +CATEGORIES= www + +# Implicit approval to commit trivial version updates. +MAINTAINER= daniel.engberg.lists@pyret.net +COMMENT= Program for downloading videos from various streaming services + +LICENSE= UNLICENSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= gmake python shebangfix +SHEBANG_GLOB= devscripts/*.py +USE_GITHUB= yes +GH_ACCOUNT= blackjack4494 +GH_PROJECT= yt-dlc + +MAKE_ARGS= PYTHON=${PYTHON_CMD} +NO_ARCH= yes + +OPTIONS_DEFINE= FFMPEG MANPAGES RTMPDUMP SYMLINK +OPTIONS_DEFAULT= RTMPDUMP +OPTIONS_SUB= yes + +RTMPDUMP_DESC= Use rtmpdump to download rtmp video streams +SYMLINK_DESC= Install youtube-dl symbolic link for executable + +FFMPEG_RUN_DEPENDS= ffprobe:multimedia/ffmpeg +RTMPDUMP_RUN_DEPENDS= rtmpdump:multimedia/rtmpdump + +MANPAGES_BUILD_DEPENDS= pandoc:textproc/hs-pandoc + +post-patch-MANPAGES-on: + @${PATCH} -d ${WRKSRC} -p0 < ${PATCHDIR}/extrapatch-manpages + +post-install-SYMLINK-on: + @${RLN} ${STAGEDIR}${PREFIX}/bin/youtube-dlc ${STAGEDIR}${PREFIX}/bin/youtube-dl + +.include diff --git a/www/youtube_dlc/distinfo b/www/youtube_dlc/distinfo new file mode 100644 index 000000000000..61d7706f894a --- /dev/null +++ b/www/youtube_dlc/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1603544255 +SHA256 (blackjack4494-yt-dlc-2020.10.24-6_GH0.tar.gz) = 252cc51baca7ceba21d0f5673a6ba72b058c8b6acf78c22db6509bac9760bae5 +SIZE (blackjack4494-yt-dlc-2020.10.24-6_GH0.tar.gz) = 1492059 diff --git a/www/youtube_dlc/files/extrapatch-manpages b/www/youtube_dlc/files/extrapatch-manpages new file mode 100644 index 000000000000..fba1aa53a43e --- /dev/null +++ b/www/youtube_dlc/files/extrapatch-manpages @@ -0,0 +1,34 @@ +--- Makefile.orig 2020-10-25 01:01:48 UTC ++++ Makefile +@@ -1,4 +1,4 @@ +-all: youtube-dlc youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites ++all: youtube-dlc youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites + + clean: + rm -rf youtube-dlc.1.temp.md youtube-dlc.1 youtube-dlc.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dlc.tar.gz youtube-dlc.zsh youtube-dlc.fish youtube_dlc/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dlc youtube-dlc.exe +@@ -20,8 +20,8 @@ MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d + install: youtube-dlc youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish + install -d $(DESTDIR)$(BINDIR) + install -m 755 youtube-dlc $(DESTDIR)$(BINDIR) +-# install -d $(DESTDIR)$(MANDIR)/man1 +-# install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 ++ install -d $(DESTDIR)$(MANDIR)/man1 ++ install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 + install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d + install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc.sh + install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions +@@ -91,10 +91,10 @@ supportedsites: + #README.txt: README.md + # pandoc -f $(MARKDOWN) -t plain README.md -o README.txt + +-#youtube-dlc.1: README.md +-# $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md +-# pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 +-# rm -f youtube-dlc.1.temp.md ++youtube-dlc.1: README.md ++ $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md ++ pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 ++ rm -f youtube-dlc.1.temp.md + + youtube-dlc.bash-completion: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/bash-completion.in + $(PYTHON) devscripts/bash-completion.py diff --git a/www/youtube_dlc/files/patch-Makefile b/www/youtube_dlc/files/patch-Makefile new file mode 100644 index 000000000000..f4444e775774 --- /dev/null +++ b/www/youtube_dlc/files/patch-Makefile @@ -0,0 +1,78 @@ +--- Makefile.orig 2020-10-24 05:32:48 UTC ++++ Makefile +@@ -1,4 +1,4 @@ +-all: youtube-dlc README.md CONTRIBUTING.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites ++all: youtube-dlc youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites + + clean: + rm -rf youtube-dlc.1.temp.md youtube-dlc.1 youtube-dlc.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dlc.tar.gz youtube-dlc.zsh youtube-dlc.fish youtube_dlc/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dlc youtube-dlc.exe +@@ -12,22 +12,22 @@ SHAREDIR ?= $(PREFIX)/share + PYTHON ?= /usr/bin/env python + + # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local +-SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi) ++SYSCONFDIR ?= $(PREFIX)/etc + + # set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 + MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi) + +-install: youtube-dlc youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish ++install: youtube-dlc youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish + install -d $(DESTDIR)$(BINDIR) + install -m 755 youtube-dlc $(DESTDIR)$(BINDIR) +- install -d $(DESTDIR)$(MANDIR)/man1 +- install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 ++# install -d $(DESTDIR)$(MANDIR)/man1 ++# install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 + install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d +- install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc ++ install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc.sh + install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions + install -m 644 youtube-dlc.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dlc +- install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions +- install -m 644 youtube-dlc.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dlc.fish ++ install -d $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d ++ install -m 644 youtube-dlc.fish $(DESTDIR)$(SHAREDIR)/fish/vendor_completions.d/youtube-dlc.fish + + codetest: + flake8 . +@@ -65,7 +65,7 @@ youtube-dlc: youtube_dlc/*.py youtube_dlc/*/*.py + done + touch -t 200001010101 zip/youtube_dlc/*.py zip/youtube_dlc/*/*.py + mv zip/youtube_dlc/__main__.py zip/ +- cd zip ; zip -q ../youtube-dlc youtube_dlc/*.py youtube_dlc/*/*.py __main__.py ++ cd zip ; bsdtar -a -cf ../youtube-dlc.zip youtube_dlc/*.py youtube_dlc/*/*.py __main__.py + rm -rf zip + echo '#!$(PYTHON)' > youtube-dlc + cat youtube-dlc.zip >> youtube-dlc +@@ -75,8 +75,8 @@ youtube-dlc: youtube_dlc/*.py youtube_dlc/*/*.py + README.md: youtube_dlc/*.py youtube_dlc/*/*.py + COLUMNS=80 $(PYTHON) youtube_dlc/__main__.py --help | $(PYTHON) devscripts/make_readme.py + +-CONTRIBUTING.md: README.md +- $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md ++#CONTRIBUTING.md: README.md ++# $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md + + issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md youtube_dlc/version.py + $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE/1_broken_site.md +@@ -88,13 +88,13 @@ issuetemplates: devscripts/make_issue_template.py .git + supportedsites: + $(PYTHON) devscripts/make_supportedsites.py docs/supportedsites.md + +-README.txt: README.md +- pandoc -f $(MARKDOWN) -t plain README.md -o README.txt ++#README.txt: README.md ++# pandoc -f $(MARKDOWN) -t plain README.md -o README.txt + +-youtube-dlc.1: README.md +- $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md +- pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 +- rm -f youtube-dlc.1.temp.md ++#youtube-dlc.1: README.md ++# $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md ++# pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 ++# rm -f youtube-dlc.1.temp.md + + youtube-dlc.bash-completion: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/bash-completion.in + $(PYTHON) devscripts/bash-completion.py diff --git a/www/youtube_dlc/files/patch-youtube__dlc_____init____.py b/www/youtube_dlc/files/patch-youtube__dlc_____init____.py new file mode 100644 index 000000000000..ef98307aec80 --- /dev/null +++ b/www/youtube_dlc/files/patch-youtube__dlc_____init____.py @@ -0,0 +1,29 @@ +--- youtube_dlc/__init__.py.orig 2020-10-24 05:32:48 UTC ++++ youtube_dlc/__init__.py +@@ -36,7 +36,6 @@ from .utils import ( + write_string, + render_table, + ) +-from .update import update_self + from .downloader import ( + FileDownloader, + ) +@@ -452,17 +451,13 @@ def _real_main(argv=None): + } + + with YoutubeDL(ydl_opts) as ydl: +- # Update version +- if opts.update_self: +- update_self(ydl.to_screen, opts.verbose, ydl._opener) +- + # Remove cache dir + if opts.rm_cachedir: + ydl.cache.remove() + + # Maybe do nothing + if (len(all_urls) < 1) and (opts.load_info_filename is None): +- if opts.update_self or opts.rm_cachedir: ++ if opts.rm_cachedir: + sys.exit() + + ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) diff --git a/www/youtube_dlc/files/patch-youtube__dlc_options.py b/www/youtube_dlc/files/patch-youtube__dlc_options.py new file mode 100644 index 000000000000..66a5d3d63ca8 --- /dev/null +++ b/www/youtube_dlc/files/patch-youtube__dlc_options.py @@ -0,0 +1,13 @@ +--- youtube_dlc/options.py.orig 2020-10-24 05:32:48 UTC ++++ youtube_dlc/options.py +@@ -138,10 +138,6 @@ def parseOpts(overrideArguments=None): + 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. Make sure that you have sufficient permissions (run with sudo if needed)') +- general.add_option( + '-i', '--ignore-errors', + action='store_true', dest='ignoreerrors', default=False, + help='Continue on download errors, for example to skip unavailable videos in a playlist') diff --git a/www/youtube_dlc/pkg-descr b/www/youtube_dlc/pkg-descr new file mode 100644 index 000000000000..761697c4dd36 --- /dev/null +++ b/www/youtube_dlc/pkg-descr @@ -0,0 +1,5 @@ +youtube-dlc is an active fork of youtube-dl with several enhancements. +It is a command-line program for downloading videos from YouTube.com and +other video streaming services. + +WWW: https://github.com/blackjack4494/yt-dlc/ diff --git a/www/youtube_dlc/pkg-message b/www/youtube_dlc/pkg-message new file mode 100644 index 000000000000..898139919852 --- /dev/null +++ b/www/youtube_dlc/pkg-message @@ -0,0 +1,8 @@ +[ +{ type: install + message: <