diff options
Diffstat (limited to 'devscripts')
| -rw-r--r-- | devscripts/bash-completion.in | 6 | ||||
| -rwxr-xr-x | devscripts/gh-pages/add-version.py | 11 | ||||
| -rwxr-xr-x | devscripts/gh-pages/update-sites.py | 33 | ||||
| -rwxr-xr-x | devscripts/release.sh | 1 | ||||
| -rw-r--r-- | devscripts/youtube_genalgo.py | 12 | 
5 files changed, 53 insertions, 10 deletions
| diff --git a/devscripts/bash-completion.in b/devscripts/bash-completion.in index 3b99a9614..bd10f63c2 100644 --- a/devscripts/bash-completion.in +++ b/devscripts/bash-completion.in @@ -4,8 +4,12 @@ __youtube-dl()      COMPREPLY=()      cur="${COMP_WORDS[COMP_CWORD]}"      opts="{{flags}}" +    keywords=":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater" -    if [[ ${cur} == * ]] ; then +    if [[ ${cur} =~ : ]]; then +        COMPREPLY=( $(compgen -W "${keywords}" -- ${cur}) ) +        return 0 +    elif [[ ${cur} == * ]] ; then          COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )          return 0      fi diff --git a/devscripts/gh-pages/add-version.py b/devscripts/gh-pages/add-version.py index 116420ef2..35865b2f3 100755 --- a/devscripts/gh-pages/add-version.py +++ b/devscripts/gh-pages/add-version.py @@ -3,7 +3,8 @@  import json  import sys  import hashlib -import urllib.request +import os.path +  if len(sys.argv) <= 1:      print('Specify the version number as parameter') @@ -23,10 +24,14 @@ filenames = {      'bin': 'youtube-dl',      'exe': 'youtube-dl.exe',      'tar': 'youtube-dl-%s.tar.gz' % version} +build_dir = os.path.join('..', '..', 'build', version)  for key, filename in filenames.items(): -    print('Downloading and checksumming %s...' % filename)      url = 'https://yt-dl.org/downloads/%s/%s' % (version, filename) -    data = urllib.request.urlopen(url).read() +    fn = os.path.join(build_dir, filename) +    with open(fn, 'rb') as f: +        data = f.read() +    if not data: +        raise ValueError('File %s is empty!' % fn)      sha256sum = hashlib.sha256(data).hexdigest()      new_version[key] = (url, sha256sum) diff --git a/devscripts/gh-pages/update-sites.py b/devscripts/gh-pages/update-sites.py new file mode 100755 index 000000000..33f242480 --- /dev/null +++ b/devscripts/gh-pages/update-sites.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import sys +import os +import textwrap + +# We must be able to import youtube_dl +sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) + +import youtube_dl + +def main(): +    with open('supportedsites.html.in', 'r', encoding='utf-8') as tmplf: +        template = tmplf.read() + +    ie_htmls = [] +    for ie in sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower()): +        ie_html = '<b>{}</b>'.format(ie.IE_NAME) +        try: +            ie_html += ': {}'.format(ie.IE_DESC) +        except AttributeError: +            pass +        if ie.working() == False: +            ie_html += ' (Currently broken)' +        ie_htmls.append('<li>{}</li>'.format(ie_html)) + +    template = template.replace('@SITES@', textwrap.indent('\n'.join(ie_htmls), '\t')) + +    with open('supportedsites.html', 'w', encoding='utf-8') as sitesf: +        sitesf.write(template) + +if __name__ == '__main__': +    main() diff --git a/devscripts/release.sh b/devscripts/release.sh index 24c9ad8d8..62c68a6cf 100755 --- a/devscripts/release.sh +++ b/devscripts/release.sh @@ -85,6 +85,7 @@ ROOT=$(pwd)      "$ROOT/devscripts/gh-pages/sign-versions.py" < "$ROOT/updates_key.pem"      "$ROOT/devscripts/gh-pages/generate-download.py"      "$ROOT/devscripts/gh-pages/update-copyright.py" +    "$ROOT/devscripts/gh-pages/update-sites.py"      git add *.html *.html.in update      git commit -m "release $version"      git show HEAD diff --git a/devscripts/youtube_genalgo.py b/devscripts/youtube_genalgo.py index 13df535c7..b390c7e2e 100644 --- a/devscripts/youtube_genalgo.py +++ b/devscripts/youtube_genalgo.py @@ -20,21 +20,21 @@ tests = [      # 87      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$^&*()_-+={[]}|:;?/>.<",       "uioplkjhgfdsazxcvbnm1t34567890QWE2TYUIOPLKJHGFDSAZXCVeNM!@#$^&*()_-+={[]}|:;?/>.<"), -    # 86 - vflg0g8PQ 2013/08/29 +    # 86 - vfluy6kdb 2013/09/06      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[|};?/>.<", -     ">/?;}|[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWq0987654321mnbvcxzasdfghjklpoiuytr"), -    # 85 +     "yuioplkjhgfdsazxcvbnm12345678q0QWrRTYUIOELKJHGFD-AZXCVBNM!@#$%^&*()_<+={[|};?/>.S"), +    # 85 - vflkuzxcs 2013/09/11      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?/>.<", -     ".>/?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWQ0q876543r1mnbvcx9asdfghjklpoiuyt2"), +     "T>/?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOvUY.REWQ0987654321mnbqcxzasdfghjklpoiuytr"),      # 84 - vflg0g8PQ 2013/08/29 (sporadic)      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!@#$%^&*()_-+={[};?>.<",       ">?;}[{=+-_)(*&^%$#@!MNBVCXZASDFGHJKLPOIUYTREWq0987654321mnbvcxzasdfghjklpoiuytr"),      # 83      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKJHGFDSAZXCVBNM!#$%^&*()_+={[};?/>.<",       ".>/?;}[{=+_)(*&^%<#!MNBVCXZASPFGHJKLwOIUYTREWQ0987654321mnbvcxzasdfghjklpoiuytreq"), -    # 82 - vflZK4ZYR 2013/08/23 +    # 82 - vflGNjMhJ 2013/09/12      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>.<", -     "wertyuioplkjhgfdsaqxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&z(-+={[};?/>.<"), +     ".>/?;}[<=+-(*&^%$#@!MNBVCXeASDFGHKLPOqUYTREWQ0987654321mnbvcxzasdfghjklpoiuytrIwZ"),      # 81 - vflLC8JvQ 2013/07/25      ("qwertyuioplkjhgfdsazxcvbnm1234567890QWERTYUIOPLKHGFDSAZXCVBNM!@#$%^&*(-+={[};?/>.",       "C>/?;}[{=+-(*&^%$#@!MNBVYXZASDFGHKLPOIU.TREWQ0q87659321mnbvcxzasdfghjkl4oiuytrewp"), | 
