]> jfr.im git - yt-dlp.git/blobdiff - devscripts/make_supportedsites.py
[cleanup] Add keyword automatically to SearchIE descriptions
[yt-dlp.git] / devscripts / make_supportedsites.py
index 8cb4a46380253643e6df2370058c433094cf159b..4c11e25f28d32f3da3ad94e64b575ca349704513 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import unicode_literals
 
 import io
@@ -7,10 +7,10 @@
 import sys
 
 
-# Import youtube_dl
+# Import yt_dlp
 ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
 sys.path.insert(0, ROOT_DIR)
-import youtube_dl
+import yt_dlp
 
 
 def main():
@@ -29,11 +29,14 @@ def gen_ies_md(ies):
                 continue
             if ie_desc is not None:
                 ie_md += ': {0}'.format(ie.IE_DESC)
+            search_key = getattr(ie, 'SEARCH_KEY', None)
+            if search_key is not None:
+                ie_md += f'; "{ie.SEARCH_KEY}:" prefix'
             if not ie.working():
                 ie_md += ' (Currently broken)'
             yield ie_md
 
-    ies = sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower())
+    ies = sorted(yt_dlp.gen_extractors(), key=lambda i: i.IE_NAME.lower())
     out = '# Supported sites\n' + ''.join(
         ' - ' + md + '\n'
         for md in gen_ies_md(ies))
@@ -41,5 +44,6 @@ def gen_ies_md(ies):
     with io.open(outfile, 'w', encoding='utf-8') as outf:
         outf.write(out)
 
+
 if __name__ == '__main__':
     main()