Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tf1] fix wat id extraction (closes ytdl-org#21365) #21372

Closed
wants to merge 9 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion youtube_dl/extractor/tf1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

from .common import InfoExtractor

from youtube_dl.utils import (
RegexNotFoundError,
froiss marked this conversation as resolved.
Show resolved Hide resolved
)

class TF1IE(InfoExtractor):
"""TF1 uses the wat.tv player."""
Expand Down Expand Up @@ -43,12 +46,26 @@ class TF1IE(InfoExtractor):
}, {
'url': 'http://www.tf1.fr/hd1/documentaire/videos/mylene-farmer-d-une-icone.html',
'only_matching': True,
}, {
'url': 'https://www.tf1.fr/tmc/quotidien-avec-yann-barthes/videos/quotidien-premiere-partie-11-juin-2019.html',
'info_dict': {
'id': '13641379',
'ext': 'mp4',
'title': 'Quotidien, première partie du 11 juin 2019',
'description': 'Retrouvez l’intégralité du replay de la première partie de Quotidien du 11 juin. On parle des enfants français rapatriés de Syrie avec Salhia Brakhlia, de la décision du New York Times d’arrêter les dessins politiques avec Lilia Hassaine, on part voir les Bleues à J-1 de leur rencontre avec la ...',
froiss marked this conversation as resolved.
Show resolved Hide resolved
'upload_date': '20190611',
},
'params': {
# Sometimes wat serves the whole file with the --test option
'skip_download': True,
},
}]

def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
wat_id = self._html_search_regex(
r'(["\'])(?:https?:)?//www\.wat\.tv/embedframe/.*?(?P<id>\d{8})\1',
[r'(["\'])(?:https?:)?//www\.wat\.tv/embedframe/.*?(?P<id>\d{8})\1',
r'(["\']?)streamId\1\s*:\s*["\']?(?P<id>\d+)'],
froiss marked this conversation as resolved.
Show resolved Hide resolved
webpage, 'wat id', group='id')
return self.url_result('wat:%s' % wat_id, 'Wat')