[joj] Relax _VALID_URL (closes #16771)

This commit is contained in:
Sergey M․ 2018-06-24 23:57:22 +07:00
parent 74caf528bc
commit a0949fec08
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -18,7 +18,7 @@ class JojIE(InfoExtractor):
joj:| joj:|
https?://media\.joj\.sk/embed/ https?://media\.joj\.sk/embed/
) )
(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}) (?P<id>[^/?#^]+)
''' '''
_TESTS = [{ _TESTS = [{
'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932', 'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932',
@ -29,16 +29,24 @@ class JojIE(InfoExtractor):
'thumbnail': r're:^https?://.*\.jpg$', 'thumbnail': r're:^https?://.*\.jpg$',
'duration': 3118, 'duration': 3118,
} }
}, {
'url': 'https://media.joj.sk/embed/9i1cxv',
'only_matching': True,
}, { }, {
'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932', 'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932',
'only_matching': True, 'only_matching': True,
}, {
'url': 'joj:9i1cxv',
'only_matching': True,
}] }]
@staticmethod @staticmethod
def _extract_urls(webpage): def _extract_urls(webpage):
return re.findall( return [
r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//media\.joj\.sk/embed/[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})', mobj.group('url')
webpage) for mobj in re.finditer(
r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1',
webpage)]
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)