[tf1] reintroduce old wat id pattern

This commit is contained in:
Emmanuel Froissart 2019-06-12 14:50:45 +02:00
parent 6e6151aa5e
commit 77d6e33ac6

View File

@ -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,6 +64,12 @@ 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)
try:
wat_id = self._html_search_regex(
# 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( wat_id = self._html_search_regex(
r'\bstreamId\W+(?P<id>\d+)', r'\bstreamId\W+(?P<id>\d+)',
webpage, 'wat id', group='id') webpage, 'wat id', group='id')