summaryrefslogtreecommitdiffhomepage
path: root/youtube_dl
diff options
context:
space:
mode:
authorYen Chi Hsuan <[email protected]>2016-06-18 13:42:58 +0800
committerYen Chi Hsuan <[email protected]>2016-06-18 13:42:58 +0800
commite8f13f2637fd33b20ac2682dbbdaef63b6288bf4 (patch)
tree6f3fa08ddbccef4c71c5d3e99f11631d337b1592 /youtube_dl
parentb5aad37f6bdc72acaca198202dc9f7eaa3185e51 (diff)
downloadyoutube-dl-e8f13f2637fd33b20ac2682dbbdaef63b6288bf4.tar.gz
youtube-dl-e8f13f2637fd33b20ac2682dbbdaef63b6288bf4.zip
[sportschau.de] Fix extraction and moved to its own file (closes #9799)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/sportschau.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/youtube_dl/extractor/sportschau.py b/youtube_dl/extractor/sportschau.py
new file mode 100644
index 000000000..0d7925a08
--- /dev/null
+++ b/youtube_dl/extractor/sportschau.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .wdr import WDRBaseIE
+from ..utils import get_element_by_attribute
+
+
+class SportschauIE(WDRBaseIE):
+ IE_NAME = 'Sportschau'
+ _VALID_URL = r'https?://(?:www\.)?sportschau\.de/(?:[^/]+/)+video-?(?P<id>[^/#?]+)\.html'
+ _TEST = {
+ 'url': 'http://www.sportschau.de/uefaeuro2016/videos/video-dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100.html',
+ 'info_dict': {
+ 'id': 'mdb-1140188',
+ 'display_id': 'dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100',
+ 'ext': 'mp4',
+ 'title': 'DFB-Team geht gut gelaunt ins Spiel gegen Polen',
+ 'description': 'Vor dem zweiten Gruppenspiel gegen Polen herrscht gute Stimmung im deutschen Team. Insbesondere Bastian Schweinsteiger strotzt vor Optimismus nach seinem Tor gegen die Ukraine.',
+ 'upload_date': '20160615',
+ },
+ 'skip': 'Geo-restricted to Germany',
+ }
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ webpage = self._download_webpage(url, video_id)
+ title = get_element_by_attribute('class', 'headline', webpage)
+ description = self._html_search_meta('description', webpage, 'description')
+
+ info = self._extract_wdr_video(webpage, video_id)
+
+ info.update({
+ 'title': title,
+ 'description': description,
+ })
+
+ return info