logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

ro220.py (1452B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..compat import compat_urllib_parse_unquote
  4. class Ro220IE(InfoExtractor):
  5. IE_NAME = '220.ro'
  6. _VALID_URL = r'(?x)(?:https?://)?(?:www\.)?220\.ro/(?P<category>[^/]+)/(?P<shorttitle>[^/]+)/(?P<id>[^/]+)'
  7. _TEST = {
  8. 'url': 'http://www.220.ro/sport/Luati-Le-Banii-Sez-4-Ep-1/LYV6doKo7f/',
  9. 'md5': '03af18b73a07b4088753930db7a34add',
  10. 'info_dict': {
  11. 'id': 'LYV6doKo7f',
  12. 'ext': 'mp4',
  13. 'title': 'Luati-le Banii sez 4 ep 1',
  14. 'description': r're:^Iata-ne reveniti dupa o binemeritata vacanta\. +Va astept si pe Facebook cu pareri si comentarii.$',
  15. }
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. url = compat_urllib_parse_unquote(self._search_regex(
  21. r'(?s)clip\s*:\s*{.*?url\s*:\s*\'([^\']+)\'', webpage, 'url'))
  22. title = self._og_search_title(webpage)
  23. description = self._og_search_description(webpage)
  24. thumbnail = self._og_search_thumbnail(webpage)
  25. formats = [{
  26. 'format_id': 'sd',
  27. 'url': url,
  28. 'ext': 'mp4',
  29. }]
  30. return {
  31. 'id': video_id,
  32. 'formats': formats,
  33. 'title': title,
  34. 'description': description,
  35. 'thumbnail': thumbnail,
  36. }