logo

youtube-dl

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

commonprotocols.py (1672B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..compat import (
  4. compat_urlparse,
  5. )
  6. class RtmpIE(InfoExtractor):
  7. IE_DESC = False # Do not list
  8. _VALID_URL = r'(?i)rtmp[est]?://.+'
  9. _TESTS = [{
  10. 'url': 'rtmp://cp44293.edgefcs.net/ondemand?auth=daEcTdydfdqcsb8cZcDbAaCbhamacbbawaS-bw7dBb-bWG-GqpGFqCpNCnGoyL&aifp=v001&slist=public/unsecure/audio/2c97899446428e4301471a8cb72b4b97--audio--pmg-20110908-0900a_flv_aac_med_int.mp4',
  11. 'only_matching': True,
  12. }, {
  13. 'url': 'rtmp://edge.live.hitbox.tv/live/dimak',
  14. 'only_matching': True,
  15. }]
  16. def _real_extract(self, url):
  17. video_id = self._generic_id(url)
  18. title = self._generic_title(url)
  19. return {
  20. 'id': video_id,
  21. 'title': title,
  22. 'formats': [{
  23. 'url': url,
  24. 'ext': 'flv',
  25. 'format_id': compat_urlparse.urlparse(url).scheme,
  26. }],
  27. }
  28. class MmsIE(InfoExtractor):
  29. IE_DESC = False # Do not list
  30. _VALID_URL = r'(?i)mms://.+'
  31. _TEST = {
  32. # Direct MMS link
  33. 'url': 'mms://kentro.kaist.ac.kr/200907/MilesReid(0709).wmv',
  34. 'info_dict': {
  35. 'id': 'MilesReid(0709)',
  36. 'ext': 'wmv',
  37. 'title': 'MilesReid(0709)',
  38. },
  39. 'params': {
  40. 'skip_download': True, # rtsp downloads, requiring mplayer or mpv
  41. },
  42. }
  43. def _real_extract(self, url):
  44. video_id = self._generic_id(url)
  45. title = self._generic_title(url)
  46. return {
  47. 'id': video_id,
  48. 'title': title,
  49. 'url': url,
  50. }