aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorovitei <[email protected]>2016-01-31 03:08:34 +0100
committerSergey M․ <[email protected]>2016-02-07 19:47:29 +0600
commit8628d26f3888d2f0541a5d0e5d7c35fa5cac3fc0 (patch)
tree5e9377aaeb4d31b50557f2e83ae1cbea5492fccd
parent8411229bd5e147ef1ac3420000c7c28ba660df2d (diff)
downloadyoutube-dl-8628d26f3888d2f0541a5d0e5d7c35fa5cac3fc0.tar.gz
youtube-dl-8628d26f3888d2f0541a5d0e5d7c35fa5cac3fc0.zip
[KonserthusetPlay] Add new extractor (partial support)
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/konserthusetplay.py45
2 files changed, 46 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 2fbc7f812..18951c287 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -328,6 +328,7 @@ from .keezmovies import KeezMoviesIE
from .khanacademy import KhanAcademyIE
from .kickstarter import KickStarterIE
from .keek import KeekIE
+from .konserthusetplay import KonserthusetPlayIE
from .kontrtube import KontrTubeIE
from .krasview import KrasViewIE
from .ku6 import Ku6IE
diff --git a/youtube_dl/extractor/konserthusetplay.py b/youtube_dl/extractor/konserthusetplay.py
new file mode 100644
index 000000000..8200942d3
--- /dev/null
+++ b/youtube_dl/extractor/konserthusetplay.py
@@ -0,0 +1,45 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class KonserthusetPlayIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?konserthusetplay\.se/\?m=(?P<id>[0-9A-Za-z_-]+)'
+
+ _TESTS = [{
+ 'url': 'http://www.konserthusetplay.se/?m=CKDDnlCY-dhWAAqiMERd-A',
+ 'md5': 'e272a765e0d12a0226199e5f32d76116',
+ 'info_dict': {
+ 'id': 'CKDDnlCY-dhWAAqiMERd-A',
+ 'ext': 'mp4',
+ 'title': 'Orkesterns instrument: Valthornen',
+ 'description': 'md5:f10e1f0030202020396a4d712d2fa827',
+ 'thumbnail': 'http://csp.picsearch.com/img/C/K/D/D/title_CKDDnlCY-dhWAAqiMERd-A'
+ }
+ }, {
+ 'url': 'http://www.konserthusetplay.se/?m=IyQcMOEpmKqT91SVT5OP8Q',
+ 'md5': 'c4adb8ca76fdd33d4cbdcc7c3d181f22',
+ 'info_dict': {
+ 'id': 'IyQcMOEpmKqT91SVT5OP8Q',
+ 'ext': 'mp4',
+ 'title': 'Eliasson Einsame Fahrt, violinkonsert',
+ 'description': 'md5:a8dcc8dfd9473d52433b2c5f588ba191',
+ 'thumbnail': 'http://csp.picsearch.com/img/I/y/Q/c/title_IyQcMOEpmKqT91SVT5OP8Q'
+ }
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ webpage = self._download_webpage(url, video_id)
+ description = self._og_search_description(webpage)
+ title = self._og_search_title(webpage)
+ main_video = self._html_search_regex(r'<link rel="video_src" href="(.+?)" />', webpage, 'url')
+ thumbnail = self._og_search_thumbnail(webpage)
+ return {
+ 'id': video_id,
+ 'title': title,
+ 'description': description,
+ 'url': main_video,
+ 'thumbnail': thumbnail
+ }