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
990 B

10 years ago
10 years ago
  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class Ku6IE(InfoExtractor):
  4. _VALID_URL = r'http://v\.ku6\.com/show/(?P<id>[a-zA-Z0-9\-\_]+)(?:\.)*html'
  5. _TEST = {
  6. 'url': 'http://v.ku6.com/show/JG-8yS14xzBr4bCn1pu0xw...html',
  7. 'md5': '01203549b9efbb45f4b87d55bdea1ed1',
  8. 'info_dict': {
  9. 'id': 'JG-8yS14xzBr4bCn1pu0xw',
  10. 'ext': 'f4v',
  11. 'title': 'techniques test',
  12. }
  13. }
  14. def _real_extract(self, url):
  15. video_id = self._match_id(url)
  16. webpage = self._download_webpage(url, video_id)
  17. title = self._html_search_regex(
  18. r'<h1 title=.*>(.*?)</h1>', webpage, 'title')
  19. dataUrl = 'http://v.ku6.com/fetchVideo4Player/%s.html' % video_id
  20. jsonData = self._download_json(dataUrl, video_id)
  21. downloadUrl = jsonData['data']['f']
  22. return {
  23. 'id': video_id,
  24. 'title': title,
  25. 'url': downloadUrl
  26. }