]>
Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/gh-pages/add-version.py
35865b2f30f9526f4a05b4bad594f078f5a56443
10 print('Specify the version number as parameter')
14 with open('update/LATEST_VERSION', 'w') as f
:
17 versions_info
= json
.load(open('update/versions.json'))
18 if 'signature' in versions_info
:
19 del versions_info
['signature']
25 'exe': 'youtube-dl.exe',
26 'tar': 'youtube-dl-%s.tar.gz' % version
}
27 build_dir
= os
.path
.join('..', '..', 'build', version
)
28 for key
, filename
in filenames
.items():
29 url
= 'https://yt-dl.org/downloads/%s/%s' % (version
, filename
)
30 fn
= os
.path
.join(build_dir
, filename
)
31 with open(fn
, 'rb') as f
:
34 raise ValueError('File %s is empty!' % fn
)
35 sha256sum
= hashlib
.sha256(data
).hexdigest()
36 new_version
[key
] = (url
, sha256sum
)
38 versions_info
['versions'][version
] = new_version
39 versions_info
['latest'] = version
41 with open('update/versions.json', 'w') as jsonf
:
42 json
.dump(versions_info
, jsonf
, indent
=4, sort_keys
=True)