]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/gfycat.py
[ie/tenplay] Add support for seasons (#7939)
[yt-dlp.git] / yt_dlp / extractor / gfycat.py
index 60f06ccd78cedbe172fae424a013691ca4123ed6..edc2e56e447328831936c568ff1e8e2d7a580e35 100644 (file)
@@ -1,5 +1,3 @@
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     int_or_none,
@@ -11,6 +9,7 @@
 
 class GfycatIE(InfoExtractor):
     _VALID_URL = r'https?://(?:(?:www|giant|thumbs)\.)?gfycat\.com/(?i:ru/|ifr/|gifs/detail/)?(?P<id>[^-/?#\."\']+)'
+    _EMBED_REGEX = [rf'<(?:iframe|source)[^>]+\bsrc=["\'](?P<url>{_VALID_URL})']
     _TESTS = [{
         'url': 'http://gfycat.com/DeadlyDecisiveGermanpinscher',
         'info_dict': {
@@ -82,14 +81,6 @@ class GfycatIE(InfoExtractor):
         'only_matching': True
     }]
 
-    @staticmethod
-    def _extract_urls(webpage):
-        return [
-            mobj.group('url')
-            for mobj in re.finditer(
-                r'<(?:iframe|source)[^>]+\bsrc=["\'](?P<url>%s)' % GfycatIE._VALID_URL,
-                webpage)]
-
     def _real_extract(self, url):
         video_id = self._match_id(url)
 
@@ -136,7 +127,6 @@ def _real_extract(self, url):
                 'filesize': filesize,
                 'quality': quality(format_id),
             })
-        self._sort_formats(formats)
 
         return {
             'id': video_id,