mirror of https://github.com/yt-dlp/yt-dlp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
11 years ago
|
#!/usr/bin/env python3
|
||
10 years ago
|
from __future__ import unicode_literals
|
||
11 years ago
|
|
||
|
import sys
|
||
|
import os
|
||
|
import textwrap
|
||
|
|
||
4 years ago
|
# We must be able to import yt_dlp
|
||
9 years ago
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||
11 years ago
|
|
||
4 years ago
|
import yt_dlp
|
||
11 years ago
|
|
||
10 years ago
|
|
||
11 years ago
|
def main():
|
||
|
with open('supportedsites.html.in', 'r', encoding='utf-8') as tmplf:
|
||
|
template = tmplf.read()
|
||
|
|
||
|
ie_htmls = []
|
||
4 years ago
|
for ie in yt_dlp.list_extractors(age_limit=None):
|
||
11 years ago
|
ie_html = '<b>{}</b>'.format(ie.IE_NAME)
|
||
11 years ago
|
ie_desc = getattr(ie, 'IE_DESC', None)
|
||
|
if ie_desc is False:
|
||
|
continue
|
||
|
elif ie_desc is not None:
|
||
11 years ago
|
ie_html += ': {}'.format(ie.IE_DESC)
|
||
10 years ago
|
if not ie.working():
|
||
11 years ago
|
ie_html += ' (Currently broken)'
|
||
|
ie_htmls.append('<li>{}</li>'.format(ie_html))
|
||
|
|
||
|
template = template.replace('@SITES@', textwrap.indent('\n'.join(ie_htmls), '\t'))
|
||
|
|
||
|
with open('supportedsites.html', 'w', encoding='utf-8') as sitesf:
|
||
|
sitesf.write(template)
|
||
|
|
||
8 years ago
|
|
||
11 years ago
|
if __name__ == '__main__':
|
||
|
main()
|