]> jfr.im git - yt-dlp.git/blame - devscripts/gh-pages/update-sites.py
[gorillavid] Update IE_DESC
[yt-dlp.git] / devscripts / gh-pages / update-sites.py
CommitLineData
69100808
JMF
1#!/usr/bin/env python3
2
3import sys
4import os
5import textwrap
6
7# We must be able to import youtube_dl
8sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
9
10import youtube_dl
11
5f6a1245 12
69100808
JMF
13def main():
14 with open('supportedsites.html.in', 'r', encoding='utf-8') as tmplf:
15 template = tmplf.read()
16
17 ie_htmls = []
22c8b525 18 for ie in sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower()):
69100808 19 ie_html = '<b>{}</b>'.format(ie.IE_NAME)
4193a453
JMF
20 ie_desc = getattr(ie, 'IE_DESC', None)
21 if ie_desc is False:
22 continue
23 elif ie_desc is not None:
69100808 24 ie_html += ': {}'.format(ie.IE_DESC)
b74e86f4 25 if not ie.working():
69100808
JMF
26 ie_html += ' (Currently broken)'
27 ie_htmls.append('<li>{}</li>'.format(ie_html))
28
29 template = template.replace('@SITES@', textwrap.indent('\n'.join(ie_htmls), '\t'))
30
31 with open('supportedsites.html', 'w', encoding='utf-8') as sitesf:
32 sitesf.write(template)
33
34if __name__ == '__main__':
35 main()