You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
646 B

  1. #!/usr/bin/env python
  2. import hashlib
  3. import subprocess
  4. template = file('index.html.in', 'r').read()
  5. version = subprocess.Popen(['./youtube-dl', '--version'], stdout=subprocess.PIPE).communicate()[0].strip()
  6. data = file('youtube-dl', 'rb').read()
  7. md5sum = hashlib.md5(data).hexdigest()
  8. sha1sum = hashlib.sha1(data).hexdigest()
  9. sha256sum = hashlib.sha256(data).hexdigest()
  10. template = template.replace('@PROGRAM_VERSION@', version)
  11. template = template.replace('@PROGRAM_MD5SUM@', md5sum)
  12. template = template.replace('@PROGRAM_SHA1SUM@', sha1sum)
  13. template = template.replace('@PROGRAM_SHA256SUM@', sha256sum)
  14. file('index.html', 'w').write(template)