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.

50 lines
1.8 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .common import InfoExtractor
  5. class DBTVIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?dbtv\.no/(?:[^/]+/)?(?P<id>[0-9]+)(?:#(?P<display_id>.+))?'
  7. _TESTS = [{
  8. 'url': 'http://dbtv.no/3649835190001#Skulle_teste_ut_fornøyelsespark,_men_kollegaen_var_bare_opptatt_av_bikinikroppen',
  9. 'md5': '2e24f67936517b143a234b4cadf792ec',
  10. 'info_dict': {
  11. 'id': '3649835190001',
  12. 'display_id': 'Skulle_teste_ut_fornøyelsespark,_men_kollegaen_var_bare_opptatt_av_bikinikroppen',
  13. 'ext': 'mp4',
  14. 'title': 'Skulle teste ut fornøyelsespark, men kollegaen var bare opptatt av bikinikroppen',
  15. 'description': 'md5:1504a54606c4dde3e4e61fc97aa857e0',
  16. 'thumbnail': 're:https?://.*\.jpg',
  17. 'timestamp': 1404039863,
  18. 'upload_date': '20140629',
  19. 'duration': 69.544,
  20. 'uploader_id': '1027729757001',
  21. },
  22. 'add_ie': ['BrightcoveNew']
  23. }, {
  24. 'url': 'http://dbtv.no/3649835190001',
  25. 'only_matching': True,
  26. }, {
  27. 'url': 'http://www.dbtv.no/lazyplayer/4631135248001',
  28. 'only_matching': True,
  29. }, {
  30. 'url': 'http://dbtv.no/vice/5000634109001',
  31. 'only_matching': True,
  32. }, {
  33. 'url': 'http://dbtv.no/filmtrailer/3359293614001',
  34. 'only_matching': True,
  35. }]
  36. def _real_extract(self, url):
  37. video_id, display_id = re.match(self._VALID_URL, url).groups()
  38. return {
  39. '_type': 'url_transparent',
  40. 'url': 'http://players.brightcove.net/1027729757001/default_default/index.html?videoId=%s' % video_id,
  41. 'id': video_id,
  42. 'display_id': display_id,
  43. 'ie_key': 'BrightcoveNew',
  44. }