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.

45 lines
1.7 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class KonserthusetPlayIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?konserthusetplay\.se/\?m=(?P<id>[0-9A-Za-z_-]+)'
  6. _TESTS = [{
  7. 'url': 'http://www.konserthusetplay.se/?m=CKDDnlCY-dhWAAqiMERd-A',
  8. 'md5': 'e272a765e0d12a0226199e5f32d76116',
  9. 'info_dict': {
  10. 'id': 'CKDDnlCY-dhWAAqiMERd-A',
  11. 'ext': 'mp4',
  12. 'title': 'Orkesterns instrument: Valthornen',
  13. 'description': 'md5:f10e1f0030202020396a4d712d2fa827',
  14. 'thumbnail': 'http://csp.picsearch.com/img/C/K/D/D/title_CKDDnlCY-dhWAAqiMERd-A'
  15. }
  16. }, {
  17. 'url': 'http://www.konserthusetplay.se/?m=IyQcMOEpmKqT91SVT5OP8Q',
  18. 'md5': 'c4adb8ca76fdd33d4cbdcc7c3d181f22',
  19. 'info_dict': {
  20. 'id': 'IyQcMOEpmKqT91SVT5OP8Q',
  21. 'ext': 'mp4',
  22. 'title': 'Eliasson Einsame Fahrt, violinkonsert',
  23. 'description': 'md5:a8dcc8dfd9473d52433b2c5f588ba191',
  24. 'thumbnail': 'http://csp.picsearch.com/img/I/y/Q/c/title_IyQcMOEpmKqT91SVT5OP8Q'
  25. }
  26. }]
  27. def _real_extract(self, url):
  28. video_id = self._match_id(url)
  29. webpage = self._download_webpage(url, video_id)
  30. description = self._og_search_description(webpage)
  31. title = self._og_search_title(webpage)
  32. main_video = self._html_search_regex(r'<link rel="video_src" href="(.+?)" />', webpage, 'url')
  33. thumbnail = self._og_search_thumbnail(webpage)
  34. return {
  35. 'id': video_id,
  36. 'title': title,
  37. 'description': description,
  38. 'url': main_video,
  39. 'thumbnail': thumbnail
  40. }