mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[skip travis] renaming
to avoid using same folder when using pip install for example
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
__youtube_dl()
 | 
			
		||||
__youtube_dlc()
 | 
			
		||||
{
 | 
			
		||||
    local cur prev opts fileopts diropts keywords
 | 
			
		||||
    COMPREPLY=()
 | 
			
		||||
@@ -26,4 +26,4 @@ __youtube_dl()
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -26,5 +26,5 @@ def build_completion(opt_parser):
 | 
			
		||||
        f.write(filled_template)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
parser = youtube_dl.parseOpts()[0]
 | 
			
		||||
parser = youtube_dlc.parseOpts()[0]
 | 
			
		||||
build_completion(parser)
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ import traceback
 | 
			
		||||
import os.path
 | 
			
		||||
 | 
			
		||||
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_http_server,
 | 
			
		||||
    compat_str,
 | 
			
		||||
@@ -325,7 +325,7 @@ class YoutubeDLBuilder(object):
 | 
			
		||||
    authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org']
 | 
			
		||||
 | 
			
		||||
    def __init__(self, **kwargs):
 | 
			
		||||
        if self.repoName != 'youtube-dl':
 | 
			
		||||
        if self.repoName != 'youtube-dlc':
 | 
			
		||||
            raise BuildError('Invalid repository "%s"' % self.repoName)
 | 
			
		||||
        if self.user not in self.authorizedUsers:
 | 
			
		||||
            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__))))
 | 
			
		||||
 | 
			
		||||
from test.helper import gettestcases
 | 
			
		||||
from youtube_dl.utils import compat_urllib_parse_urlparse
 | 
			
		||||
from youtube_dl.utils import compat_urllib_request
 | 
			
		||||
from youtube_dlc.utils import compat_urllib_parse_urlparse
 | 
			
		||||
from youtube_dlc.utils import compat_urllib_request
 | 
			
		||||
 | 
			
		||||
if len(sys.argv) > 1:
 | 
			
		||||
    METHOD = 'LIST'
 | 
			
		||||
 
 | 
			
		||||
@@ -12,13 +12,13 @@ import sys
 | 
			
		||||
 | 
			
		||||
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_getpass,
 | 
			
		||||
    compat_print,
 | 
			
		||||
    compat_urllib_request,
 | 
			
		||||
)
 | 
			
		||||
from youtube_dl.utils import (
 | 
			
		||||
from youtube_dlc.utils import (
 | 
			
		||||
    make_HTTPS_handler,
 | 
			
		||||
    sanitized_Request,
 | 
			
		||||
)
 | 
			
		||||
@@ -98,7 +98,7 @@ def main():
 | 
			
		||||
    releaser = GitHubReleaser()
 | 
			
		||||
 | 
			
		||||
    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']
 | 
			
		||||
 | 
			
		||||
    for asset in os.listdir(build_path):
 | 
			
		||||
 
 | 
			
		||||
@@ -2,4 +2,4 @@
 | 
			
		||||
{{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
 | 
			
		||||
 | 
			
		||||
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
 | 
			
		||||
import youtube_dl
 | 
			
		||||
from youtube_dl.utils import shell_quote
 | 
			
		||||
import youtube_dlc
 | 
			
		||||
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'
 | 
			
		||||
 | 
			
		||||
EXTRA_ARGS = {
 | 
			
		||||
@@ -30,7 +30,7 @@ def build_completion(opt_parser):
 | 
			
		||||
    for group in opt_parser.option_groups:
 | 
			
		||||
        for option in group.option_list:
 | 
			
		||||
            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:
 | 
			
		||||
                complete_cmd += ['--short-option', option._short_opts[0].strip('-')]
 | 
			
		||||
            if option.help != optparse.SUPPRESS_HELP:
 | 
			
		||||
@@ -45,5 +45,5 @@ def build_completion(opt_parser):
 | 
			
		||||
        f.write(filled_template)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
parser = youtube_dl.parseOpts()[0]
 | 
			
		||||
parser = youtube_dlc.parseOpts()[0]
 | 
			
		||||
build_completion(parser)
 | 
			
		||||
 
 | 
			
		||||
@@ -7,8 +7,8 @@ import os
 | 
			
		||||
import sys
 | 
			
		||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 | 
			
		||||
 | 
			
		||||
from youtube_dl.utils import intlist_to_bytes
 | 
			
		||||
from youtube_dl.aes import aes_encrypt, key_expansion
 | 
			
		||||
from youtube_dlc.utils import intlist_to_bytes
 | 
			
		||||
from youtube_dlc.aes import aes_encrypt, key_expansion
 | 
			
		||||
 | 
			
		||||
secret_msg = b'Secret message goes here'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,9 +22,9 @@ if 'signature' in versions_info:
 | 
			
		||||
new_version = {}
 | 
			
		||||
 | 
			
		||||
filenames = {
 | 
			
		||||
    'bin': 'youtube-dl',
 | 
			
		||||
    'exe': 'youtube-dl.exe',
 | 
			
		||||
    'tar': 'youtube-dl-%s.tar.gz' % version}
 | 
			
		||||
    'bin': 'youtube-dlc',
 | 
			
		||||
    'exe': 'youtube-dlc.exe',
 | 
			
		||||
    'tar': 'youtube-dlc-%s.tar.gz' % version}
 | 
			
		||||
build_dir = os.path.join('..', '..', 'build', version)
 | 
			
		||||
for key, filename in filenames.items():
 | 
			
		||||
    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"?>
 | 
			
		||||
    <feed xmlns="http://www.w3.org/2005/Atom">
 | 
			
		||||
        <link rel="self" href="http://ytdl-org.github.io/youtube-dl/update/releases.atom" />
 | 
			
		||||
        <title>youtube-dl releases</title>
 | 
			
		||||
        <id>https://yt-dl.org/feed/youtube-dl-updates-feed</id>
 | 
			
		||||
        <title>youtube-dlc releases</title>
 | 
			
		||||
        <id>https://yt-dl.org/feed/youtube-dlc-updates-feed</id>
 | 
			
		||||
        <updated>@TIMESTAMP@</updated>
 | 
			
		||||
        @ENTRIES@
 | 
			
		||||
    </feed>""")
 | 
			
		||||
 | 
			
		||||
entry_template = textwrap.dedent("""
 | 
			
		||||
    <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>
 | 
			
		||||
        <link href="http://ytdl-org.github.io/youtube-dl" />
 | 
			
		||||
        <link href="http://ytdl-org.github.io/youtube-dlc" />
 | 
			
		||||
        <content type="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>
 | 
			
		||||
            </div>
 | 
			
		||||
        </content>
 | 
			
		||||
        <author>
 | 
			
		||||
            <name>The youtube-dl maintainers</name>
 | 
			
		||||
            <name>The youtube-dlc maintainers</name>
 | 
			
		||||
        </author>
 | 
			
		||||
        <updated>@TIMESTAMP@</updated>
 | 
			
		||||
    </entry>
 | 
			
		||||
 
 | 
			
		||||
@@ -5,10 +5,10 @@ import sys
 | 
			
		||||
import os
 | 
			
		||||
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__)))))
 | 
			
		||||
 | 
			
		||||
import youtube_dl
 | 
			
		||||
import youtube_dlc
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
@@ -16,7 +16,7 @@ def main():
 | 
			
		||||
        template = tmplf.read()
 | 
			
		||||
 | 
			
		||||
    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_desc = getattr(ie, 'IE_DESC', None)
 | 
			
		||||
        if ie_desc is False:
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ def main():
 | 
			
		||||
    bug_text = re.search(
 | 
			
		||||
        r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
 | 
			
		||||
    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)
 | 
			
		||||
 | 
			
		||||
    out = bug_text + dev_text
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,9 @@ def main():
 | 
			
		||||
    with io.open(infile, encoding='utf-8') as inf:
 | 
			
		||||
        issue_template_tmpl = inf.read()
 | 
			
		||||
 | 
			
		||||
    # Get the version from youtube_dl/version.py without importing the package
 | 
			
		||||
    exec(compile(open('youtube_dl/version.py').read(),
 | 
			
		||||
                 'youtube_dl/version.py', 'exec'))
 | 
			
		||||
    # Get the version from youtube_dlc/version.py without importing the package
 | 
			
		||||
    exec(compile(open('youtube_dlc/version.py').read(),
 | 
			
		||||
                 'youtube_dlc/version.py', 'exec'))
 | 
			
		||||
 | 
			
		||||
    out = issue_template_tmpl % {'version': locals()['__version__']}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,8 +14,8 @@ lazy_extractors_filename = sys.argv[1]
 | 
			
		||||
if os.path.exists(lazy_extractors_filename):
 | 
			
		||||
    os.remove(lazy_extractors_filename)
 | 
			
		||||
 | 
			
		||||
from youtube_dl.extractor import _ALL_CLASSES
 | 
			
		||||
from youtube_dl.extractor.common import InfoExtractor, SearchInfoExtractor
 | 
			
		||||
from youtube_dlc.extractor import _ALL_CLASSES
 | 
			
		||||
from youtube_dlc.extractor.common import InfoExtractor, SearchInfoExtractor
 | 
			
		||||
 | 
			
		||||
with open('devscripts/lazy_load_template.py', 'rt') as f:
 | 
			
		||||
    module_template = f.read()
 | 
			
		||||
 
 | 
			
		||||
@@ -7,10 +7,10 @@ import os
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Import youtube_dl
 | 
			
		||||
# Import youtube_dlc
 | 
			
		||||
ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
 | 
			
		||||
sys.path.insert(0, ROOT_DIR)
 | 
			
		||||
import youtube_dl
 | 
			
		||||
import youtube_dlc
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
@@ -33,7 +33,7 @@ def main():
 | 
			
		||||
                ie_md += ' (Currently broken)'
 | 
			
		||||
            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(
 | 
			
		||||
        ' - ' + md + '\n'
 | 
			
		||||
        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__)))
 | 
			
		||||
README_FILE = os.path.join(ROOT_DIR, 'README.md')
 | 
			
		||||
 | 
			
		||||
PREFIX = r'''%YOUTUBE-DL(1)
 | 
			
		||||
PREFIX = r'''%youtube-dlc(1)
 | 
			
		||||
 | 
			
		||||
# NAME
 | 
			
		||||
 | 
			
		||||
@@ -16,7 +16,7 @@ youtube\-dl \- download videos from youtube.com or other video platforms
 | 
			
		||||
 | 
			
		||||
# SYNOPSIS
 | 
			
		||||
 | 
			
		||||
**youtube-dl** \[OPTIONS\] URL [URL...]
 | 
			
		||||
**youtube-dlc** \[OPTIONS\] URL [URL...]
 | 
			
		||||
 | 
			
		||||
'''
 | 
			
		||||
 | 
			
		||||
@@ -33,7 +33,7 @@ def main():
 | 
			
		||||
        readme = f.read()
 | 
			
		||||
 | 
			
		||||
    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 = 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 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')
 | 
			
		||||
if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dl: $useless_files"; exit 1; fi
 | 
			
		||||
useless_files=$(find youtube_dlc -type f -not -name '*.py')
 | 
			
		||||
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 ! 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
 | 
			
		||||
@@ -68,18 +68,18 @@ make clean
 | 
			
		||||
if $skip_tests ; then
 | 
			
		||||
    echo 'SKIPPING TESTS'
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
/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..."
 | 
			
		||||
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
 | 
			
		||||
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"
 | 
			
		||||
 | 
			
		||||
/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..."
 | 
			
		||||
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
 | 
			
		||||
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"
 | 
			
		||||
mv youtube-dl youtube-dl.exe "build/$version"
 | 
			
		||||
mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz"
 | 
			
		||||
RELEASE_FILES="youtube-dl youtube-dl.exe youtube-dl-$version.tar.gz"
 | 
			
		||||
mv youtube-dlc youtube-dlc.exe "build/$version"
 | 
			
		||||
mv youtube-dlc.tar.gz "build/$version/youtube-dlc-$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/ && sha1sum $RELEASE_FILES > SHA1SUMS)
 | 
			
		||||
(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__))))
 | 
			
		||||
 | 
			
		||||
from youtube_dl.compat import (
 | 
			
		||||
from youtube_dlc.compat import (
 | 
			
		||||
    compat_print,
 | 
			
		||||
    compat_urllib_request,
 | 
			
		||||
)
 | 
			
		||||
from youtube_dl.utils import format_bytes
 | 
			
		||||
from youtube_dlc.utils import format_bytes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def format_size(bytes):
 | 
			
		||||
@@ -36,9 +36,9 @@ for page in itertools.count(1):
 | 
			
		||||
            asset_name = asset['name']
 | 
			
		||||
            total_bytes += asset['download_count'] * asset['size']
 | 
			
		||||
            if all(not re.match(p, asset_name) for p in (
 | 
			
		||||
                    r'^youtube-dl$',
 | 
			
		||||
                    r'^youtube-dl-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$',
 | 
			
		||||
                    r'^youtube-dl\.exe$')):
 | 
			
		||||
                    r'^youtube-dlc$',
 | 
			
		||||
                    r'^youtube-dlc-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$',
 | 
			
		||||
                    r'^youtube-dlc\.exe$')):
 | 
			
		||||
                continue
 | 
			
		||||
            compat_print(
 | 
			
		||||
                ' %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
 | 
			
		||||
    typeset -A opt_args
 | 
			
		||||
    fileopts="{{fileopts}}"
 | 
			
		||||
@@ -25,4 +25,4 @@ __youtube_dl() {
 | 
			
		||||
    esac
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__youtube_dl
 | 
			
		||||
__youtube_dlc
 | 
			
		||||
@@ -6,9 +6,9 @@ from os.path import dirname as dirn
 | 
			
		||||
import sys
 | 
			
		||||
 | 
			
		||||
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"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -45,5 +45,5 @@ def build_completion(opt_parser):
 | 
			
		||||
        f.write(template)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
parser = youtube_dl.parseOpts()[0]
 | 
			
		||||
parser = youtube_dlc.parseOpts()[0]
 | 
			
		||||
build_completion(parser)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user