Browse Source

Do not re-download files for hashsum generation (Fixes #1383)

rtmp_test
Philipp Hagemeister 11 years ago
parent
commit
1d213233cd
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      devscripts/gh-pages/add-version.py

+ 6
- 3
devscripts/gh-pages/add-version.py View File

@ -23,10 +23,13 @@ filenames = {
'bin': 'youtube-dl', 'bin': 'youtube-dl',
'exe': 'youtube-dl.exe', 'exe': 'youtube-dl.exe',
'tar': 'youtube-dl-%s.tar.gz' % version} '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)
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() sha256sum = hashlib.sha256(data).hexdigest()
new_version[key] = (url, sha256sum) new_version[key] = (url, sha256sum)


Loading…
Cancel
Save