]> jfr.im git - yt-dlp.git/blame - devscripts/make_contributing.py
[youtube:live] Relax _VALID_URL (closes #11164)
[yt-dlp.git] / devscripts / make_contributing.py
CommitLineData
e56190b3
PH
1#!/usr/bin/env python
2from __future__ import unicode_literals
3
e56190b3 4import io
ccbfaa83 5import optparse
e56190b3
PH
6import re
7
8
9def main():
ccbfaa83
PH
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')
14
15 infile, outfile = args
16
17 with io.open(infile, encoding='utf-8') as inf:
e56190b3
PH
18 readme = inf.read()
19
20 bug_text = re.search(
21 r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1)
22 dev_text = re.search(
13dcfd41
PH
23 r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL',
24 readme).group(1)
e56190b3
PH
25
26 out = bug_text + dev_text
27
ccbfaa83 28 with io.open(outfile, 'w', encoding='utf-8') as outf:
e56190b3
PH
29 outf.write(out)
30
31if __name__ == '__main__':
32 main()