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.

30 lines
1.0 KiB

  1. import re
  2. from .common import InfoExtractor
  3. from .ooyala import OoyalaIE
  4. class BloombergIE(InfoExtractor):
  5. _VALID_URL = r'https?://www\.bloomberg\.com/video/(?P<name>.+?)\.html'
  6. _TEST = {
  7. u'url': u'http://www.bloomberg.com/video/shah-s-presentation-on-foreign-exchange-strategies-qurhIVlJSB6hzkVi229d8g.html',
  8. u'file': u'12bzhqZTqQHmmlA8I-i0NpzJgcG5NNYX.mp4',
  9. u'info_dict': {
  10. u'title': u'Shah\'s Presentation on Foreign-Exchange Strategies',
  11. u'description': u'md5:abc86e5236f9f0e4866c59ad36736686',
  12. },
  13. u'params': {
  14. # Requires ffmpeg (m3u8 manifest)
  15. u'skip_download': True,
  16. },
  17. }
  18. def _real_extract(self, url):
  19. mobj = re.match(self._VALID_URL, url)
  20. name = mobj.group('name')
  21. webpage = self._download_webpage(url, name)
  22. embed_code = self._search_regex(
  23. r'<source src="https?://[^/]+/[^/]+/[^/]+/([^/]+)', webpage,
  24. 'embed code')
  25. return OoyalaIE._build_url_result(embed_code)