1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[vk.com] Simplified the page_id acquisition by using the id matched in the URL earlier on.

This commit is contained in:
Will Sewell 2014-11-21 23:21:03 +00:00
parent e1e8b6897b
commit 021a0db8f7

View file

@ -218,13 +218,7 @@ class VKUserVideosIE(InfoExtractor):
} }
def _real_extract(self, url): def _real_extract(self, url):
# Extract page id page_id = self._match_id(url)
mobj = re.match(self._VALID_URL, url)
if mobj is None:
raise ExtractorError('Invalid URL: %s' % url)
# Download page and get video ids
page_id = mobj.group(1)
page = self._download_webpage(url, page_id) page = self._download_webpage(url, page_id)
video_ids = orderedSet(m.group(1) for m in re.finditer(r'href="/video([0-9_]+)"', page)) video_ids = orderedSet(m.group(1) for m in re.finditer(r'href="/video([0-9_]+)"', page))