[extractor] Use classmethod/property where possible

and refactor lazy extractors accordingly.

This reduces the need to create extractor instances
This commit is contained in:
pukkandan 2022-05-11 21:24:44 +05:30
parent 7ddbf09c25
commit 82d020804d
No known key found for this signature in database
GPG key ID: 7EEE9E1E817D0A39
11 changed files with 188 additions and 167 deletions

View file

@ -5,7 +5,7 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from yt_dlp.extractor import list_extractors
from yt_dlp.extractor import list_extractor_classes
def main():
@ -14,7 +14,7 @@ def main():
if len(args) != 1:
parser.error('Expected an output filename')
out = '\n'.join(ie.description() for ie in list_extractors(None) if ie.IE_DESC is not False)
out = '\n'.join(ie.description() for ie in list_extractor_classes() if ie.IE_DESC is not False)
with open(args[0], 'w', encoding='utf-8') as outf:
outf.write(f'# Supported sites\n{out}\n')