You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.4 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .wdr import WDRBaseIE
  4. from ..utils import get_element_by_attribute
  5. class SportschauIE(WDRBaseIE):
  6. IE_NAME = 'Sportschau'
  7. _VALID_URL = r'https?://(?:www\.)?sportschau\.de/(?:[^/]+/)+video-?(?P<id>[^/#?]+)\.html'
  8. _TEST = {
  9. 'url': 'http://www.sportschau.de/uefaeuro2016/videos/video-dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100.html',
  10. 'info_dict': {
  11. 'id': 'mdb-1140188',
  12. 'display_id': 'dfb-team-geht-gut-gelaunt-ins-spiel-gegen-polen-100',
  13. 'ext': 'mp4',
  14. 'title': 'DFB-Team geht gut gelaunt ins Spiel gegen Polen',
  15. '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.',
  16. 'upload_date': '20160615',
  17. },
  18. 'skip': 'Geo-restricted to Germany',
  19. }
  20. def _real_extract(self, url):
  21. video_id = self._match_id(url)
  22. webpage = self._download_webpage(url, video_id)
  23. title = get_element_by_attribute('class', 'headline', webpage)
  24. description = self._html_search_meta('description', webpage, 'description')
  25. info = self._extract_wdr_video(webpage, video_id)
  26. info.update({
  27. 'title': title,
  28. 'description': description,
  29. })
  30. return info