Release 2024.11.18
[yt-dlp3.git] / devscripts / make_contributing.py
bloba06f8a616e826ab51a32d7d9c76411ff13bc7fc6
1 #!/usr/bin/env python3
3 import optparse
4 import re
7 def main():
8 return # This is unused in yt-dlp
10 parser = optparse.OptionParser(usage='%prog INFILE OUTFILE')
11 options, args = parser.parse_args()
12 if len(args) != 2:
13 parser.error('Expected an input and an output filename')
15 infile, outfile = args
17 with open(infile, encoding='utf-8') as inf:
18 readme = inf.read()
20 bug_text = re.search(
21 r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
22 dev_text = re.search(
23 r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING yt-dlp', readme).group(1)
25 out = bug_text + dev_text
27 with open(outfile, 'w', encoding='utf-8') as outf:
28 outf.write(out)
31 if __name__ == '__main__':
32 main()