mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-09 08:30:11 +08:00
changed md5 to sha256
This commit is contained in:
parent
d83fe1f86a
commit
76bfb7fa21
@ -56,9 +56,9 @@ class YoutubeDL(youtube_dl.YoutubeDL):
|
|||||||
return super(YoutubeDL, self).process_info(info_dict)
|
return super(YoutubeDL, self).process_info(info_dict)
|
||||||
|
|
||||||
|
|
||||||
def _file_md5(fn):
|
def _file_sha256(fn):
|
||||||
with open(fn, 'rb') as f:
|
with open(fn, 'rb') as f:
|
||||||
return hashlib.md5(f.read()).hexdigest()
|
return hashlib.sha256(f.read()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
defs = gettestcases()
|
defs = gettestcases()
|
||||||
@ -223,9 +223,9 @@ def generator(test_case, tname):
|
|||||||
'Expected %s to be at least %s, but it\'s only %s ' %
|
'Expected %s to be at least %s, but it\'s only %s ' %
|
||||||
(tc_filename, format_bytes(expected_minsize),
|
(tc_filename, format_bytes(expected_minsize),
|
||||||
format_bytes(got_fsize)))
|
format_bytes(got_fsize)))
|
||||||
if 'md5' in tc:
|
if 'sha256' in tc:
|
||||||
md5_for_file = _file_md5(tc_filename)
|
sha256_for_file = _file_sha256(tc_filename)
|
||||||
self.assertEqual(tc['md5'], md5_for_file)
|
self.assertEqual(tc['sha256'], sha256_for_file)
|
||||||
# Finally, check test cases' data again but this time against
|
# Finally, check test cases' data again but this time against
|
||||||
# extracted data from info JSON file written during processing
|
# extracted data from info JSON file written during processing
|
||||||
info_json_fn = os.path.splitext(tc_filename)[0] + '.info.json'
|
info_json_fn = os.path.splitext(tc_filename)[0] + '.info.json'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user