]>
Commit | Line | Data |
---|---|---|
69100808 | 1 | #!/usr/bin/env python3 |
dcddc10a | 2 | from __future__ import unicode_literals |
69100808 JMF |
3 | |
4 | import sys | |
5 | import os | |
6 | import textwrap | |
7 | ||
8 | # We must be able to import youtube_dl | |
95240b80 | 9 | sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) |
69100808 JMF |
10 | |
11 | import youtube_dl | |
12 | ||
5f6a1245 | 13 | |
69100808 JMF |
14 | def main(): |
15 | with open('supportedsites.html.in', 'r', encoding='utf-8') as tmplf: | |
16 | template = tmplf.read() | |
17 | ||
18 | ie_htmls = [] | |
2bad0e5d | 19 | for ie in youtube_dl.list_extractors(age_limit=None): |
69100808 | 20 | ie_html = '<b>{}</b>'.format(ie.IE_NAME) |
4193a453 JMF |
21 | ie_desc = getattr(ie, 'IE_DESC', None) |
22 | if ie_desc is False: | |
23 | continue | |
24 | elif ie_desc is not None: | |
69100808 | 25 | ie_html += ': {}'.format(ie.IE_DESC) |
b74e86f4 | 26 | if not ie.working(): |
69100808 JMF |
27 | ie_html += ' (Currently broken)' |
28 | ie_htmls.append('<li>{}</li>'.format(ie_html)) | |
29 | ||
30 | template = template.replace('@SITES@', textwrap.indent('\n'.join(ie_htmls), '\t')) | |
31 | ||
32 | with open('supportedsites.html', 'w', encoding='utf-8') as sitesf: | |
33 | sitesf.write(template) | |
34 | ||
35 | if __name__ == '__main__': | |
36 | main() |