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.

25 lines
892 B

  1. import re
  2. from .common import InfoExtractor
  3. class BreakIE(InfoExtractor):
  4. _VALID_URL = r'(?:http://)?(?:www\.)?break\.com/video/([^/]+)'
  5. def _real_extract(self, url):
  6. mobj = re.match(self._VALID_URL, url)
  7. video_id = mobj.group(1).split("-")[-1]
  8. webpage = self._download_webpage(url, video_id)
  9. video_url = re.search(r"videoPath: '(.+?)',",webpage).group(1)
  10. key = re.search(r"icon: '(.+?)',",webpage).group(1)
  11. final_url = str(video_url)+"?"+str(key)
  12. thumbnail_url = re.search(r"thumbnailURL: '(.+?)'",webpage).group(1)
  13. title = re.search(r"sVidTitle: '(.+)',",webpage).group(1)
  14. ext = video_url.split('.')[-1]
  15. return [{
  16. 'id': video_id,
  17. 'url': final_url,
  18. 'ext': ext,
  19. 'title': title,
  20. 'thumbnail': thumbnail_url,
  21. }]