def sayfaindir(self):
veri = ""+self.bir
print veri
getPage(veri, headers={'Referer': 'http://www.teledunet.com/mosaic.php','Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.sayfabilgi).addErrb ack(self.dataError)
def sayfabilgi(self, html):
print html
html=html.replace("url('",'').replace("') no-repeat ",'').replace(''','')
aut = re.search('\'?id0=(.*?)\';', html,re.S)
if aut:
print aut.group(1)
channels = re.findall('style=".*?5pxbackground
.*?)#ffffff.*?#000000">(.*?)</span>.*?<input type="hidden" id="rtmp_.*?" value="rtmp://.*?/.*?/(.*?)">.*?onclick="set_favoris\(\'.*?\',\'.*?\',\' (rtmp://.*?)\'', html, re.S)
if channels:
for channel,title, image,rtmp_url in channels:
print title, channel, image,rtmp_url
self.tarzlistesi.append((alfabekodla(title),channe l,image,rtmp_url, aut.group(1)))
self.OTVList.setList(map(Gir, self.tarzlistesi))
self.kilitkir = False
self.th_ThumbsQuery(self.tarzlistesi, 0, 1, 2, None, None, 1, 1)
self.listinfo()
def listinfo(self):
name = self['liste'].getCurrent()[0][0]
self['eylem'].setText(name)
coverUrl = self['liste'].getCurrent()[0][1].replace(' ','%20')
PixmapHelper(self['Cover']).getCover(coverUrl)
def keyShowThumb(self):
if self.kilitkir:
return
self.th_keyShowThumb(self.tarzlistesi, 0, 1, 2, None, None, 1, 1)
def keyOK(self):
if self.kilitkir:
return
url = "http://www.teledunet.com/who_watch_channel.php?refresh=1"
print url
getPage(url,headers={'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}).addCallback(self.stream).addErrback(self.data Error)
def stream(self, data ):
user = re.findall('<img src="premium.png".*?onclick="tchat_with_membre.*?\ '(.*?)\'', data, re.S)
if user:
channel= self['liste'].getCurrent()[0][3].replace("rtmp://www.teledunet.com:1935/live/",'').replace("rtmp://www.teledunet.com:1935/live2/",'')
ad= self['liste'].getCurrent()[0][2]
rtmp_url = self['liste'].getCurrent()[0][3]
aut = self['liste'].getCurrent()[0][4]
token=''
import random
token=str( int('11' + str(int(999999 +random.random() * (99999999 - 999999)))) * 13);
final = '%s'% (rtmp_url)+' playpath=%s'% (channel)+' swfUrl=http://www.teledunet.com/mobile/player.swf?channel=%s'%(channel)+'&user=%s'%(user[0])+'&token='+(aut)+(token)+' pageUrl=http://www.teledunet.com/mobile/ flashVer=WIN\\2014,0,0,145 swfVfy=true timeout=20'
playlist = []
playlist.append((channel, final.replace("= ",'=')))
self.session.open(OTVPlayer, playlist, showPlaylist=False, ltype='teledunet')
Paylaş