Rapsys Git
/
youtubedl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'upstream/2014.06.07'
[youtubedl]
/
devscripts
/
gh-pages
/
add-version.py
diff --git
a/devscripts/gh-pages/add-version.py
b/devscripts/gh-pages/add-version.py
index 116420ef2f0e4561a07ce558590088b418872179..35865b2f30f9526f4a05b4bad594f078f5a56443 100755
(executable)
--- 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 json
import sys
import hashlib
-import urllib.request
+import os.path
+
if len(sys.argv) <= 1:
print('Specify the version number as parameter')
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}
'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():
for key, filename in filenames.items():
- print('Downloading and checksumming %s...' % filename)
url = 'https://yt-dl.org/downloads/%s/%s' % (version, 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)
sha256sum = hashlib.sha256(data).hexdigest()
new_version[key] = (url, sha256sum)