[skip travis] renaming

to avoid using same folder when using pip install for example
pull/2/head
Unknown 4 years ago
parent 9688f23716
commit cefecac12c

@ -2,8 +2,8 @@ include README.md
include LICENSE include LICENSE
include AUTHORS include AUTHORS
include ChangeLog include ChangeLog
include youtube-dl.bash-completion include youtube-dlc.bash-completion
include youtube-dl.fish include youtube-dlc.fish
include youtube-dl.1 include youtube-dlc.1
recursive-include docs Makefile conf.py *.rst recursive-include docs Makefile conf.py *.rst
recursive-include test * recursive-include test *

@ -1,7 +1,7 @@
all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites all: youtube-dlc README.md CONTRIBUTING.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites
clean: clean:
rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish youtube_dl/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-dl youtube-dl.exe 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
find . -name "*.pyc" -delete find . -name "*.pyc" -delete
find . -name "*.class" -delete find . -name "*.class" -delete
@ -17,23 +17,23 @@ SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then ech
# set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 # 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) MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi)
install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish install: youtube-dlc youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish
install -d $(DESTDIR)$(BINDIR) install -d $(DESTDIR)$(BINDIR)
install -m 755 youtube-dl $(DESTDIR)$(BINDIR) install -m 755 youtube-dlc $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(MANDIR)/man1 install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1 install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1
install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc
install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions
install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl install -m 644 youtube-dlc.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dlc
install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions
install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish install -m 644 youtube-dlc.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dlc.fish
codetest: codetest:
flake8 . flake8 .
test: test:
#nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test #nosetests --with-coverage --cover-package=youtube_dlc --cover-html --verbose --processes 4 test
nosetests --verbose test nosetests --verbose test
$(MAKE) codetest $(MAKE) codetest
@ -51,34 +51,34 @@ offlinetest: codetest
--exclude test_youtube_lists.py \ --exclude test_youtube_lists.py \
--exclude test_youtube_signature.py --exclude test_youtube_signature.py
tar: youtube-dl.tar.gz tar: youtube-dlc.tar.gz
.PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites
pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish pypi-files: youtube-dlc.bash-completion README.txt youtube-dlc.1 youtube-dlc.fish
youtube-dl: youtube_dl/*.py youtube_dl/*/*.py youtube-dlc: youtube_dlc/*.py youtube_dlc/*/*.py
mkdir -p zip mkdir -p zip
for d in youtube_dl youtube_dl/downloader youtube_dl/extractor youtube_dl/postprocessor ; do \ for d in youtube_dlc youtube_dlc/downloader youtube_dlc/extractor youtube_dlc/postprocessor ; do \
mkdir -p zip/$$d ;\ mkdir -p zip/$$d ;\
cp -pPR $$d/*.py zip/$$d/ ;\ cp -pPR $$d/*.py zip/$$d/ ;\
done done
touch -t 200001010101 zip/youtube_dl/*.py zip/youtube_dl/*/*.py touch -t 200001010101 zip/youtube_dlc/*.py zip/youtube_dlc/*/*.py
mv zip/youtube_dl/__main__.py zip/ mv zip/youtube_dlc/__main__.py zip/
cd zip ; zip -q ../youtube-dl youtube_dl/*.py youtube_dl/*/*.py __main__.py cd zip ; zip -q ../youtube-dlc youtube_dlc/*.py youtube_dlc/*/*.py __main__.py
rm -rf zip rm -rf zip
echo '#!$(PYTHON)' > youtube-dl echo '#!$(PYTHON)' > youtube-dlc
cat youtube-dl.zip >> youtube-dl cat youtube-dlc.zip >> youtube-dlc
rm youtube-dl.zip rm youtube-dlc.zip
chmod a+x youtube-dl chmod a+x youtube-dlc
README.md: youtube_dl/*.py youtube_dl/*/*.py README.md: youtube_dlc/*.py youtube_dlc/*/*.py
COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py COLUMNS=80 $(PYTHON) youtube_dlc/__main__.py --help | $(PYTHON) devscripts/make_readme.py
CONTRIBUTING.md: README.md CONTRIBUTING.md: README.md
$(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.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_dl/version.py 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 $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE/1_broken_site.md
$(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE/2_site_support_request.md $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE/2_site_support_request.md
$(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md
@ -91,34 +91,34 @@ supportedsites:
README.txt: README.md README.txt: README.md
pandoc -f $(MARKDOWN) -t plain README.md -o README.txt pandoc -f $(MARKDOWN) -t plain README.md -o README.txt
youtube-dl.1: README.md youtube-dlc.1: README.md
$(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md
pandoc -s -f $(MARKDOWN) -t man youtube-dl.1.temp.md -o youtube-dl.1 pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1
rm -f youtube-dl.1.temp.md rm -f youtube-dlc.1.temp.md
youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in youtube-dlc.bash-completion: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/bash-completion.in
$(PYTHON) devscripts/bash-completion.py $(PYTHON) devscripts/bash-completion.py
bash-completion: youtube-dl.bash-completion bash-completion: youtube-dlc.bash-completion
youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in youtube-dlc.zsh: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/zsh-completion.in
$(PYTHON) devscripts/zsh-completion.py $(PYTHON) devscripts/zsh-completion.py
zsh-completion: youtube-dl.zsh zsh-completion: youtube-dlc.zsh
youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in youtube-dlc.fish: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/fish-completion.in
$(PYTHON) devscripts/fish-completion.py $(PYTHON) devscripts/fish-completion.py
fish-completion: youtube-dl.fish fish-completion: youtube-dlc.fish
lazy-extractors: youtube_dl/extractor/lazy_extractors.py lazy-extractors: youtube_dlc/extractor/lazy_extractors.py
_EXTRACTOR_FILES = $(shell find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') _EXTRACTOR_FILES = $(shell find youtube_dlc/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py')
youtube_dl/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) youtube_dlc/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES)
$(PYTHON) devscripts/make_lazy_extractors.py $@ $(PYTHON) devscripts/make_lazy_extractors.py $@
youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish ChangeLog AUTHORS youtube-dlc.tar.gz: youtube-dlc README.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish ChangeLog AUTHORS
@tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \ @tar -czf youtube-dlc.tar.gz --transform "s|^|youtube-dlc/|" --owner 0 --group 0 \
--exclude '*.DS_Store' \ --exclude '*.DS_Store' \
--exclude '*.kate-swp' \ --exclude '*.kate-swp' \
--exclude '*.pyc' \ --exclude '*.pyc' \
@ -128,8 +128,8 @@ youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-
--exclude '.git' \ --exclude '.git' \
--exclude 'docs/_build' \ --exclude 'docs/_build' \
-- \ -- \
bin devscripts test youtube_dl docs \ bin devscripts test youtube_dlc docs \
ChangeLog AUTHORS LICENSE README.md README.txt \ ChangeLog AUTHORS LICENSE README.md README.txt \
Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \ Makefile MANIFEST.in youtube-dlc.1 youtube-dlc.bash-completion \
youtube-dl.zsh youtube-dl.fish setup.py setup.cfg \ youtube-dlc.zsh youtube-dlc.fish setup.py setup.cfg \
youtube-dl youtube-dlc

@ -34,7 +34,7 @@ Using curl:
To build the Windows executable yourself To build the Windows executable yourself
python -m pip install --upgrade pyinstaller python -m pip install --upgrade pyinstaller
pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc pyinstaller.exe youtube_dlc\__main__.py --onefile --name youtube-dlc
Or simply execute the `make_win.bat` if pyinstaller is installed. Or simply execute the `make_win.bat` if pyinstaller is installed.
There will be a `youtube-dlc.exe` in `/dist` There will be a `youtube-dlc.exe` in `/dist`
@ -71,18 +71,18 @@ Then simply type this
extractor extractor
--default-search PREFIX Use this prefix for unqualified URLs. For --default-search PREFIX Use this prefix for unqualified URLs. For
example "gvsearch2:" downloads two videos example "gvsearch2:" downloads two videos
from google videos for youtube-dl "large from google videos for youtube-dlc "large
apple". Use the value "auto" to let apple". Use the value "auto" to let
youtube-dl guess ("auto_warning" to emit a youtube-dlc guess ("auto_warning" to emit a
warning when guessing). "error" just throws warning when guessing). "error" just throws
an error. The default value "fixup_error" an error. The default value "fixup_error"
repairs broken URLs, but emits an error if repairs broken URLs, but emits an error if
this is not possible instead of searching. this is not possible instead of searching.
--ignore-config Do not read configuration files. When given --ignore-config Do not read configuration files. When given
in the global configuration file in the global configuration file
/etc/youtube-dl.conf: Do not read the user /etc/youtube-dlc.conf: Do not read the user
configuration in ~/.config/youtube- configuration in ~/.config/youtube-
dl/config (%APPDATA%/youtube-dl/config.txt dl/config (%APPDATA%/youtube-dlc/config.txt
on Windows) on Windows)
--config-location PATH Location of the configuration file; either --config-location PATH Location of the configuration file; either
the path to the config or its containing the path to the config or its containing
@ -240,7 +240,7 @@ Then simply type this
filenames filenames
-w, --no-overwrites Do not overwrite files -w, --no-overwrites Do not overwrite files
-c, --continue Force resume of partially downloaded files. -c, --continue Force resume of partially downloaded files.
By default, youtube-dl will resume By default, youtube-dlc will resume
downloads if possible. downloads if possible.
--no-continue Do not resume partially downloaded files --no-continue Do not resume partially downloaded files
(restart from beginning) (restart from beginning)
@ -258,11 +258,11 @@ Then simply type this
option) option)
--cookies FILE File to read cookies from and dump cookie --cookies FILE File to read cookies from and dump cookie
jar in jar in
--cache-dir DIR Location in the filesystem where youtube-dl --cache-dir DIR Location in the filesystem where youtube-dlc
can store some downloaded information can store some downloaded information
permanently. By default permanently. By default
$XDG_CACHE_HOME/youtube-dl or $XDG_CACHE_HOME/youtube-dlc or
~/.cache/youtube-dl . At the moment, only ~/.cache/youtube-dlc . At the moment, only
YouTube player files (for videos with YouTube player files (for videos with
obfuscated signatures) are cached, but that obfuscated signatures) are cached, but that
may change. may change.
@ -308,8 +308,8 @@ Then simply type this
files in the current directory to debug files in the current directory to debug
problems problems
--print-traffic Display sent and read HTTP traffic --print-traffic Display sent and read HTTP traffic
-C, --call-home Contact the youtube-dl server for debugging -C, --call-home Contact the youtube-dlc server for debugging
--no-call-home Do NOT contact the youtube-dl server for --no-call-home Do NOT contact the youtube-dlc server for
debugging debugging
## Workarounds: ## Workarounds:
@ -370,7 +370,7 @@ Then simply type this
## Authentication Options: ## Authentication Options:
-u, --username USERNAME Login with this account ID -u, --username USERNAME Login with this account ID
-p, --password PASSWORD Account password. If this option is left -p, --password PASSWORD Account password. If this option is left
out, youtube-dl will ask interactively. out, youtube-dlc will ask interactively.
-2, --twofactor TWOFACTOR Two-factor authentication code -2, --twofactor TWOFACTOR Two-factor authentication code
-n, --netrc Use .netrc authentication data -n, --netrc Use .netrc authentication data
--video-password PASSWORD Video password (vimeo, smotri, youku) --video-password PASSWORD Video password (vimeo, smotri, youku)
@ -381,7 +381,7 @@ Then simply type this
a list of available MSOs a list of available MSOs
--ap-username USERNAME Multiple-system operator account login --ap-username USERNAME Multiple-system operator account login
--ap-password PASSWORD Multiple-system operator account password. --ap-password PASSWORD Multiple-system operator account password.
If this option is left out, youtube-dl will If this option is left out, youtube-dlc will
ask interactively. ask interactively.
--ap-list-mso List all supported multiple-system --ap-list-mso List all supported multiple-system
operators operators
@ -444,6 +444,6 @@ Then simply type this
# COPYRIGHT # COPYRIGHT
youtube-dl is released into the public domain by the copyright holders. youtube-dlc is released into the public domain by the copyright holders.
This README file was originally written by [Daniel Bolton](https://github.com/dbbolton) and is likewise released into the public domain. This README file was originally written by [Daniel Bolton](https://github.com/dbbolton) and is likewise released into the public domain.

@ -1,4 +1,4 @@
__youtube_dl() __youtube_dlc()
{ {
local cur prev opts fileopts diropts keywords local cur prev opts fileopts diropts keywords
COMPREPLY=() COMPREPLY=()
@ -26,4 +26,4 @@ __youtube_dl()
fi fi
} }
complete -F __youtube_dl youtube-dl complete -F __youtube_dlc youtube-dlc

@ -6,9 +6,9 @@ from os.path import dirname as dirn
import sys import sys
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
import youtube_dl import youtube_dlc
BASH_COMPLETION_FILE = "youtube-dl.bash-completion" BASH_COMPLETION_FILE = "youtube-dlc.bash-completion"
BASH_COMPLETION_TEMPLATE = "devscripts/bash-completion.in" BASH_COMPLETION_TEMPLATE = "devscripts/bash-completion.in"
@ -26,5 +26,5 @@ def build_completion(opt_parser):
f.write(filled_template) f.write(filled_template)
parser = youtube_dl.parseOpts()[0] parser = youtube_dlc.parseOpts()[0]
build_completion(parser) build_completion(parser)

@ -12,7 +12,7 @@ import traceback
import os.path import os.path
sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__))))) sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__)))))
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_input, compat_input,
compat_http_server, compat_http_server,
compat_str, compat_str,
@ -325,7 +325,7 @@ class YoutubeDLBuilder(object):
authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org'] authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org']
def __init__(self, **kwargs): def __init__(self, **kwargs):
if self.repoName != 'youtube-dl': if self.repoName != 'youtube-dlc':
raise BuildError('Invalid repository "%s"' % self.repoName) raise BuildError('Invalid repository "%s"' % self.repoName)
if self.user not in self.authorizedUsers: if self.user not in self.authorizedUsers:
raise HTTPError('Unauthorized user "%s"' % self.user, 401) raise HTTPError('Unauthorized user "%s"' % self.user, 401)

@ -15,8 +15,8 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse from youtube_dlc.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request from youtube_dlc.utils import compat_urllib_request
if len(sys.argv) > 1: if len(sys.argv) > 1:
METHOD = 'LIST' METHOD = 'LIST'

@ -12,13 +12,13 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_basestring, compat_basestring,
compat_getpass, compat_getpass,
compat_print, compat_print,
compat_urllib_request, compat_urllib_request,
) )
from youtube_dl.utils import ( from youtube_dlc.utils import (
make_HTTPS_handler, make_HTTPS_handler,
sanitized_Request, sanitized_Request,
) )
@ -98,7 +98,7 @@ def main():
releaser = GitHubReleaser() releaser = GitHubReleaser()
new_release = releaser.create_release( new_release = releaser.create_release(
version, name='youtube-dl %s' % version, body=body) version, name='youtube-dlc %s' % version, body=body)
release_id = new_release['id'] release_id = new_release['id']
for asset in os.listdir(build_path): for asset in os.listdir(build_path):

@ -2,4 +2,4 @@
{{commands}} {{commands}}
complete --command youtube-dl --arguments ":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory" complete --command youtube-dlc --arguments ":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory"

@ -7,10 +7,10 @@ from os.path import dirname as dirn
import sys import sys
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
import youtube_dl import youtube_dlc
from youtube_dl.utils import shell_quote from youtube_dlc.utils import shell_quote
FISH_COMPLETION_FILE = 'youtube-dl.fish' FISH_COMPLETION_FILE = 'youtube-dlc.fish'
FISH_COMPLETION_TEMPLATE = 'devscripts/fish-completion.in' FISH_COMPLETION_TEMPLATE = 'devscripts/fish-completion.in'
EXTRA_ARGS = { EXTRA_ARGS = {
@ -30,7 +30,7 @@ def build_completion(opt_parser):
for group in opt_parser.option_groups: for group in opt_parser.option_groups:
for option in group.option_list: for option in group.option_list:
long_option = option.get_opt_string().strip('-') long_option = option.get_opt_string().strip('-')
complete_cmd = ['complete', '--command', 'youtube-dl', '--long-option', long_option] complete_cmd = ['complete', '--command', 'youtube-dlc', '--long-option', long_option]
if option._short_opts: if option._short_opts:
complete_cmd += ['--short-option', option._short_opts[0].strip('-')] complete_cmd += ['--short-option', option._short_opts[0].strip('-')]
if option.help != optparse.SUPPRESS_HELP: if option.help != optparse.SUPPRESS_HELP:
@ -45,5 +45,5 @@ def build_completion(opt_parser):
f.write(filled_template) f.write(filled_template)
parser = youtube_dl.parseOpts()[0] parser = youtube_dlc.parseOpts()[0]
build_completion(parser) build_completion(parser)

@ -7,8 +7,8 @@ import os
import sys import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import intlist_to_bytes from youtube_dlc.utils import intlist_to_bytes
from youtube_dl.aes import aes_encrypt, key_expansion from youtube_dlc.aes import aes_encrypt, key_expansion
secret_msg = b'Secret message goes here' secret_msg = b'Secret message goes here'

@ -22,9 +22,9 @@ if 'signature' in versions_info:
new_version = {} new_version = {}
filenames = { filenames = {
'bin': 'youtube-dl', 'bin': 'youtube-dlc',
'exe': 'youtube-dl.exe', 'exe': 'youtube-dlc.exe',
'tar': 'youtube-dl-%s.tar.gz' % version} 'tar': 'youtube-dlc-%s.tar.gz' % version}
build_dir = os.path.join('..', '..', 'build', version) build_dir = os.path.join('..', '..', 'build', version)
for key, filename in filenames.items(): for key, filename in filenames.items():
url = 'https://yt-dl.org/downloads/%s/%s' % (version, filename) url = 'https://yt-dl.org/downloads/%s/%s' % (version, filename)

@ -11,24 +11,24 @@ atom_template = textwrap.dedent("""\
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<link rel="self" href="http://ytdl-org.github.io/youtube-dl/update/releases.atom" /> <link rel="self" href="http://ytdl-org.github.io/youtube-dl/update/releases.atom" />
<title>youtube-dl releases</title> <title>youtube-dlc releases</title>
<id>https://yt-dl.org/feed/youtube-dl-updates-feed</id> <id>https://yt-dl.org/feed/youtube-dlc-updates-feed</id>
<updated>@TIMESTAMP@</updated> <updated>@TIMESTAMP@</updated>
@ENTRIES@ @ENTRIES@
</feed>""") </feed>""")
entry_template = textwrap.dedent(""" entry_template = textwrap.dedent("""
<entry> <entry>
<id>https://yt-dl.org/feed/youtube-dl-updates-feed/youtube-dl-@VERSION@</id> <id>https://yt-dl.org/feed/youtube-dlc-updates-feed/youtube-dlc-@VERSION@</id>
<title>New version @VERSION@</title> <title>New version @VERSION@</title>
<link href="http://ytdl-org.github.io/youtube-dl" /> <link href="http://ytdl-org.github.io/youtube-dlc" />
<content type="xhtml"> <content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml"> <div xmlns="http://www.w3.org/1999/xhtml">
Downloads available at <a href="https://yt-dl.org/downloads/@VERSION@/">https://yt-dl.org/downloads/@VERSION@/</a> Downloads available at <a href="https://yt-dl.org/downloads/@VERSION@/">https://yt-dl.org/downloads/@VERSION@/</a>
</div> </div>
</content> </content>
<author> <author>
<name>The youtube-dl maintainers</name> <name>The youtube-dlc maintainers</name>
</author> </author>
<updated>@TIMESTAMP@</updated> <updated>@TIMESTAMP@</updated>
</entry> </entry>

@ -5,10 +5,10 @@ import sys
import os import os
import textwrap import textwrap
# We must be able to import youtube_dl # We must be able to import youtube_dlc
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import youtube_dl import youtube_dlc
def main(): def main():
@ -16,7 +16,7 @@ def main():
template = tmplf.read() template = tmplf.read()
ie_htmls = [] ie_htmls = []
for ie in youtube_dl.list_extractors(age_limit=None): for ie in youtube_dlc.list_extractors(age_limit=None):
ie_html = '<b>{}</b>'.format(ie.IE_NAME) ie_html = '<b>{}</b>'.format(ie.IE_NAME)
ie_desc = getattr(ie, 'IE_DESC', None) ie_desc = getattr(ie, 'IE_DESC', None)
if ie_desc is False: if ie_desc is False:

@ -20,7 +20,7 @@ def main():
bug_text = re.search( bug_text = re.search(
r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1) r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
dev_text = re.search( dev_text = re.search(
r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL', r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING youtube-dlc',
readme).group(1) readme).group(1)
out = bug_text + dev_text out = bug_text + dev_text

@ -16,9 +16,9 @@ def main():
with io.open(infile, encoding='utf-8') as inf: with io.open(infile, encoding='utf-8') as inf:
issue_template_tmpl = inf.read() issue_template_tmpl = inf.read()
# Get the version from youtube_dl/version.py without importing the package # Get the version from youtube_dlc/version.py without importing the package
exec(compile(open('youtube_dl/version.py').read(), exec(compile(open('youtube_dlc/version.py').read(),
'youtube_dl/version.py', 'exec')) 'youtube_dlc/version.py', 'exec'))
out = issue_template_tmpl % {'version': locals()['__version__']} out = issue_template_tmpl % {'version': locals()['__version__']}

@ -14,8 +14,8 @@ lazy_extractors_filename = sys.argv[1]
if os.path.exists(lazy_extractors_filename): if os.path.exists(lazy_extractors_filename):
os.remove(lazy_extractors_filename) os.remove(lazy_extractors_filename)
from youtube_dl.extractor import _ALL_CLASSES from youtube_dlc.extractor import _ALL_CLASSES
from youtube_dl.extractor.common import InfoExtractor, SearchInfoExtractor from youtube_dlc.extractor.common import InfoExtractor, SearchInfoExtractor
with open('devscripts/lazy_load_template.py', 'rt') as f: with open('devscripts/lazy_load_template.py', 'rt') as f:
module_template = f.read() module_template = f.read()

@ -7,10 +7,10 @@ import os
import sys import sys
# Import youtube_dl # Import youtube_dlc
ROOT_DIR = os.path.join(os.path.dirname(__file__), '..') ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
sys.path.insert(0, ROOT_DIR) sys.path.insert(0, ROOT_DIR)
import youtube_dl import youtube_dlc
def main(): def main():
@ -33,7 +33,7 @@ def main():
ie_md += ' (Currently broken)' ie_md += ' (Currently broken)'
yield ie_md yield ie_md
ies = sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower()) ies = sorted(youtube_dlc.gen_extractors(), key=lambda i: i.IE_NAME.lower())
out = '# Supported sites\n' + ''.join( out = '# Supported sites\n' + ''.join(
' - ' + md + '\n' ' - ' + md + '\n'
for md in gen_ies_md(ies)) for md in gen_ies_md(ies))

@ -8,7 +8,7 @@ import re
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
README_FILE = os.path.join(ROOT_DIR, 'README.md') README_FILE = os.path.join(ROOT_DIR, 'README.md')
PREFIX = r'''%YOUTUBE-DL(1) PREFIX = r'''%youtube-dlc(1)
# NAME # NAME
@ -16,7 +16,7 @@ youtube\-dl \- download videos from youtube.com or other video platforms
# SYNOPSIS # SYNOPSIS
**youtube-dl** \[OPTIONS\] URL [URL...] **youtube-dlc** \[OPTIONS\] URL [URL...]
''' '''
@ -33,7 +33,7 @@ def main():
readme = f.read() readme = f.read()
readme = re.sub(r'(?s)^.*?(?=# DESCRIPTION)', '', readme) readme = re.sub(r'(?s)^.*?(?=# DESCRIPTION)', '', readme)
readme = re.sub(r'\s+youtube-dl \[OPTIONS\] URL \[URL\.\.\.\]', '', readme) readme = re.sub(r'\s+youtube-dlc \[OPTIONS\] URL \[URL\.\.\.\]', '', readme)
readme = PREFIX + readme readme = PREFIX + readme
readme = filter_options(readme) readme = filter_options(readme)

@ -53,8 +53,8 @@ fi
if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi
if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi
useless_files=$(find youtube_dl -type f -not -name '*.py') useless_files=$(find youtube_dlc -type f -not -name '*.py')
if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dl: $useless_files"; exit 1; fi if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dlc: $useless_files"; exit 1; fi
if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
if ! type pandoc >/dev/null 2>/dev/null; then echo 'ERROR: pandoc is missing'; exit 1; fi if ! type pandoc >/dev/null 2>/dev/null; then echo 'ERROR: pandoc is missing'; exit 1; fi
if ! python3 -c 'import rsa' 2>/dev/null; then echo 'ERROR: python3-rsa is missing'; exit 1; fi if ! python3 -c 'import rsa' 2>/dev/null; then echo 'ERROR: python3-rsa is missing'; exit 1; fi
@ -68,18 +68,18 @@ make clean
if $skip_tests ; then if $skip_tests ; then
echo 'SKIPPING TESTS' echo 'SKIPPING TESTS'
else else
nosetests --verbose --with-coverage --cover-package=youtube_dl --cover-html test --stop || exit 1 nosetests --verbose --with-coverage --cover-package=youtube_dlc --cover-html test --stop || exit 1
fi fi
/bin/echo -e "\n### Changing version in version.py..." /bin/echo -e "\n### Changing version in version.py..."
sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dlc/version.py
/bin/echo -e "\n### Changing version in ChangeLog..." /bin/echo -e "\n### Changing version in ChangeLog..."
sed -i "s/<unreleased>/$version/" ChangeLog sed -i "s/<unreleased>/$version/" ChangeLog
/bin/echo -e "\n### Committing documentation, templates and youtube_dl/version.py..." /bin/echo -e "\n### Committing documentation, templates and youtube_dlc/version.py..."
make README.md CONTRIBUTING.md issuetemplates supportedsites make README.md CONTRIBUTING.md issuetemplates supportedsites
git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md .github/ISSUE_TEMPLATE/6_question.md docs/supportedsites.md youtube_dl/version.py ChangeLog git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md .github/ISSUE_TEMPLATE/6_question.md docs/supportedsites.md youtube_dlc/version.py ChangeLog
git commit $gpg_sign_commits -m "release $version" git commit $gpg_sign_commits -m "release $version"
/bin/echo -e "\n### Now tagging, signing and pushing..." /bin/echo -e "\n### Now tagging, signing and pushing..."
@ -94,13 +94,13 @@ git push origin "$version"
/bin/echo -e "\n### OK, now it is time to build the binaries..." /bin/echo -e "\n### OK, now it is time to build the binaries..."
REV=$(git rev-parse HEAD) REV=$(git rev-parse HEAD)
make youtube-dl youtube-dl.tar.gz make youtube-dlc youtube-dlc.tar.gz
read -p "VM running? (y/n) " -n 1 read -p "VM running? (y/n) " -n 1
wget "http://$buildserver/build/ytdl-org/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe wget "http://$buildserver/build/ytdl-org/youtube-dl/youtube-dlc.exe?rev=$REV" -O youtube-dlc.exe
mkdir -p "build/$version" mkdir -p "build/$version"
mv youtube-dl youtube-dl.exe "build/$version" mv youtube-dlc youtube-dlc.exe "build/$version"
mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz" mv youtube-dlc.tar.gz "build/$version/youtube-dlc-$version.tar.gz"
RELEASE_FILES="youtube-dl youtube-dl.exe youtube-dl-$version.tar.gz" RELEASE_FILES="youtube-dlc youtube-dlc.exe youtube-dlc-$version.tar.gz"
(cd build/$version/ && md5sum $RELEASE_FILES > MD5SUMS) (cd build/$version/ && md5sum $RELEASE_FILES > MD5SUMS)
(cd build/$version/ && sha1sum $RELEASE_FILES > SHA1SUMS) (cd build/$version/ && sha1sum $RELEASE_FILES > SHA1SUMS)
(cd build/$version/ && sha256sum $RELEASE_FILES > SHA2-256SUMS) (cd build/$version/ && sha256sum $RELEASE_FILES > SHA2-256SUMS)

@ -9,11 +9,11 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_print, compat_print,
compat_urllib_request, compat_urllib_request,
) )
from youtube_dl.utils import format_bytes from youtube_dlc.utils import format_bytes
def format_size(bytes): def format_size(bytes):
@ -36,9 +36,9 @@ for page in itertools.count(1):
asset_name = asset['name'] asset_name = asset['name']
total_bytes += asset['download_count'] * asset['size'] total_bytes += asset['download_count'] * asset['size']
if all(not re.match(p, asset_name) for p in ( if all(not re.match(p, asset_name) for p in (
r'^youtube-dl$', r'^youtube-dlc$',
r'^youtube-dl-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$', r'^youtube-dlc-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$',
r'^youtube-dl\.exe$')): r'^youtube-dlc\.exe$')):
continue continue
compat_print( compat_print(
' %s size: %s downloads: %d' ' %s size: %s downloads: %d'

@ -1,6 +1,6 @@
#compdef youtube-dl #compdef youtube-dlc
__youtube_dl() { __youtube_dlc() {
local curcontext="$curcontext" fileopts diropts cur prev local curcontext="$curcontext" fileopts diropts cur prev
typeset -A opt_args typeset -A opt_args
fileopts="{{fileopts}}" fileopts="{{fileopts}}"
@ -25,4 +25,4 @@ __youtube_dl() {
esac esac
} }
__youtube_dl __youtube_dlc

@ -6,9 +6,9 @@ from os.path import dirname as dirn
import sys import sys
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
import youtube_dl import youtube_dlc
ZSH_COMPLETION_FILE = "youtube-dl.zsh" ZSH_COMPLETION_FILE = "youtube-dlc.zsh"
ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in" ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in"
@ -45,5 +45,5 @@ def build_completion(opt_parser):
f.write(template) f.write(template)
parser = youtube_dl.parseOpts()[0] parser = youtube_dlc.parseOpts()[0]
build_completion(parser) build_completion(parser)

@ -85,17 +85,17 @@ qthelp:
@echo @echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:" ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/youtube-dl.qhcp" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/youtube-dlc.qhcp"
@echo "To view the help file:" @echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/youtube-dl.qhc" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/youtube-dlc.qhc"
devhelp: devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo @echo
@echo "Build finished." @echo "Build finished."
@echo "To view the help file:" @echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/youtube-dl" @echo "# mkdir -p $$HOME/.local/share/devhelp/youtube-dlc"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/youtube-dl" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/youtube-dlc"
@echo "# devhelp" @echo "# devhelp"
epub: epub:

@ -1,6 +1,6 @@
# coding: utf-8 # coding: utf-8
# #
# youtube-dl documentation build configuration file, created by # youtube-dlc documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 14 21:05:43 2014. # sphinx-quickstart on Fri Mar 14 21:05:43 2014.
# #
# This file is execfile()d with the current directory set to its # This file is execfile()d with the current directory set to its
@ -14,7 +14,7 @@
import sys import sys
import os import os
# Allows to import youtube_dl # Allows to import youtube_dlc
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
@ -36,7 +36,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'youtube-dl' project = u'youtube-dlc'
copyright = u'2014, Ricardo Garcia Gonzalez' copyright = u'2014, Ricardo Garcia Gonzalez'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
@ -44,7 +44,7 @@ copyright = u'2014, Ricardo Garcia Gonzalez'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
from youtube_dl.version import __version__ from youtube_dlc.version import __version__
version = __version__ version = __version__
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version
@ -68,4 +68,4 @@ html_theme = 'default'
html_static_path = ['_static'] html_static_path = ['_static']
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'youtube-dldoc' htmlhelp_basename = 'youtube-dlcdoc'

@ -1,13 +1,13 @@
Welcome to youtube-dl's documentation! Welcome to youtube-dlc's documentation!
====================================== ======================================
*youtube-dl* is a command-line program to download videos from YouTube.com and more sites. *youtube-dlc* is a command-line program to download videos from YouTube.com and more sites.
It can also be used in Python code. It can also be used in Python code.
Developer guide Developer guide
--------------- ---------------
This section contains information for using *youtube-dl* from Python programs. This section contains information for using *youtube-dlc* from Python programs.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2

@ -1,11 +1,11 @@
Using the ``youtube_dl`` module Using the ``youtube_dlc`` module
=============================== ===============================
When using the ``youtube_dl`` module, you start by creating an instance of :class:`YoutubeDL` and adding all the available extractors: When using the ``youtube_dlc`` module, you start by creating an instance of :class:`YoutubeDL` and adding all the available extractors:
.. code-block:: python .. code-block:: python
>>> from youtube_dl import YoutubeDL >>> from youtube_dlc import YoutubeDL
>>> ydl = YoutubeDL() >>> ydl = YoutubeDL()
>>> ydl.add_default_info_extractors() >>> ydl.add_default_info_extractors()
@ -22,7 +22,7 @@ You use the :meth:`YoutubeDL.extract_info` method for getting the video informat
[youtube] BaW_jenozKc: Downloading video info webpage [youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information [youtube] BaW_jenozKc: Extracting video information
>>> info['title'] >>> info['title']
'youtube-dl test video "\'/\\ä↭𝕐' 'youtube-dlc test video "\'/\\ä↭𝕐'
>>> info['height'], info['width'] >>> info['height'], info['width']
(720, 1280) (720, 1280)

@ -1 +1 @@
pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc pyinstaller.exe youtube_dlc\__main__.py --onefile --name youtube-dlc

@ -2,5 +2,5 @@
universal = True universal = True
[flake8] [flake8]
exclude = youtube_dl/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git,venv exclude = youtube_dlc/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git,venv
ignore = E402,E501,E731,E741,W503 ignore = E402,E501,E731,E741,W503

@ -7,9 +7,9 @@ import warnings
import sys import sys
from distutils.spawn import spawn from distutils.spawn import spawn
# Get the version from youtube_dl/version.py without importing the package # Get the version from youtube_dlc/version.py without importing the package
exec(compile(open('youtube_dl/version.py').read(), exec(compile(open('youtube_dlc/version.py').read(),
'youtube_dl/version.py', 'exec')) 'youtube_dlc/version.py', 'exec'))
DESCRIPTION = 'Media downloader supporting various sites such as youtube' DESCRIPTION = 'Media downloader supporting various sites such as youtube'
LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.'
@ -18,10 +18,10 @@ if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
print("inv") print("inv")
else: else:
files_spec = [ files_spec = [
('etc/bash_completion.d', ['youtube-dl.bash-completion']), ('etc/bash_completion.d', ['youtube-dlc.bash-completion']),
('etc/fish/completions', ['youtube-dl.fish']), ('etc/fish/completions', ['youtube-dlc.fish']),
('share/doc/youtube_dl', ['README.txt']), ('share/doc/youtube_dlc', ['README.txt']),
('share/man/man1', ['youtube-dl.1']) ('share/man/man1', ['youtube-dlc.1'])
] ]
root = os.path.dirname(os.path.abspath(__file__)) root = os.path.dirname(os.path.abspath(__file__))
data_files = [] data_files = []
@ -38,7 +38,7 @@ else:
'data_files': data_files, 'data_files': data_files,
} }
#if setuptools_available: #if setuptools_available:
params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dl:main']} params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dlc:main']}
#else: #else:
# params['scripts'] = ['bin/youtube-dlc'] # params['scripts'] = ['bin/youtube-dlc']
@ -54,7 +54,7 @@ class build_lazy_extractors(Command):
def run(self): def run(self):
spawn( spawn(
[sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dlc/extractor/lazy_extractors.py'],
dry_run=self.dry_run, dry_run=self.dry_run,
) )
@ -69,9 +69,9 @@ setup(
url="https://github.com/blackjack4494/youtube-dlc", url="https://github.com/blackjack4494/youtube-dlc",
# packages=setuptools.find_packages(), # packages=setuptools.find_packages(),
packages=[ packages=[
'youtube_dl', 'youtube_dlc',
'youtube_dl.extractor', 'youtube_dl.downloader', 'youtube_dlc.extractor', 'youtube_dlc.downloader',
'youtube_dl.postprocessor'], 'youtube_dlc.postprocessor'],
classifiers=[ classifiers=[
"Topic :: Multimedia :: Video", "Topic :: Multimedia :: Video",
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",

@ -10,13 +10,13 @@ import types
import ssl import ssl
import sys import sys
import youtube_dl.extractor import youtube_dlc.extractor
from youtube_dl import YoutubeDL from youtube_dlc import YoutubeDL
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_os_name, compat_os_name,
compat_str, compat_str,
) )
from youtube_dl.utils import ( from youtube_dlc.utils import (
preferredencoding, preferredencoding,
write_string, write_string,
) )
@ -90,7 +90,7 @@ class FakeYDL(YoutubeDL):
def gettestcases(include_onlymatching=False): def gettestcases(include_onlymatching=False):
for ie in youtube_dl.extractor.gen_extractors(): for ie in youtube_dlc.extractor.gen_extractors():
for tc in ie.get_testcases(include_onlymatching): for tc in ie.get_testcases(include_onlymatching):
yield tc yield tc

@ -10,10 +10,10 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, expect_dict, expect_value, http_server_port from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
from youtube_dl.compat import compat_etree_fromstring, compat_http_server from youtube_dlc.compat import compat_etree_fromstring, compat_http_server
from youtube_dl.extractor.common import InfoExtractor from youtube_dlc.extractor.common import InfoExtractor
from youtube_dl.extractor import YoutubeIE, get_info_extractor from youtube_dlc.extractor import YoutubeIE, get_info_extractor
from youtube_dl.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError from youtube_dlc.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError
import threading import threading

@ -12,12 +12,12 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import copy import copy
from test.helper import FakeYDL, assertRegexpMatches from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL from youtube_dlc import YoutubeDL
from youtube_dl.compat import compat_str, compat_urllib_error from youtube_dlc.compat import compat_str, compat_urllib_error
from youtube_dl.extractor import YoutubeIE from youtube_dlc.extractor import YoutubeIE
from youtube_dl.extractor.common import InfoExtractor from youtube_dlc.extractor.common import InfoExtractor
from youtube_dl.postprocessor.common import PostProcessor from youtube_dlc.postprocessor.common import PostProcessor
from youtube_dl.utils import ExtractorError, match_filter_func from youtube_dlc.utils import ExtractorError, match_filter_func
TEST_URL = 'http://localhost/sample.mp4' TEST_URL = 'http://localhost/sample.mp4'

@ -10,7 +10,7 @@ import tempfile
import unittest import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import YoutubeDLCookieJar from youtube_dlc.utils import YoutubeDLCookieJar
class TestYoutubeDLCookieJar(unittest.TestCase): class TestYoutubeDLCookieJar(unittest.TestCase):

@ -8,8 +8,8 @@ import sys
import unittest import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text from youtube_dlc.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text
from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes from youtube_dlc.utils import bytes_to_intlist, intlist_to_bytes
import base64 import base64
# the encrypted data can be generate with 'devscripts/generate_aes_testdata.py' # the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'

@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import try_rm from test.helper import try_rm
from youtube_dl import YoutubeDL from youtube_dlc import YoutubeDL
def _download_restricted(url, filename, age): def _download_restricted(url, filename, age):

@ -12,7 +12,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import gettestcases from test.helper import gettestcases
from youtube_dl.extractor import ( from youtube_dlc.extractor import (
FacebookIE, FacebookIE,
gen_extractors, gen_extractors,
YoutubeIE, YoutubeIE,
@ -70,7 +70,7 @@ class TestAllURLsMatching(unittest.TestCase):
def test_youtube_search_matching(self): def test_youtube_search_matching(self):
self.assertMatch('http://www.youtube.com/results?search_query=making+mustard', ['youtube:search_url']) self.assertMatch('http://www.youtube.com/results?search_query=making+mustard', ['youtube:search_url'])
self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', ['youtube:search_url']) self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dlc+test+video&filters=video&lclk=video', ['youtube:search_url'])
def test_youtube_extract(self): def test_youtube_extract(self):
assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id) assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id)

@ -13,7 +13,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL from test.helper import FakeYDL
from youtube_dl.cache import Cache from youtube_dlc.cache import Cache
def _is_empty(d): def _is_empty(d):

@ -10,7 +10,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_getenv, compat_getenv,
compat_setenv, compat_setenv,
compat_etree_Element, compat_etree_Element,
@ -28,11 +28,11 @@ from youtube_dl.compat import (
class TestCompat(unittest.TestCase): class TestCompat(unittest.TestCase):
def test_compat_getenv(self): def test_compat_getenv(self):
test_str = 'тест' test_str = 'тест'
compat_setenv('YOUTUBE_DL_COMPAT_GETENV', test_str) compat_setenv('youtube_dlc_COMPAT_GETENV', test_str)
self.assertEqual(compat_getenv('YOUTUBE_DL_COMPAT_GETENV'), test_str) self.assertEqual(compat_getenv('youtube_dlc_COMPAT_GETENV'), test_str)
def test_compat_setenv(self): def test_compat_setenv(self):
test_var = 'YOUTUBE_DL_COMPAT_SETENV' test_var = 'youtube_dlc_COMPAT_SETENV'
test_str = 'тест' test_str = 'тест'
compat_setenv(test_var, test_str) compat_setenv(test_var, test_str)
compat_getenv(test_var) compat_getenv(test_var)
@ -46,11 +46,11 @@ class TestCompat(unittest.TestCase):
compat_setenv('HOME', old_home or '') compat_setenv('HOME', old_home or '')
def test_all_present(self): def test_all_present(self):
import youtube_dl.compat import youtube_dlc.compat
all_names = youtube_dl.compat.__all__ all_names = youtube_dlc.compat.__all__
present_names = set(filter( present_names = set(filter(
lambda c: '_' in c and not c.startswith('_'), lambda c: '_' in c and not c.startswith('_'),
dir(youtube_dl.compat))) - set(['unicode_literals']) dir(youtube_dlc.compat))) - set(['unicode_literals'])
self.assertEqual(all_names, sorted(present_names)) self.assertEqual(all_names, sorted(present_names))
def test_compat_urllib_parse_unquote(self): def test_compat_urllib_parse_unquote(self):

@ -24,24 +24,24 @@ import io
import json import json
import socket import socket
import youtube_dl.YoutubeDL import youtube_dlc.YoutubeDL
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_http_client, compat_http_client,
compat_urllib_error, compat_urllib_error,
compat_HTTPError, compat_HTTPError,
) )
from youtube_dl.utils import ( from youtube_dlc.utils import (
DownloadError, DownloadError,
ExtractorError, ExtractorError,
format_bytes, format_bytes,
UnavailableVideoError, UnavailableVideoError,
) )
from youtube_dl.extractor import get_info_extractor from youtube_dlc.extractor import get_info_extractor
RETRIES = 3 RETRIES = 3
class YoutubeDL(youtube_dl.YoutubeDL): class YoutubeDL(youtube_dlc.YoutubeDL):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.to_stderr = self.to_screen self.to_stderr = self.to_screen
self.processed_info_dicts = [] self.processed_info_dicts = []
@ -92,7 +92,7 @@ class TestDownload(unittest.TestCase):
def generator(test_case, tname): def generator(test_case, tname):
def test_template(self): def test_template(self):
ie = youtube_dl.extractor.get_info_extractor(test_case['name'])() ie = youtube_dlc.extractor.get_info_extractor(test_case['name'])()
other_ies = [get_info_extractor(ie_key)() for ie_key in test_case.get('add_ie', [])] other_ies = [get_info_extractor(ie_key)() for ie_key in test_case.get('add_ie', [])]
is_playlist = any(k.startswith('playlist') for k in test_case) is_playlist = any(k.startswith('playlist') for k in test_case)
test_cases = test_case.get( test_cases = test_case.get(

@ -10,10 +10,10 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port, try_rm from test.helper import http_server_port, try_rm
from youtube_dl import YoutubeDL from youtube_dlc import YoutubeDL
from youtube_dl.compat import compat_http_server from youtube_dlc.compat import compat_http_server
from youtube_dl.downloader.http import HttpFD from youtube_dlc.downloader.http import HttpFD
from youtube_dl.utils import encodeFilename from youtube_dlc.utils import encodeFilename
import threading import threading
TEST_DIR = os.path.dirname(os.path.abspath(__file__)) TEST_DIR = os.path.dirname(os.path.abspath(__file__))

@ -10,7 +10,7 @@ import os
import subprocess import subprocess
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.utils import encodeArgument from youtube_dlc.utils import encodeArgument
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -23,18 +23,18 @@ except AttributeError:
class TestExecution(unittest.TestCase): class TestExecution(unittest.TestCase):
def test_import(self): def test_import(self):
subprocess.check_call([sys.executable, '-c', 'import youtube_dl'], cwd=rootDir) subprocess.check_call([sys.executable, '-c', 'import youtube_dlc'], cwd=rootDir)
def test_module_exec(self): def test_module_exec(self):
if sys.version_info >= (2, 7): # Python 2.6 doesn't support package execution if sys.version_info >= (2, 7): # Python 2.6 doesn't support package execution
subprocess.check_call([sys.executable, '-m', 'youtube_dl', '--version'], cwd=rootDir, stdout=_DEV_NULL) subprocess.check_call([sys.executable, '-m', 'youtube_dlc', '--version'], cwd=rootDir, stdout=_DEV_NULL)
def test_main_exec(self): def test_main_exec(self):
subprocess.check_call([sys.executable, 'youtube_dl/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL) subprocess.check_call([sys.executable, 'youtube_dlc/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL)
def test_cmdline_umlauts(self): def test_cmdline_umlauts(self):
p = subprocess.Popen( p = subprocess.Popen(
[sys.executable, 'youtube_dl/__main__.py', encodeArgument('ä'), '--version'], [sys.executable, 'youtube_dlc/__main__.py', encodeArgument('ä'), '--version'],
cwd=rootDir, stdout=_DEV_NULL, stderr=subprocess.PIPE) cwd=rootDir, stdout=_DEV_NULL, stderr=subprocess.PIPE)
_, stderr = p.communicate() _, stderr = p.communicate()
self.assertFalse(stderr) self.assertFalse(stderr)

@ -9,8 +9,8 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port from test.helper import http_server_port
from youtube_dl import YoutubeDL from youtube_dlc import YoutubeDL
from youtube_dl.compat import compat_http_server, compat_urllib_request from youtube_dlc.compat import compat_http_server, compat_urllib_request
import ssl import ssl
import threading import threading

@ -9,7 +9,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL from test.helper import FakeYDL
from youtube_dl.extractor import IqiyiIE from youtube_dlc.extractor import IqiyiIE
class IqiyiIEWithCredentials(IqiyiIE): class IqiyiIEWithCredentials(IqiyiIE):

@ -8,7 +8,7 @@ import sys
import unittest import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.jsinterp import JSInterpreter from youtube_dlc.jsinterp import JSInterpreter
class TestJSInterpreter(unittest.TestCase): class TestJSInterpreter(unittest.TestCase):

@ -7,7 +7,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.extractor import ( from youtube_dlc.extractor import (
gen_extractors, gen_extractors,
) )

@ -8,7 +8,7 @@ import sys
import unittest import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.options import _hide_login_info from youtube_dlc.options import _hide_login_info
class TestOptions(unittest.TestCase): class TestOptions(unittest.TestCase):

@ -8,7 +8,7 @@ import sys
import unittest import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.postprocessor import MetadataFromTitlePP from youtube_dlc.postprocessor import MetadataFromTitlePP
class TestMetadataFromTitle(unittest.TestCase): class TestMetadataFromTitle(unittest.TestCase):

@ -15,7 +15,7 @@ from test.helper import (
FakeYDL, FakeYDL,
get_params, get_params,
) )
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_str, compat_str,
compat_urllib_request, compat_urllib_request,
) )

@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, md5 from test.helper import FakeYDL, md5
from youtube_dl.extractor import ( from youtube_dlc.extractor import (
YoutubeIE, YoutubeIE,
DailymotionIE, DailymotionIE,
TEDIE, TEDIE,

@ -14,7 +14,7 @@ import json
import re import re
import subprocess import subprocess
from youtube_dl.swfinterp import SWFInterpreter from youtube_dlc.swfinterp import SWFInterpreter
TEST_DIR = os.path.join( TEST_DIR = os.path.join(

@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import json import json
from youtube_dl.update import rsa_verify from youtube_dlc.update import rsa_verify
class TestUpdate(unittest.TestCase): class TestUpdate(unittest.TestCase):

@ -15,7 +15,7 @@ import io
import json import json
import xml.etree.ElementTree import xml.etree.ElementTree
from youtube_dl.utils import ( from youtube_dlc.utils import (
age_restricted, age_restricted,
args_to_str, args_to_str,
encode_base_n, encode_base_n,
@ -105,7 +105,7 @@ from youtube_dl.utils import (
cli_bool_option, cli_bool_option,
parse_codecs, parse_codecs,
) )
from youtube_dl.compat import ( from youtube_dlc.compat import (
compat_chr, compat_chr,
compat_etree_fromstring, compat_etree_fromstring,
compat_getenv, compat_getenv,
@ -240,12 +240,12 @@ class TestUtil(unittest.TestCase):
def env(var): def env(var):
return '%{0}%'.format(var) if sys.platform == 'win32' else '${0}'.format(var) return '%{0}%'.format(var) if sys.platform == 'win32' else '${0}'.format(var)
compat_setenv('YOUTUBE_DL_EXPATH_PATH', 'expanded') compat_setenv('youtube_dlc_EXPATH_PATH', 'expanded')
self.assertEqual(expand_path(env('YOUTUBE_DL_EXPATH_PATH')), 'expanded') self.assertEqual(expand_path(env('youtube_dlc_EXPATH_PATH')), 'expanded')
self.assertEqual(expand_path(env('HOME')), compat_getenv('HOME')) self.assertEqual(expand_path(env('HOME')), compat_getenv('HOME'))
self.assertEqual(expand_path('~'), compat_getenv('HOME')) self.assertEqual(expand_path('~'), compat_getenv('HOME'))
self.assertEqual( self.assertEqual(
expand_path('~/%s' % env('YOUTUBE_DL_EXPATH_PATH')), expand_path('~/%s' % env('youtube_dlc_EXPATH_PATH')),
'%s/expanded' % compat_getenv('HOME')) '%s/expanded' % compat_getenv('HOME'))
def test_prepend_extension(self): def test_prepend_extension(self):
@ -1388,8 +1388,8 @@ Line 1
self.assertEqual(caesar('ebg', 'acegik', -2), 'abc') self.assertEqual(caesar('ebg', 'acegik', -2), 'abc')
def test_rot47(self): def test_rot47(self):
self.assertEqual(rot47('youtube-dl'), r'J@FEF36\5=') self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=')
self.assertEqual(rot47('YOUTUBE-DL'), r'*~&%&qt\s{') self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{')
def test_urshift(self): def test_urshift(self):
self.assertEqual(urshift(3, 1), 1) self.assertEqual(urshift(3, 1), 1)

@ -17,7 +17,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_arg(self): def test_private_info_arg(self):
outp = subprocess.Popen( outp = subprocess.Popen(
[ [
sys.executable, 'youtube_dl/__main__.py', '-v', sys.executable, 'youtube_dlc/__main__.py', '-v',
'--username', 'johnsmith@gmail.com', '--username', 'johnsmith@gmail.com',
'--password', 'secret', '--password', 'secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -30,7 +30,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_shortarg(self): def test_private_info_shortarg(self):
outp = subprocess.Popen( outp = subprocess.Popen(
[ [
sys.executable, 'youtube_dl/__main__.py', '-v', sys.executable, 'youtube_dlc/__main__.py', '-v',
'-u', 'johnsmith@gmail.com', '-u', 'johnsmith@gmail.com',
'-p', 'secret', '-p', 'secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -43,7 +43,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_eq(self): def test_private_info_eq(self):
outp = subprocess.Popen( outp = subprocess.Popen(
[ [
sys.executable, 'youtube_dl/__main__.py', '-v', sys.executable, 'youtube_dlc/__main__.py', '-v',
'--username=johnsmith@gmail.com', '--username=johnsmith@gmail.com',
'--password=secret', '--password=secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -56,7 +56,7 @@ class TestVerboseOutput(unittest.TestCase):
def test_private_info_shortarg_eq(self): def test_private_info_shortarg_eq(self):
outp = subprocess.Popen( outp = subprocess.Popen(
[ [
sys.executable, 'youtube_dl/__main__.py', '-v', sys.executable, 'youtube_dlc/__main__.py', '-v',
'-u=johnsmith@gmail.com', '-u=johnsmith@gmail.com',
'-p=secret', '-p=secret',
], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

@ -15,11 +15,11 @@ import io
import xml.etree.ElementTree import xml.etree.ElementTree
import youtube_dl.YoutubeDL import youtube_dlc.YoutubeDL
import youtube_dl.extractor import youtube_dlc.extractor
class YoutubeDL(youtube_dl.YoutubeDL): class YoutubeDL(youtube_dlc.YoutubeDL):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(YoutubeDL, self).__init__(*args, **kwargs) super(YoutubeDL, self).__init__(*args, **kwargs)
self.to_stderr = self.to_screen self.to_stderr = self.to_screen
@ -45,7 +45,7 @@ class TestAnnotations(unittest.TestCase):
def test_info_json(self): def test_info_json(self):
expected = list(EXPECTED_ANNOTATIONS) # Two annotations could have the same text. expected = list(EXPECTED_ANNOTATIONS) # Two annotations could have the same text.
ie = youtube_dl.extractor.YoutubeIE() ie = youtube_dlc.extractor.YoutubeIE()
ydl = YoutubeDL(params) ydl = YoutubeDL(params)
ydl.add_info_extractor(ie) ydl.add_info_extractor(ie)
ydl.download([TEST_ID]) ydl.download([TEST_ID])

@ -9,7 +9,7 @@ import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import expect_value from test.helper import expect_value
from youtube_dl.extractor import YoutubeIE from youtube_dlc.extractor import YoutubeIE
class TestYoutubeChapters(unittest.TestCase): class TestYoutubeChapters(unittest.TestCase):

@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL from test.helper import FakeYDL
from youtube_dl.extractor import ( from youtube_dlc.extractor import (
YoutubePlaylistIE, YoutubePlaylistIE,
YoutubeIE, YoutubeIE,
) )

@ -13,8 +13,8 @@ import re
import string import string
from test.helper import FakeYDL from test.helper import FakeYDL
from youtube_dl.extractor import YoutubeIE from youtube_dlc.extractor import YoutubeIE
from youtube_dl.compat import compat_str, compat_urlretrieve from youtube_dlc.compat import compat_str, compat_urlretrieve
_TESTS = [ _TESTS = [
( (

@ -10,5 +10,5 @@ defaultargs = test --exclude test_download.py --exclude test_age_restriction.py
--exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_subtitles.py --exclude test_write_annotations.py
--exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py --exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py
--exclude test_socks.py --exclude test_socks.py
commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dl --cover-html commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dlc --cover-html
# test.test_download:TestDownload.test_NowVideo # test.test_download:TestDownload.test_NowVideo

@ -1,4 +1,4 @@
# This allows the youtube-dl command to be installed in ZSH using antigen. # This allows the youtube-dlc command to be installed in ZSH using antigen.
# Antigen is a bundle manager. It allows you to enhance the functionality of # Antigen is a bundle manager. It allows you to enhance the functionality of
# your zsh session by installing bundles and themes easily. # your zsh session by installing bundles and themes easily.
@ -6,11 +6,11 @@
# http://antigen.sharats.me/ # http://antigen.sharats.me/
# https://github.com/zsh-users/antigen # https://github.com/zsh-users/antigen
# Install youtube-dl: # Install youtube-dlc:
# antigen bundle ytdl-org/youtube-dl # antigen bundle ytdl-org/youtube-dl
# Bundles installed by antigen are available for use immediately. # Bundles installed by antigen are available for use immediately.
# Update youtube-dl (and all other antigen bundles): # Update youtube-dlc (and all other antigen bundles):
# antigen update # antigen update
# The antigen command will download the git repository to a folder and then # The antigen command will download the git repository to a folder and then
@ -18,7 +18,7 @@
# code is documented here: # code is documented here:
# https://github.com/zsh-users/antigen#notes-on-writing-plugins # https://github.com/zsh-users/antigen#notes-on-writing-plugins
# This specific script just aliases youtube-dl to the python script that this # This specific script just aliases youtube-dlc to the python script that this
# library provides. This requires updating the PYTHONPATH to ensure that the # library provides. This requires updating the PYTHONPATH to ensure that the
# full set of code can be located. # full set of code can be located.
alias youtube-dl="PYTHONPATH=$(dirname $0) $(dirname $0)/bin/youtube-dl" alias youtube-dlc="PYTHONPATH=$(dirname $0) $(dirname $0)/bin/youtube-dlc"

@ -228,7 +228,7 @@ class YoutubeDL(object):
playlist items. playlist items.
postprocessors: A list of dictionaries, each with an entry postprocessors: A list of dictionaries, each with an entry
* key: The name of the postprocessor. See * key: The name of the postprocessor. See
youtube_dl/postprocessor/__init__.py for a list. youtube_dlc/postprocessor/__init__.py for a list.
as well as any further keyword arguments for the as well as any further keyword arguments for the
postprocessor. postprocessor.
progress_hooks: A list of functions that get called on download progress_hooks: A list of functions that get called on download
@ -264,7 +264,7 @@ class YoutubeDL(object):
about it, warn otherwise (default) about it, warn otherwise (default)
source_address: Client-side IP address to bind to. source_address: Client-side IP address to bind to.
call_home: Boolean, true iff we are allowed to contact the call_home: Boolean, true iff we are allowed to contact the
youtube-dl servers for debugging. youtube-dlc servers for debugging.
sleep_interval: Number of seconds to sleep before each download when sleep_interval: Number of seconds to sleep before each download when
used alone or a lower bound of a range for randomized used alone or a lower bound of a range for randomized
sleep before each download (minimum possible number sleep before each download (minimum possible number
@ -301,7 +301,7 @@ class YoutubeDL(object):
use downloader suggested by extractor if None. use downloader suggested by extractor if None.
The following parameters are not used by YoutubeDL itself, they are used by The following parameters are not used by YoutubeDL itself, they are used by
the downloader (see youtube_dl/downloader/common.py): the downloader (see youtube_dlc/downloader/common.py):
nopart, updatetime, buffersize, ratelimit, min_filesize, max_filesize, test, nopart, updatetime, buffersize, ratelimit, min_filesize, max_filesize, test,
noresizebuffer, retries, continuedl, noprogress, consoletitle, noresizebuffer, retries, continuedl, noprogress, consoletitle,
xattr_set_filesize, external_downloader_args, hls_use_mpegts, xattr_set_filesize, external_downloader_args, hls_use_mpegts,
@ -441,7 +441,7 @@ class YoutubeDL(object):
if re.match(r'^-[0-9A-Za-z_-]{10}$', a)] if re.match(r'^-[0-9A-Za-z_-]{10}$', a)]
if idxs: if idxs:
correct_argv = ( correct_argv = (
['youtube-dl'] ['youtube-dlc']
+ [a for i, a in enumerate(argv) if i not in idxs] + [a for i, a in enumerate(argv) if i not in idxs]
+ ['--'] + [argv[i] for i in idxs] + ['--'] + [argv[i] for i in idxs]
) )
@ -2254,7 +2254,7 @@ class YoutubeDL(object):
self.get_encoding())) self.get_encoding()))
write_string(encoding_str, encoding=None) write_string(encoding_str, encoding=None)
self._write_string('[debug] youtube-dl version ' + __version__ + '\n') self._write_string('[debug] youtube-dlc version ' + __version__ + '\n')
if _LAZY_LOADER: if _LAZY_LOADER:
self._write_string('[debug] Lazy loading extractors enabled' + '\n') self._write_string('[debug] Lazy loading extractors enabled' + '\n')
try: try:
@ -2352,7 +2352,7 @@ class YoutubeDL(object):
file_handler = compat_urllib_request.FileHandler() file_handler = compat_urllib_request.FileHandler()
def file_open(*args, **kwargs): def file_open(*args, **kwargs):
raise compat_urllib_error.URLError('file:// scheme is explicitly disabled in youtube-dl for security reasons') raise compat_urllib_error.URLError('file:// scheme is explicitly disabled in youtube-dlc for security reasons')
file_handler.file_open = file_open file_handler.file_open = file_open
opener = compat_urllib_request.build_opener( opener = compat_urllib_request.build_opener(

@ -53,7 +53,7 @@ def _real_main(argv=None):
workaround_optparse_bug9161() workaround_optparse_bug9161()
setproctitle('youtube-dl') setproctitle('youtube-dlc')
parser, opts, args = parseOpts(argv) parser, opts, args = parseOpts(argv)
@ -455,7 +455,7 @@ def _real_main(argv=None):
ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv)
parser.error( parser.error(
'You must provide at least one URL.\n' 'You must provide at least one URL.\n'
'Type youtube-dl --help to see a list of all options.') 'Type youtube-dlc --help to see a list of all options.')
try: try:
if opts.load_info_filename is not None: if opts.load_info_filename is not None:

@ -2,8 +2,8 @@
from __future__ import unicode_literals from __future__ import unicode_literals
# Execute with # Execute with
# $ python youtube_dl/__main__.py (2.6+) # $ python youtube_dlc/__main__.py (2.6+)
# $ python -m youtube_dl (2.7+) # $ python -m youtube_dlc (2.7+)
import sys import sys
@ -13,7 +13,7 @@ if __package__ is None and not hasattr(sys, 'frozen'):
path = os.path.realpath(os.path.abspath(__file__)) path = os.path.realpath(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(os.path.dirname(path))) sys.path.insert(0, os.path.dirname(os.path.dirname(path)))
import youtube_dl import youtube_dlc
if __name__ == '__main__': if __name__ == '__main__':
youtube_dl.main() youtube_dlc.main()

@ -23,7 +23,7 @@ class Cache(object):
res = self._ydl.params.get('cachedir') res = self._ydl.params.get('cachedir')
if res is None: if res is None:
cache_root = compat_getenv('XDG_CACHE_HOME', '~/.cache') cache_root = compat_getenv('XDG_CACHE_HOME', '~/.cache')
res = os.path.join(cache_root, 'youtube-dl') res = os.path.join(cache_root, 'youtube-dlc')
return expand_path(res) return expand_path(res)
def _get_cache_fn(self, section, key, dtype): def _get_cache_fn(self, section, key, dtype):

@ -2973,7 +2973,7 @@ else:
if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0): if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0):
# PyPy2 prior to version 5.4.0 expects byte strings as Windows function # PyPy2 prior to version 5.4.0 expects byte strings as Windows function
# names, see the original PyPy issue [1] and the youtube-dl one [2]. # names, see the original PyPy issue [1] and the youtube-dlc one [2].
# 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name # 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name
# 2. https://github.com/ytdl-org/youtube-dl/pull/4392 # 2. https://github.com/ytdl-org/youtube-dl/pull/4392
def compat_ctypes_WINFUNCTYPE(*args, **kwargs): def compat_ctypes_WINFUNCTYPE(*args, **kwargs):

@ -243,7 +243,7 @@ class FileDownloader(object):
else: else:
clear_line = ('\r\x1b[K' if sys.stderr.isatty() else '\r') clear_line = ('\r\x1b[K' if sys.stderr.isatty() else '\r')
self.to_screen(clear_line + fullmsg, skip_eol=not is_last_line) self.to_screen(clear_line + fullmsg, skip_eol=not is_last_line)
self.to_console_title('youtube-dl ' + msg) self.to_console_title('youtube-dlc ' + msg)
def report_progress(self, s): def report_progress(self, s):
if s['status'] == 'finished': if s['status'] == 'finished':

@ -32,9 +32,9 @@ class FragmentFD(FileDownloader):
keep_fragments: Keep downloaded fragments on disk after downloading is keep_fragments: Keep downloaded fragments on disk after downloading is
finished finished
For each incomplete fragment download youtube-dl keeps on disk a special For each incomplete fragment download youtube-dlc keeps on disk a special
bookkeeping file with download state and metadata (in future such files will bookkeeping file with download state and metadata (in future such files will
be used for any incomplete download handled by youtube-dl). This file is be used for any incomplete download handled by youtube-dlc). This file is
used to properly handle resuming, check download file consistency and detect used to properly handle resuming, check download file consistency and detect
potential errors. The file has a .ytdl extension and represents a standard potential errors. The file has a .ytdl extension and represents a standard
JSON file of the following format: JSON file of the following format:

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save