about summary refs log tree commit diff
path: root/youtube_dl/extractor/vice.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-20 00:42:25 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-20 00:42:25 +0600
commit18ae46ad4bcf4d427984e85a9feaf647c3f80737 (patch)
treef24c6f7739397a11f5d381d7f7f4a7d889633661 /youtube_dl/extractor/vice.py
parent65c2b21df15053581cac21690605d1f7ac834083 (diff)
downloadyoutube-dl-18ae46ad4bcf4d427984e85a9feaf647c3f80737.tar.gz
youtube-dl-18ae46ad4bcf4d427984e85a9feaf647c3f80737.tar.xz
youtube-dl-18ae46ad4bcf4d427984e85a9feaf647c3f80737.zip
[vice] Modernize
Diffstat (limited to 'youtube_dl/extractor/vice.py')
-rw-r--r--youtube_dl/extractor/vice.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/youtube_dl/extractor/vice.py b/youtube_dl/extractor/vice.py
index ae1faca1c..01af7a995 100644
--- a/youtube_dl/extractor/vice.py
+++ b/youtube_dl/extractor/vice.py
@@ -1,5 +1,4 @@
 from __future__ import unicode_literals
-import re
 
 from .common import InfoExtractor
 from .ooyala import OoyalaIE
@@ -7,7 +6,7 @@ from ..utils import ExtractorError
 
 
 class ViceIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:.+?\.)?vice\.com/.*?/(?P<name>.+)'
+    _VALID_URL = r'https?://(?:.+?\.)?vice\.com/(?:[^/]+/)+(?P<id>.+)'
 
     _TESTS = [
         {
@@ -28,9 +27,8 @@ class ViceIE(InfoExtractor):
     ]
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        name = mobj.group('name')
-        webpage = self._download_webpage(url, name)
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
         try:
             embed_code = self._search_regex(
                 r'embedCode=([^&\'"]+)', webpage,