From 7aeb67b39b055e9586e7ab21c108a3176cfe0203 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sergey=20M=E2=80=A4?= Date: Thu, 3 Jul 2014 21:08:44 +0700 Subject: [PATCH] [teachertube:user:collection] Update media regex --- youtube_dl/extractor/teachertube.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/teachertube.py b/youtube_dl/extractor/teachertube.py index 1a438e1e4..7167a036e 100644 --- a/youtube_dl/extractor/teachertube.py +++ b/youtube_dl/extractor/teachertube.py @@ -92,23 +92,21 @@ class TeacherTubeUserIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?teachertube\.com/(user/profile|collection)/(?P[0-9a-zA-Z]+)/?' + _MEDIA_RE = r'(?s)"sidebar_thumb_time">[0-9:]+.+?' + def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) user_id = mobj.group('user') urls = [] webpage = self._download_webpage(url, user_id) - urls.extend(re.findall( - r'"sidebar_thumb_time">[0-9:]+\s+', - webpage)) + urls.extend(re.findall(self._MEDIA_RE, webpage)) pages = re.findall(r'/ajax-user/user-videos/%s\?page=([0-9]+)' % user_id, webpage)[1:-1] for p in pages: more = 'http://www.teachertube.com/ajax-user/user-videos/%s?page=%s' % (user_id, p) webpage = self._download_webpage(more, user_id, 'Downloading page %s/%s' % (p, len(pages) + 1)) - urls.extend(re.findall( - r'"sidebar_thumb_time">[0-9:]+\s+', - webpage)) + urls.extend(re.findall(self._MEDIA_RE, webpage)) entries = [] for url in urls: -- 2.22.2