diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-09-06 10:51:53 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-09-06 10:51:53 +0200 |
commit | 1d213233cdb788c6b323a6b056f215789fe30f13 (patch) | |
tree | 43621e8e03609099907527fb9a1a9cd067892bab /devscripts/gh-pages/add-version.py | |
parent | 0638ad9999e7c374b253d0e13f4e3a20ef0b1171 (diff) |
Do not re-download files for hashsum generation (Fixes #1383)
Diffstat (limited to 'devscripts/gh-pages/add-version.py')
-rwxr-xr-x | devscripts/gh-pages/add-version.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/devscripts/gh-pages/add-version.py b/devscripts/gh-pages/add-version.py index 116420ef2..03733c35d 100755 --- a/devscripts/gh-pages/add-version.py +++ b/devscripts/gh-pages/add-version.py @@ -23,10 +23,13 @@ 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) |