[tf1] reintroduce old wat id pattern
This commit is contained in:
parent
6e6151aa5e
commit
77d6e33ac6
@ -3,6 +3,9 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
from youtube_dl.utils import (
|
||||||
|
RegexNotFoundError,
|
||||||
|
)
|
||||||
|
|
||||||
class TF1IE(InfoExtractor):
|
class TF1IE(InfoExtractor):
|
||||||
"""TF1 uses the wat.tv player."""
|
"""TF1 uses the wat.tv player."""
|
||||||
@ -61,7 +64,13 @@ class TF1IE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
wat_id = self._html_search_regex(
|
try:
|
||||||
r'\bstreamId\W+(?P<id>\d+)',
|
wat_id = self._html_search_regex(
|
||||||
webpage, 'wat id', group='id')
|
# the old pattern. Should no longer work as of 2019-06-12
|
||||||
|
r'(["\'])(?:https?:)?//www\.wat\.tv/embedframe/.*?(?P<id>\d{8})\1',
|
||||||
|
webpage, 'wat id', group='id')
|
||||||
|
except RegexNotFoundError:
|
||||||
|
wat_id = self._html_search_regex(
|
||||||
|
r'\bstreamId\W+(?P<id>\d+)',
|
||||||
|
webpage, 'wat id', group='id')
|
||||||
return self.url_result('wat:%s' % wat_id, 'Wat')
|
return self.url_result('wat:%s' % wat_id, 'Wat')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user