about summary refs log tree commit diff
path: root/youtube_dl/extractor/viceland.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2017-05-05 20:01:02 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2017-05-05 20:01:02 +0800
commitcc7bda4fffa3913178e5ad345a8c9c6d1d8a2626 (patch)
treef060704dfce9aee871e36d11dfe2f0437c3e1f41 /youtube_dl/extractor/viceland.py
parent50ad078b7bca28ec4a85caf7689e3a260def2189 (diff)
downloadyoutube-dl-cc7bda4fffa3913178e5ad345a8c9c6d1d8a2626.tar.gz
youtube-dl-cc7bda4fffa3913178e5ad345a8c9c6d1d8a2626.tar.xz
youtube-dl-cc7bda4fffa3913178e5ad345a8c9c6d1d8a2626.zip
[vice] Fix extraction for non en_us videos (closes #12967)
Diffstat (limited to 'youtube_dl/extractor/viceland.py')
-rw-r--r--youtube_dl/extractor/viceland.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/youtube_dl/extractor/viceland.py b/youtube_dl/extractor/viceland.py
index 87f9216b5..bd60235c8 100644
--- a/youtube_dl/extractor/viceland.py
+++ b/youtube_dl/extractor/viceland.py
@@ -1,11 +1,13 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
+import re
+
 from .vice import ViceBaseIE
 
 
 class VicelandIE(ViceBaseIE):
-    _VALID_URL = r'https?://(?:www\.)?viceland\.com/[^/]+/video/[^/]+/(?P<id>[a-f0-9]+)'
+    _VALID_URL = r'https?://(?:www\.)?viceland\.com/(?P<locale>[^/]+)/video/[^/]+/(?P<id>[a-f0-9]+)'
     _TEST = {
         'url': 'https://www.viceland.com/en_us/video/trapped/588a70d0dba8a16007de7316',
         'info_dict': {
@@ -24,10 +26,13 @@ class VicelandIE(ViceBaseIE):
             'skip_download': True,
         },
         'add_ie': ['UplynkPreplay'],
+        'skip': '404',
     }
     _PREPLAY_HOST = 'www.viceland'
 
     def _real_extract(self, url):
-        video_id = self._match_id(url)
+        mobj = re.match(self._VALID_URL, url)
+        video_id = mobj.group('id')
+        locale = mobj.group('locale')
         webpage = self._download_webpage(url, video_id)
-        return self._extract_preplay_video(url, webpage)
+        return self._extract_preplay_video(url, locale, webpage)