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.

32 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class TMZIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/]+)/?'
  6. _TEST = {
  7. 'url': 'http://www.tmz.com/videos/0_okj015ty/',
  8. 'md5': '791204e3bf790b1426cb2db0706184c0',
  9. 'info_dict': {
  10. 'id': '0_okj015ty',
  11. 'url': 'http://tmz.vo.llnwd.net/o28/2014-03/13/0_okj015ty_0_rt8ro3si_2.mp4',
  12. 'ext': 'mp4',
  13. 'title': 'Kim Kardashian\'s Boobs Unlock a Mystery!',
  14. 'description': 'Did Kim Kardasain try to one-up Khloe by one-upping Kylie??? Or is she just showing off her amazing boobs?',
  15. 'thumbnail': r're:http://cdnbakmi\.kaltura\.com/.*thumbnail.*',
  16. }
  17. }
  18. def _real_extract(self, url):
  19. video_id = self._match_id(url)
  20. webpage = self._download_webpage(url, video_id)
  21. return {
  22. 'id': video_id,
  23. 'url': self._html_search_meta('VideoURL', webpage, fatal=True),
  24. 'title': self._og_search_title(webpage),
  25. 'description': self._og_search_description(webpage),
  26. 'thumbnail': self._html_search_meta('ThumbURL', webpage),
  27. }