mirror of
https://gitlab.com/dstftw/youtube-dl.git
synced 2020-11-16 09:42:26 +00:00
Update generate-download
This commit is contained in:
parent
463fe92d26
commit
ac47cfe369
|
@ -1,21 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
import hashlib
|
||||
import subprocess
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
# Run command line and get output
|
||||
def output(cmdline):
|
||||
p = subprocess.Popen(cmdline, shell=True, stdout=subprocess.PIPE)
|
||||
retval = p.communicate()[0]
|
||||
p.wait()
|
||||
return retval
|
||||
youtubeDlDir = os.path.join(os.path.dirname(__file__), '..', 'youtube-dl')
|
||||
|
||||
# Read template page
|
||||
template = file('download.html.in', 'r').read()
|
||||
|
||||
# Build replacement strings
|
||||
version = output('cd ../master && git tag | tail -1').strip()
|
||||
data = output('cd ../master && git show %s:youtube-dl' % version)
|
||||
version = subprocess.check_output([os.path.join(youtubeDlDir, 'youtube-dl'), '--version']).strip()
|
||||
data = subprocess.check_output(['git', 'show', '%s:youtube-dl' % version], cwd=youtubeDlDir)
|
||||
url = 'https://github.com/rg3/youtube-dl/raw/%s/youtube-dl' % version
|
||||
md5sum = hashlib.md5(data).hexdigest()
|
||||
sha1sum = hashlib.sha1(data).hexdigest()
|
||||
|
|
Loading…
Reference in a new issue