[youtube] Fix lazy extractors (closes #28780)
authorSergey M․ <dstftw@gmail.com>
Tue, 20 Apr 2021 20:56:04 +0000 (03:56 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 20 Apr 2021 20:56:04 +0000 (03:56 +0700)
youtube_dl/extractor/youtube.py

index 75751d5a6a879bd50c89089335a33a433d9eb0a4..c16dc7ab8b076e7f661957ddf78283e2172cbe6d 100644 (file)
@@ -1219,6 +1219,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
 
     @classmethod
     def suitable(cls, url):
+        # Hack for lazy extractors until more generic solution is implemented
+        # (see #28780)
+        from .youtube import parse_qs
         qs = parse_qs(url)
         if qs.get('list', [None])[0]:
             return False
@@ -2910,6 +2913,9 @@ class YoutubePlaylistIE(InfoExtractor):
     def suitable(cls, url):
         if YoutubeTabIE.suitable(url):
             return False
+        # Hack for lazy extractors until more generic solution is implemented
+        # (see #28780)
+        from .youtube import parse_qs
         qs = parse_qs(url)
         if qs.get('v', [None])[0]:
             return False