logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

make_contributing.py (720B)


  1. #!/usr/bin/env python
  2. from __future__ import unicode_literals
  3. import optparse
  4. import re
  5. from utils import read_file, write_file
  6. def main():
  7. parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
  8. options, args = parser.parse_args()
  9. if len(args) != 2:
  10. parser.error('Expected an input and an output filename')
  11. infile, outfile = args
  12. readme = read_file(infile)
  13. bug_text = re.search(
  14. r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
  15. dev_text = re.search(
  16. r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL',
  17. readme).group(1)
  18. out = bug_text + dev_text
  19. write_file(outfile, out)
  20. if __name__ == '__main__':
  21. main()