summaryrefslogtreecommitdiffhomepage
path: root/devscripts/gh-pages
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2013-09-06 10:51:53 +0200
committerPhilipp Hagemeister <[email protected]>2013-09-06 10:51:53 +0200
commit1d213233cdb788c6b323a6b056f215789fe30f13 (patch)
tree43621e8e03609099907527fb9a1a9cd067892bab /devscripts/gh-pages
parent0638ad9999e7c374b253d0e13f4e3a20ef0b1171 (diff)
downloadyoutube-dl-1d213233cdb788c6b323a6b056f215789fe30f13.tar.gz
youtube-dl-1d213233cdb788c6b323a6b056f215789fe30f13.zip
Do not re-download files for hashsum generation (Fixes #1383)
Diffstat (limited to 'devscripts/gh-pages')
-rwxr-xr-xdevscripts/gh-pages/add-version.py9
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)