New port: www/youtube_dlc

This is an active fork of youtube-dl with references to copyright material removed [1].

[1] dd2d55f10d (diff-fdb1ee8d93ba2ba9f31ec19f7332f7d1a676a795f8dc0396f7f5f19b45ec3a96)

PR:		250608
Submitted by:	daniel.engberg.lists@pyret.net
This commit is contained in:
Tobias C. Berner 2020-10-26 08:32:42 +00:00
parent 89f5b23f8c
commit 2ce5a7e7a4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=553325
10 changed files with 218 additions and 0 deletions

View File

@ -2330,6 +2330,7 @@
SUBDIR += you-get
SUBDIR += yourls
SUBDIR += youtube_dl
SUBDIR += youtube_dlc
SUBDIR += ytdl
SUBDIR += yuicompressor
SUBDIR += zend-framework

41
www/youtube_dlc/Makefile Normal file
View File

@ -0,0 +1,41 @@
# $FreeBSD$
PORTNAME= youtube_dlc
DISTVERSION= 2020.10.24-6
CATEGORIES= www
# Implicit approval to commit trivial version updates.
MAINTAINER= multimedia@FreeBSD.org
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
MANPAGES_BUILD_DEPENDS= pandoc:textproc/hs-pandoc
RTMPDUMP_RUN_DEPENDS= rtmpdump:multimedia/rtmpdump
SYMLINK_CONFLICTS= youtube_dl
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 <bsd.port.mk>

3
www/youtube_dlc/distinfo Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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')

View File

@ -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/

View File

@ -0,0 +1,8 @@
[
{ type: install
message: <<EOM
If you want to use mp3 audio conversion please make sure multimedia/ffmpeg is
built with the "LAME" option enabled.
EOM
}
]

View File

@ -0,0 +1,6 @@
%%SYMLINK%%bin/youtube-dl
bin/youtube-dlc
etc/bash_completion.d/youtube-dlc.sh
%%MANPAGES%%man/man1/youtube-dlc.1.gz
share/fish/vendor_completions.d/youtube-dlc.fish
share/zsh/site-functions/_youtube-dlc