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.

43 lines
1.5 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class ServusIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?servus\.com/(?:at|de)/p/[^/]+/(?P<id>AA-\w+|\d+-\d+)'
  6. _TESTS = [{
  7. 'url': 'https://www.servus.com/de/p/Die-Gr%C3%BCnen-aus-Sicht-des-Volkes/AA-1T6VBU5PW1W12/',
  8. 'md5': '046dee641cda1c4cabe13baef3be2c1c',
  9. 'info_dict': {
  10. 'id': 'AA-1T6VBU5PW1W12',
  11. 'ext': 'mp4',
  12. 'title': 'Die Grünen aus Volkssicht',
  13. 'description': 'md5:052b5da1cb2cd7d562ef1f19be5a5cba',
  14. 'thumbnail': r're:^https?://.*\.jpg$',
  15. }
  16. }, {
  17. 'url': 'https://www.servus.com/at/p/Wie-das-Leben-beginnt/1309984137314-381415152/',
  18. 'only_matching': True,
  19. }]
  20. def _real_extract(self, url):
  21. video_id = self._match_id(url)
  22. webpage = self._download_webpage(url, video_id)
  23. title = self._og_search_title(webpage)
  24. description = self._og_search_description(webpage)
  25. thumbnail = self._og_search_thumbnail(webpage)
  26. formats = self._extract_m3u8_formats(
  27. 'https://stv.rbmbtnx.net/api/v1/manifests/%s.m3u8' % video_id,
  28. video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
  29. self._sort_formats(formats)
  30. return {
  31. 'id': video_id,
  32. 'title': title,
  33. 'description': description,
  34. 'thumbnail': thumbnail,
  35. 'formats': formats,
  36. }