コード例 #1
0
	def InitialiseRTMP(self, assetUrl):

		try:
			self.urlRoot = u"http://www.channel4.com"
			streamUri = ""
			auth = ""
			
			# Get the stream info
			(streamUri, auth, returnMessage) = self.GetStreamInfo(assetUrl)
			
			if streamUri:
				url = re.search('(.*?)mp4:', streamUri).group(1)
				app = re.search('.com/(.*?)mp4:', streamUri).group(1)
				playPath = re.search('(mp4:.*)', streamUri).group(1) + "?" + auth
				if "ll."  not in streamUri: 
					url = url + "?ovpfv=1.1&" + auth
					app = app + "?ovpfv=1.1&" + auth

				swfPlayer = self.GetSwfPlayer()
				rtmpvar = RTMP(rtmp = streamUri, app = app, swfVfy = swfPlayer, playPath = playPath, pageUrl = self.urlRoot)
				return (rtmpvar, returnMessage)
			else:
				return ("", returnMessage)
		except (Exception) as exception:
			print 'InitialiseRTMP: Error getting mp4: ', exception
			return ("", "")
コード例 #2
0
ファイル: fourOD.py プロジェクト: MOA-2011/3rd-party-plugins
	def InitialiseRTMP(self, assetUrl):

		try:
			self.urlRoot = u"http://m.channel4.com"
			streamUri = ""
			auth = ""
			
			# Get the stream info
			(streamUri, auth, returnMessage) = self.GetStreamInfo(assetUrl)
			
			if streamUri:
				url = re.search(u'(.*?)mp4:', streamUri).group(1)
				app = re.search(u'.com/(.*?)mp4:', streamUri).group(1)
				playPath = re.search(u'(mp4:.*)', streamUri).group(1)

				if "ll."  not in streamUri: 
					app = app + u"?ovpfv=1.1&" + auth
				else:
					playPath += "?" + auth

				swfPlayer = self.GetSwfPlayer()
				
				port = None
				
				rtmpvar =  RTMP(rtmp = streamUri, app = app, swfVfy = swfPlayer, playPath = playPath, pageUrl = self.urlRoot, port = port)
				return (rtmpvar, returnMessage)
			else:
				return ("", returnMessage)
		except (Exception) as exception:
			print __plugin__, __version__,'InitialiseRTMP: Error getting mp4: ', exception
			return ("", "InitialiseRTMP: Error getting mp4")