diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-23 00:49:23 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-23 01:04:29 +0530 |
commit | 3fb4e21b38063d22b421e45b9bb24f707654c111 (patch) | |
tree | 30f24043b778949cd3d1825b44b23db8a6cb4583 /yt_dlp/extractor/common.py | |
parent | 4dfbf8696b0c614eee480b44a86959b9a055fb97 (diff) | |
download | hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.tar.lz hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.tar.xz hypervideo-pre-3fb4e21b38063d22b421e45b9bb24f707654c111.zip |
[lazy_extractors] Fix `suitable` and add flake8 test
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 31356111b..734651193 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -458,6 +458,8 @@ class InfoExtractor(object): @classmethod def suitable(cls, url): """Receives a URL and returns True if suitable for this IE.""" + # This function must import everything it needs (except other extractors), + # so that lazy_extractors works correctly return cls._match_valid_url(url) is not None @classmethod @@ -622,7 +624,7 @@ class InfoExtractor(object): @classmethod def ie_key(cls): """A string for getting the InfoExtractor with get_info_extractor""" - return compat_str(cls.__name__[:-2]) + return cls.__name__[:-2] @property def IE_NAME(self): |