aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-01-08 05:11:23 +0600
committerSergey M․ <dstftw@gmail.com>2016-01-08 05:11:23 +0600
commit4cf096a4a99c2cc29708f23244e4433d91c83b65 (patch)
treed32cdf70e2163431e5528baeb67749be00873f43 /youtube_dl
parent18e6c97c48f883911649d9b3d64127379a8b1df4 (diff)
[ivideon] Add support for map bound URLs
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/ivideon.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/youtube_dl/extractor/ivideon.py b/youtube_dl/extractor/ivideon.py
index aa05f5413..617dc8c07 100644
--- a/youtube_dl/extractor/ivideon.py
+++ b/youtube_dl/extractor/ivideon.py
@@ -4,14 +4,17 @@ from __future__ import unicode_literals
import re
from .common import InfoExtractor
-from ..compat import compat_urllib_parse
+from ..compat import (
+ compat_urllib_parse,
+ compat_urlparse,
+)
from ..utils import qualities
class IvideonIE(InfoExtractor):
IE_NAME = 'ivideon'
IE_DESC = 'Ivideon TV'
- _VALID_URL = r'https?://(?:www\.)?ivideon\.com/tv/camera/(?P<id>\d+-[\da-f]+)/(?P<camera_id>\d+)'
+ _VALID_URL = r'https?://(?:www\.)?ivideon\.com/tv/(?:[^/]+/)*camera/(?P<id>\d+-[\da-f]+)/(?P<camera_id>\d+)'
_TESTS = [{
'url': 'https://www.ivideon.com/tv/camera/100-916ca13b5c4ad9f564266424a026386d/0/',
'info_dict': {
@@ -27,6 +30,9 @@ class IvideonIE(InfoExtractor):
}, {
'url': 'https://www.ivideon.com/tv/camera/100-c4ee4cb9ede885cf62dfbe93d7b53783/589824/?lang=ru',
'only_matching': True,
+ }, {
+ 'url': 'https://www.ivideon.com/tv/map/22.917923/-31.816406/16/camera/100-e7bc16c7d4b5bbd633fd5350b66dfa9a/0',
+ 'only_matching': True,
}]
_QUALITIES = ('low', 'mid', 'hi')
@@ -35,8 +41,10 @@ class IvideonIE(InfoExtractor):
mobj = re.match(self._VALID_URL, url)
server_id, camera_id = mobj.group('id'), mobj.group('camera_id')
camera_name, description = None, None
+ camera_url = compat_urlparse.urljoin(
+ url, '/tv/camera/%s/%s/' % (server_id, camera_id))
- webpage = self._download_webpage(url, server_id, fatal=False)
+ webpage = self._download_webpage(camera_url, server_id, fatal=False)
if webpage:
config_string = self._search_regex(
r'var\s+config\s*=\s*({.+?});', webpage, 'config', default=None)