logo

youtube-dl

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

adobeconnect.py (1348B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..compat import (
  5. compat_parse_qs,
  6. compat_urlparse,
  7. )
  8. class AdobeConnectIE(InfoExtractor):
  9. _VALID_URL = r'https?://\w+\.adobeconnect\.com/(?P<id>[\w-]+)'
  10. def _real_extract(self, url):
  11. video_id = self._match_id(url)
  12. webpage = self._download_webpage(url, video_id)
  13. title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
  14. qs = compat_parse_qs(self._search_regex(r"swfUrl\s*=\s*'([^']+)'", webpage, 'swf url').split('?')[1])
  15. is_live = qs.get('isLive', ['false'])[0] == 'true'
  16. formats = []
  17. for con_string in qs['conStrings'][0].split(','):
  18. formats.append({
  19. 'format_id': con_string.split('://')[0],
  20. 'app': compat_urlparse.quote('?' + con_string.split('?')[1] + 'flvplayerapp/' + qs['appInstance'][0]),
  21. 'ext': 'flv',
  22. 'play_path': 'mp4:' + qs['streamName'][0],
  23. 'rtmp_conn': 'S:' + qs['ticket'][0],
  24. 'rtmp_live': is_live,
  25. 'url': con_string,
  26. })
  27. return {
  28. 'id': video_id,
  29. 'title': self._live_title(title) if is_live else title,
  30. 'formats': formats,
  31. 'is_live': is_live,
  32. }