]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/env python3 | |
2 | ||
3 | # Allow direct execution | |
4 | import os | |
5 | import sys | |
6 | ||
7 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
8 | ||
9 | ||
10 | import optparse | |
11 | ||
12 | from yt_dlp.extractor import list_extractor_classes | |
13 | ||
14 | ||
15 | def main(): | |
16 | parser = optparse.OptionParser(usage='%prog OUTFILE.md') | |
17 | _, args = parser.parse_args() | |
18 | if len(args) != 1: | |
19 | parser.error('Expected an output filename') | |
20 | ||
21 | out = '\n'.join(ie.description() for ie in list_extractor_classes() if ie.IE_DESC is not False) | |
22 | ||
23 | with open(args[0], 'w', encoding='utf-8') as outf: | |
24 | outf.write(f'# Supported sites\n{out}\n') | |
25 | ||
26 | ||
27 | if __name__ == '__main__': | |
28 | main() |