mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-28 09:07:54 +01:00
moved docs and updates generation scripts from gh-pages branch to master
This commit is contained in:
parent
0e91665e1a
commit
c8ff21bd82
6
Makefile
6
Makefile
@ -1,6 +0,0 @@
|
||||
update:
|
||||
python3 ./generate-download
|
||||
python3 ./update-copyright
|
||||
|
||||
.PHONY: update
|
||||
|
@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import hashlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import urllib.request
|
||||
|
||||
URL = 'https://github.com/downloads/rg3/youtube-dl/youtube-dl'
|
||||
|
||||
with tempfile.NamedTemporaryFile(suffix='youtube-dl', delete=True) as ytdl_file:
|
||||
with urllib.request.urlopen(URL) as dl:
|
||||
shutil.copyfileobj(dl, ytdl_file)
|
||||
|
||||
ytdl_file.seek(0)
|
||||
data = ytdl_file.read()
|
||||
|
||||
ytdl_file.flush()
|
||||
version = subprocess.check_output(['python3', ytdl_file.name, '--version']).decode('ascii').strip()
|
||||
|
||||
# Read template page
|
||||
with open('download.html.in', 'r', encoding='utf-8') as tmplf:
|
||||
template = tmplf.read()
|
||||
|
||||
md5sum = hashlib.md5(data).hexdigest()
|
||||
sha1sum = hashlib.sha1(data).hexdigest()
|
||||
sha256sum = hashlib.sha256(data).hexdigest()
|
||||
template = template.replace('@PROGRAM_VERSION@', version)
|
||||
template = template.replace('@PROGRAM_URL@', URL)
|
||||
template = template.replace('@PROGRAM_MD5SUM@', md5sum)
|
||||
template = template.replace('@PROGRAM_SHA1SUM@', sha1sum)
|
||||
template = template.replace('@PROGRAM_SHA256SUM@', sha256sum)
|
||||
with open('download.html', 'w', encoding='utf-8') as dlf:
|
||||
dlf.write(template)
|
@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf-8
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
import datetime
|
||||
import glob
|
||||
import io # For Python 2 compatibilty
|
||||
import os
|
||||
import re
|
||||
|
||||
year = str(datetime.datetime.now().year)
|
||||
for fn in glob.glob('*.html*'):
|
||||
with io.open(fn, encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
newc = re.sub(u'(?P<copyright>Copyright © 2006-)(?P<year>[0-9]{4})', u'Copyright © 2006-' + year, content)
|
||||
if content != newc:
|
||||
tmpFn = fn + '.part'
|
||||
with io.open(tmpFn, 'wt', encoding='utf-8') as outf:
|
||||
outf.write(newc)
|
||||
os.rename(tmpFn, fn)
|
@ -1,27 +0,0 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
import rsa
|
||||
import json
|
||||
from binascii import hexlify
|
||||
|
||||
# TODO path discovery
|
||||
versions_info = json.load(open('versions.json'))
|
||||
if 'signature' in versions_info:
|
||||
del versions_info['signature']
|
||||
|
||||
|
||||
print('Enter the PKCS1 private key, followed by a blank line:')
|
||||
privkey = ''
|
||||
while True:
|
||||
try:
|
||||
line = input()
|
||||
except EOFError:
|
||||
break
|
||||
if line == '':
|
||||
break
|
||||
privkey += line + '\n'
|
||||
privkey = bytes(privkey, 'ascii')
|
||||
privkey = rsa.PrivateKey.load_pkcs1(privkey)
|
||||
|
||||
signature = hexlify(rsa.pkcs1.sign(json.dumps(versions_info, sort_keys=True).encode('utf-8'), privkey, 'SHA-256'))
|
||||
print('signature: ' + signature.decode())
|
Loading…
Reference in New Issue
Block a user