aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/stretchinternet.py
diff options
context:
space:
mode:
authorAndrew Bottom <abottom@wennsoft.com>2017-10-24 11:50:02 -0500
committerSergey M․ <dstftw@gmail.com>2017-12-09 17:58:49 +0700
commitf4cc03d60b5dd713fb8964cd9ecf8ca2b1a8a556 (patch)
treec5da3861c921b72d9d4996b35d6d9b162eba9424 /youtube_dl/extractor/stretchinternet.py
parent2a57b62b8007973b5b4974a1d9f5ab06ae78c86e (diff)
downloadyoutube-dl-f4cc03d60b5dd713fb8964cd9ecf8ca2b1a8a556.zip
youtube-dl-f4cc03d60b5dd713fb8964cd9ecf8ca2b1a8a556.tar.gz
youtube-dl-f4cc03d60b5dd713fb8964cd9ecf8ca2b1a8a556.tar.bz2
[stretchinternet] Add extractor
Diffstat (limited to 'youtube_dl/extractor/stretchinternet.py')
-rw-r--r--youtube_dl/extractor/stretchinternet.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/youtube_dl/extractor/stretchinternet.py b/youtube_dl/extractor/stretchinternet.py
new file mode 100644
index 0000000..9a0ec0e
--- /dev/null
+++ b/youtube_dl/extractor/stretchinternet.py
@@ -0,0 +1,28 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class StretchInternetIE(InfoExtractor):
+ IE_DESC = 'StretchInternet'
+ _VALID_URL = r'https?://.*?stretchinternet\.com/[^/_?].*(?<=eventId=)(?P<id>.*)(?=&).*'
+ _TEST = {
+ 'url': 'https://portal.stretchinternet.com/umary/portal.htm?eventId=313900&streamType=video',
+ 'info_dict': {
+ 'id': '313900',
+ 'ext': 'mp4',
+ 'title': 'StretchInternet'
+ }
+ }
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ stream = self._download_json('https://neo-client.stretchinternet.com/streamservice/v1/media/stream/v%s' % video_id, video_id)
+ stream_url = stream.get('source')
+ return {
+ 'ie_key': 'Generic',
+ 'id': video_id,
+ 'url': 'http://%s' % stream_url,
+ 'title': 'StretchInternet'
+ }