make_supportedsites.py 923 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. # Allow direct execution
  3. import os
  4. import sys
  5. sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  6. from devscripts.utils import get_filename_args, write_file
  7. from yt_dlp.extractor import list_extractor_classes
  8. TEMPLATE = '''\
  9. # Supported sites
  10. Below is a list of all extractors that are currently included with yt-dlp.
  11. If a site is not listed here, it might still be supported by yt-dlp's embed extraction or generic extractor.
  12. Not all sites listed here are guaranteed to work; websites are constantly changing and sometimes this breaks yt-dlp's support for them.
  13. The only reliable way to check if a site is supported is to try it.
  14. {ie_list}
  15. '''
  16. def main():
  17. out = '\n'.join(ie.description() for ie in list_extractor_classes() if ie.IE_DESC is not False)
  18. write_file(get_filename_args(), TEMPLATE.format(ie_list=out))
  19. if __name__ == '__main__':
  20. main()