1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 20:12:53 -05:00

[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
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')