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.

36 lines
1.1 KiB

  1. from __future__ import unicode_literals
  2. import os
  3. from .common import InfoExtractor
  4. from ..compat import (
  5. compat_urllib_parse_unquote,
  6. compat_urlparse,
  7. )
  8. from ..utils import url_basename
  9. class RtmpIE(InfoExtractor):
  10. IE_DESC = False # Do not list
  11. _VALID_URL = r'(?i)rtmp[est]?://.+'
  12. _TESTS = [{
  13. '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',
  14. 'only_matching': True,
  15. }, {
  16. 'url': 'rtmp://edge.live.hitbox.tv/live/dimak',
  17. 'only_matching': True,
  18. }]
  19. def _real_extract(self, url):
  20. video_id = compat_urllib_parse_unquote(os.path.splitext(url.rstrip('/').split('/')[-1])[0])
  21. title = compat_urllib_parse_unquote(os.path.splitext(url_basename(url))[0])
  22. return {
  23. 'id': video_id,
  24. 'title': title,
  25. 'formats': [{
  26. 'url': url,
  27. 'ext': 'flv',
  28. 'format_id': compat_urlparse.urlparse(url).scheme,
  29. }],
  30. }