예제 #1
0
	def get_streams_js(self, url, rnd = None):
		url = url.encode('utf-8')
		return [{ 'url': s['final_url'],
				'meta': { 'quality': s.get('quality'),
						'subtitles': s.get('subtitles'),
						'suffixHint': s.get('suffix-hint'),
						'rtmpDumpRealtime': s.get('rtmpdump-realtime', False),
						'requiredPlayerVersion': s.get('required-player-version', '0') } } for s in pirateplay.get_streams(url)]
예제 #2
0
	def get_streams_old_xml(self, url, librtmp = '0', output_file = '-', parent_function = ''):
		streams = pirateplay.get_streams(url)
		
		try:
			if streams[0]['final_url'].startswith('rtmp') and librtmp == '0':
				return { 'streams': [{'url': pirateplay.rtmpdump_cmd(s['final_url'], output_file), 'meta': s} for s in streams] }
			elif '.m3u8' in streams[0]['final_url']:
				return { 'streams': [{ 'meta': { 'quality': u'Inkompatibel ström. Uppgradera Pirateplayer.' }, 'url': 'http://localhost/' }] }
			elif 'manifest.f4m' in streams[0]['final_url']:
				return { 'streams': [{ 'meta': { 'quality': u'Inkompatibel ström. Testa appen på Pirateplay.se.' }, 'url': 'http://localhost/' }] }
			else:
				return { 'streams': [{'url': s['final_url'], 'meta': s} for s in streams] }
		except (IndexError, KeyError):
			return { 'streams': [] }
예제 #3
0
	def get_streams_xml(self, url, rnd = None):
		url = url.encode('utf-8')
		return { 'streams': pirateplay.get_streams(url) }