def watch_video(video_id): video = scraper.get_video(video_id) if not video['rtmpurl']: __log('watch_video using FLV') video_url = video['filepath'] + video['file'] __log('wget %s' % video_url) else: __log('watch_video using RTMPE or RTMPT') __log(( 'rtmpdump ' '--rtmp "%(rtmpurl)s" ' '--flv "test.flv" ' '--tcUrl "%(rtmpurl)s" ' '--swfVfy "%(swfobj)s" ' '--pageUrl "%(pageurl)s" ' '--playpath "%(playpath)s"' ) % video) video_url = ( '%(rtmpurl)s ' 'tcUrl=%(rtmpurl)s ' 'swfVfy=%(swfobj)s ' 'pageUrl=%(pageurl)s ' 'playpath=%(playpath)s' ) % video __log('watch_video finished with url: %s' % video_url) return plugin.set_resolved_url(video_url)
def download_video(video_id): download_path = plugin.get_setting('download_path') while not download_path: dialog = xbmcgui.Dialog() set_now = dialog.yesno(_('no_download_path'), _('set_now?')) if set_now: plugin.open_settings() download_path = plugin.get_setting('download_path') else: return sd = SimpleDownloader.SimpleDownloader() video = scraper.get_video(video_id) filename = __get_legal_filename(video['title']) if not video['rtmpurl']: params = { 'url': video['filepath'] + video['file'], } else: params = { 'use_rtmpdump': True, 'url': video['rtmpurl'], 'tcUrl': video['rtmpurl'], 'swfUrl': video['swfobj'], 'pageUrl': video['pageurl'], 'playpath': video['playpath'] } params['download_path'] = download_path __log('params: %s' % repr(params)) __log('start downloading: %s to path: %s' % (filename, download_path)) sd.download(filename, params)
def watch_video(video_id): video = scraper.get_video(video_id) if 'hls_playlist' in video: __log('watch_video using HLS') video_url = video['hls_playlist'] elif not video['rtmpurl']: __log('watch_video using FLV') video_url = video['filepath'] + video['file'] else: __log('watch_video using RTMPE or RTMPT') video_url = ('%(rtmpurl)s ' 'tcUrl=%(rtmpurl)s ' 'swfVfy=%(swfobj)s ' 'pageUrl=%(pageurl)s ' 'playpath=%(playpath)s') % video __log('watch_video finished with url: %s' % video_url) return plugin.set_resolved_url(video_url)
def watch_video(video_id): video = scraper.get_video(video_id) if 'hls_playlist' in video: __log('watch_video using HLS') video_url = video['hls_playlist'] elif not video['rtmpurl']: __log('watch_video using FLV') video_url = video['filepath'] + video['file'] else: __log('watch_video using RTMPE or RTMPT') video_url = ( '%(rtmpurl)s ' 'tcUrl=%(rtmpurl)s ' 'swfVfy=%(swfobj)s ' 'pageUrl=%(pageurl)s ' 'playpath=%(playpath)s' ) % video __log('watch_video finished with url: %s' % video_url) return plugin.set_resolved_url(video_url)
def watch_video(video_id): __log('watch_video started with video_id: %s' % video_id) video_url = scraper.get_video(video_id) __log('watch_video finished with url: %s' % video_url) return plugin.set_resolved_url(video_url)