logo

youtube-dl

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

atttechchannel.py (1962B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..utils import unified_strdate
  4. class ATTTechChannelIE(InfoExtractor):
  5. _VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)'
  6. _TEST = {
  7. 'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27/ATT-Archives-The-UNIX-System-Making-Computers-Easier-to-Use',
  8. 'info_dict': {
  9. 'id': '11316',
  10. 'display_id': 'ATT-Archives-The-UNIX-System-Making-Computers-Easier-to-Use',
  11. 'ext': 'flv',
  12. 'title': 'AT&T Archives : The UNIX System: Making Computers Easier to Use',
  13. 'description': 'A 1982 film about UNIX is the foundation for software in use around Bell Labs and AT&T.',
  14. 'thumbnail': r're:^https?://.*\.jpg$',
  15. 'upload_date': '20140127',
  16. },
  17. 'params': {
  18. # rtmp download
  19. 'skip_download': True,
  20. },
  21. }
  22. def _real_extract(self, url):
  23. display_id = self._match_id(url)
  24. webpage = self._download_webpage(url, display_id)
  25. video_url = self._search_regex(
  26. r"url\s*:\s*'(rtmp://[^']+)'",
  27. webpage, 'video URL')
  28. video_id = self._search_regex(
  29. r'mediaid\s*=\s*(\d+)',
  30. webpage, 'video id', fatal=False)
  31. title = self._og_search_title(webpage)
  32. description = self._og_search_description(webpage)
  33. thumbnail = self._og_search_thumbnail(webpage)
  34. upload_date = unified_strdate(self._search_regex(
  35. r'[Rr]elease\s+date:\s*(\d{1,2}/\d{1,2}/\d{4})',
  36. webpage, 'upload date', fatal=False), False)
  37. return {
  38. 'id': video_id,
  39. 'display_id': display_id,
  40. 'url': video_url,
  41. 'ext': 'flv',
  42. 'title': title,
  43. 'description': description,
  44. 'thumbnail': thumbnail,
  45. 'upload_date': upload_date,
  46. }