From 77d682da9dc2e62a1505cccb77408b8fa638a7f1 Mon Sep 17 00:00:00 2001 From: vobe Date: Fri, 19 May 2017 20:18:03 +0200 Subject: [PATCH] [toypics] Fix extraction --- youtube_dl/extractor/toypics.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/toypics.py b/youtube_dl/extractor/toypics.py index 938e05076..774fa565c 100644 --- a/youtube_dl/extractor/toypics.py +++ b/youtube_dl/extractor/toypics.py @@ -24,15 +24,16 @@ class ToypicsIE(InfoExtractor): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') page = self._download_webpage(url, video_id) - video_url = self._html_search_regex( - r'src:\s+"(http://static[0-9]+\.toypics\.net/flvideo/[^"]+)"', page, 'video URL') - title = self._html_search_regex( - r'Toypics - ([^<]+)', page, 'title') + formats = self._parse_html5_media_entries(url, page, video_id)[0]['formats'] + title = self._html_search_regex([ + r']+class=["\']view-video-title[^>]+>([^<]+)([^<]+) - Toypics', + ], page, 'title') username = self._html_search_regex( - r'toypics.net/([^/"]+)" class="user-name">', page, 'username') + r'More videos from ([^<]+)', page, 'username') return { 'id': video_id, - 'url': video_url, + 'formats': formats, 'title': title, 'uploader': username, 'age_limit': 18, @@ -71,7 +72,7 @@ class ToypicsUserIE(InfoExtractor): note='Downloading page %d/%d' % (n, page_count)) urls.extend( re.findall( - r'

\s+', + r']+class=["\']preview[^>]+>\s*]+href="(https?://videos.toypics.net/view/[^"]+)"', lpage)) return {