From df8f53f752c0f01577dcc5d63c6d9a81d924770b Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Sun, 21 Sep 2014 16:32:38 +0200 Subject: [PATCH] [thvideo] Support mobile URLs as well --- youtube_dl/extractor/thvideo.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/thvideo.py b/youtube_dl/extractor/thvideo.py index 9fa14d3c4..607e947bb 100644 --- a/youtube_dl/extractor/thvideo.py +++ b/youtube_dl/extractor/thvideo.py @@ -10,7 +10,7 @@ from ..utils import ( class THVideoIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?thvideo\.tv/v/th(?P[0-9]+)' + _VALID_URL = r'http://(?:www\.)?thvideo\.tv/(?:v/th|mobile\.php\?cid=)(?P[0-9]+)' _TEST = { 'url': 'http://thvideo.tv/v/th1987/', 'md5': 'fa107b1f73817e325e9433505a70db50', @@ -30,18 +30,22 @@ class THVideoIE(InfoExtractor): video_id = mobj.group('id') # extract download link from mobile player page - webpage_player = self._download_webpage('http://thvideo.tv/mobile.php?cid=%s-0' % video_id, video_id) - video_url = self._html_search_regex(r'', webpage, - 'upload date', fatal=False) - upload_date = unified_strdate(upload_date_raw) + upload_date = unified_strdate(self._html_search_regex( + r'span itemprop="datePublished" content="(.*?)">', webpage, + 'upload date', fatal=False)) return { 'id': video_id, @@ -52,4 +56,4 @@ class THVideoIE(InfoExtractor): 'thumbnail': thumbnail, 'description': description, 'upload_date': upload_date - } \ No newline at end of file + }