X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fwat.py;h=5227bb5ad9a2cd4f71c156cd8ca9bb3f5fbd5d17;hb=b969d12490a4c618ee65b5731084db4c95209af8;hp=268e2f6183405117b7fd10f6037857fa6ce8cf10;hpb=c6e90caaa661e8368f099055c609c7c121bbbc2b;p=youtube-dl diff --git a/youtube_dl/extractor/wat.py b/youtube_dl/extractor/wat.py index 268e2f618..5227bb5ad 100644 --- a/youtube_dl/extractor/wat.py +++ b/youtube_dl/extractor/wat.py @@ -12,7 +12,7 @@ from ..utils import ( class WatIE(InfoExtractor): - _VALID_URL = r'http://www\.wat\.tv/video/(?P.*)-(?P.*?)_.*?\.html' + _VALID_URL = r'(?:wat:(?P\d{8})|https?://www\.wat\.tv/video/(?P.*)-(?P.*?)_.*?\.html)' IE_NAME = 'wat.tv' _TESTS = [ { @@ -40,6 +40,7 @@ class WatIE(InfoExtractor): 'upload_date': '20140816', 'duration': 2910, }, + 'skip': "Ce contenu n'est pas disponible pour l'instant.", }, ] @@ -53,10 +54,12 @@ class WatIE(InfoExtractor): def real_id_for_chapter(chapter): return chapter['tc_start'].split('-')[0] mobj = re.match(self._VALID_URL, url) - short_id = mobj.group('short_id') display_id = mobj.group('display_id') - webpage = self._download_webpage(url, display_id or short_id) - real_id = self._search_regex(r'xtpage = ".*-(.*?)";', webpage, 'real id') + real_id = mobj.group('real_id') + if not real_id: + short_id = mobj.group('short_id') + webpage = self._download_webpage(url, display_id or short_id) + real_id = self._search_regex(r'xtpage = ".*-(.*?)";', webpage, 'real id') video_info = self.download_video_info(real_id) @@ -112,7 +115,7 @@ class WatIE(InfoExtractor): video_url = self._download_webpage( 'http://www.wat.tv/get%s?token=%s&getURL=1&country=%s' % (webid, compute_token(webid), country), real_id, - 'Downloding %s video URL' % fmt[0], + 'Downloading %s video URL' % fmt[0], 'Failed to download %s video URL' % fmt[0], False) if not video_url: