def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update( 10, "", "Finding links..", "" ) #print 'fetching url',url link=getURL(url).result; #print 'link',link progress.update( 30, "", "Finding links..", "" ) h=HTMLParser.HTMLParser() match= re.findall('ass="stremb">.*?href="(http.*?)"', link) if len(match)==0: progress.update( 60, "", "Finding links..", "" ) match= re.findall('fid="(.*?)";', link) #print link,match zzUrl="http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com"%(match[0]) else: zzUrl=h.unescape(match[0]) print zzUrl,'zzURL' if len(zzUrl)==0: return None print zzUrl,'zzURL' progress.update( 70, "", "Finding links..", "" ) link=getURL(zzUrl,referer=url).result; progress.update( 90, "", "Finding links..", "" ) match= re.findall('SWFObject\(\'(.*?)\',.*file\',\'(.*?)\'.*streamer\',\'(.*?)\'', link, re.DOTALL) progress.update( 100, "", "Finding links..", "" ) if len(match)==0: return None return {'rtmp':match[0][2],'playpath':match[0][1],'swf':match[0][0]}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create("Progress", "Fetching Streaming Info") progress.update(10, "", "Finding links..", "") # print 'fetching url',url link = getURL(url).result # print 'link',link progress.update(30, "", "Finding links..", "") h = HTMLParser.HTMLParser() match = re.findall('ass="stremb">.*?href="(http.*?)"', link) if len(match) == 0: progress.update(60, "", "Finding links..", "") match = re.findall('fid="(.*?)";', link) # print link,match zzUrl = "http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com" % (match[0]) else: zzUrl = h.unescape(match[0]) print zzUrl, "zzURL" if len(zzUrl) == 0: return None print zzUrl, "zzURL" progress.update(70, "", "Finding links..", "") link = getURL(zzUrl, referer=url).result progress.update(90, "", "Finding links..", "") match = re.findall("SWFObject\('(.*?)',.*file','(.*?)'.*streamer','(.*?)'", link, re.DOTALL) progress.update(100, "", "Finding links..", "") if len(match) == 0: return None return {"rtmp": match[0][2], "playpath": match[0][1], "swf": match[0][0]}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update(10, "", "Finding links..", "") #print 'fetching url',url link = getURL(url, mobile=False).result #print 'link',link progress.update(30, "", "Finding links..", "") h = HTMLParser.HTMLParser() match = re.findall('<iframe name="ifram2" src="(.*?)"', link) if len(match) == 0: match = re.findall('<iframe src="(.*?)" name="ifram2"', link) print match if len(match) == 0: progress.update(60, "", "Finding links..", "") match = re.findall('fid="(.*?)";', link) #print link,match zzUrl = "http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com" % ( match[0]) else: print 'getting zurl', match[0] zzUrl = h.unescape(match[0]) print zzUrl, 'zzURL' if len(zzUrl) == 0: return None #print zzUrl,'zzURL' progress.update(70, "", "Finding links..", "") link = getURL(zzUrl, referer=url, mobile=False).result #print link,zzUrl #link=zzUrl progress.update(90, "", "Finding links..", "") print 'final match is', match, link progress.update(100, "", "Finding links..", "") if 'file:"' in link: match = re.findall('file:"(.*?)"', link) return {'url': match[0] + '|Referer=' + zzUrl} else: match = re.findall( 'SWFObject\(\'(.*?)\',.*file\',\'(.*?)\'.*streamer\',\'(.*?)\'', link, re.DOTALL) #match= re.findall('(http.*?playlist.*?)', link) #print match #link=getURL(match[0][0],referer=url, mobile=True).result; # match= re.findall('(http.*?playlist.*?)\\s', link, re.DOTALL) if len(match) == 0: return None return { 'rtmp': match[0][2], 'playpath': match[0][1], 'swf': match[0][0], 'pageUrl': zzUrl }
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update( 10, "", "Finding links..", "" ) #print 'fetching url',url link=getURL(url).result; #print 'link',link progress.update( 30, "", "Finding links..", "" ) match= re.findall('ass="stremb">.*?href="(.*?)"', link) if len(match)==0: progress.update( 60, "", "Finding links..", "" ) match= re.findall('fid="(.*?)";', link) #print link,match zzUrl="http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com"%(match[0]) else: zzUrl=match[0] if len(zzUrl)==0: return None print zzUrl,'zzURL' progress.update( 70, "", "Finding links..", "" ) link=getURL(zzUrl,referer=url).result; progress.update( 90, "", "Finding links..", "" ) match= re.findall('SWFObject\(\'(.*?)\',.*file\',\'(.*?)\'.*streamer\',\'(.*?)\'', link, re.DOTALL) progress.update( 100, "", "Finding links..", "" ) if len(match)==0: return None return {'rtmp':match[0][2],'playpath':match[0][1],'swf':match[0][0]}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update( 10, "", "Finding links..", "" ) if 'peacetvbangla' in url: u=getpeacetvbangla(url) progress.close() return u #print 'fetching url',url link=getURL(url, mobile=False).result; #print 'link',link progress.update( 30, "", "Finding links..", "" ) h=HTMLParser.HTMLParser() match= re.findall('<iframe.*?src="(.*?jagobd.com.*?)"', link) if len(match)==0: match= re.findall('<iframe src="(.*?)" name="ifram2"', link) print match if len(match)==0: progress.update( 60, "", "Finding links..", "" ) match= re.findall('fid="(.*?)";', link) #print link,match zzUrl="http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com"%(match[0]) else: print 'getting zurl',match[0] zzUrl=h.unescape(match[0]) print zzUrl,'zzURL' if len(zzUrl)==0: return None #print zzUrl,'zzURL' progress.update( 70, "", "Finding links..", "" ) if zzUrl.startswith("//"): zzUrl='http:'+zzUrl link=getURL(zzUrl,referer=url, mobile=False).result; #print link,zzUrl #link=zzUrl progress.update( 90, "", "Finding links..", "" ) print 'final match is',match,link progress.update( 100, "", "Finding links..", "" ) if 'file:"' in link: match=re.findall('file:"(.*?)"', link) return {'url':match[0]+'|Referer='+zzUrl} else: match= re.findall('SWFObject\(\'(.*?)\',.*file\',\'(.*?)\'.*streamer\',\'(.*?)\'', link, re.DOTALL) #match= re.findall('(http.*?playlist.*?)', link) #print match #link=getURL(match[0][0],referer=url, mobile=True).result; # match= re.findall('(http.*?playlist.*?)\\s', link, re.DOTALL) if len(match)==0: return None return {'rtmp':match[0][2],'playpath':match[0][1],'swf':match[0][0],'pageUrl':zzUrl}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create("Progress", "Fetching Streaming Info") progress.update(10, "", "Finding links..", "") if "peacetvbangla" in url: u = getpeacetvbangla(url) progress.close() return u # print 'fetching url',url link = getURL(url, mobile=False).result # print 'link',link progress.update(30, "", "Finding links..", "") h = HTMLParser.HTMLParser() match = re.findall('<iframe name="ifram2" src="(.*?)"', link) if len(match) == 0: match = re.findall('<iframe src="(.*?)" name="ifram2"', link) print match if len(match) == 0: progress.update(60, "", "Finding links..", "") match = re.findall('fid="(.*?)";', link) # print link,match zzUrl = "http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com" % (match[0]) else: print "getting zurl", match[0] zzUrl = h.unescape(match[0]) print zzUrl, "zzURL" if len(zzUrl) == 0: return None # print zzUrl,'zzURL' progress.update(70, "", "Finding links..", "") if zzUrl.startswith("//"): zzUrl = "http:" + zzUrl link = getURL(zzUrl, referer=url, mobile=False).result # print link,zzUrl # link=zzUrl progress.update(90, "", "Finding links..", "") print "final match is", match, link progress.update(100, "", "Finding links..", "") if 'file:"' in link: match = re.findall('file:"(.*?)"', link) return {"url": match[0] + "|Referer=" + zzUrl} else: match = re.findall("SWFObject\('(.*?)',.*file','(.*?)'.*streamer','(.*?)'", link, re.DOTALL) # match= re.findall('(http.*?playlist.*?)', link) # print match # link=getURL(match[0][0],referer=url, mobile=True).result; # match= re.findall('(http.*?playlist.*?)\\s', link, re.DOTALL) if len(match) == 0: return None return {"rtmp": match[0][2], "playpath": match[0][1], "swf": match[0][0], "pageUrl": zzUrl}
def getVODList(Fromurl, mode): link = getURL(Fromurl).result regstring = '<div class="a.*href="(.*)"\'>\s*.*<h2><span>(.*?)<.*\s*.*src="(.*?)"' match = re.findall(regstring, link) #print match listToReturn = [] for cname in match: if mode == 'VOD': modeToUse = 'VODSerial' # series, 4=enteries if 'Music' in cname[1] or 'Films' in cname[ 1] or 'Telefilms' in cname[1] or 'Entertainment' in cname[ 1]: modeToUse = 'VODEntry' else: modeToUse = 'VODEntry' #print modeToUse,cname[1] listToReturn.append({ 'name': cname[1], 'url': mainurl + cname[0], 'mode': modeToUse, 'iconimage': cname[2].replace(' ', '%20') }) return listToReturn
def getEnteriesList(Fromurl,PageNumber,mode): link=getURL(Fromurl).result; #print 'getEnteriesList',link match =re.findall('<div class="a.*href="(.*)"\'>\s*.*\s*.*src="(.*?)".*\s*.*?>(.*?)<', link) #print 'match',match listToReturn=[] rmode='PlayVOD'; if mode=='ALLC': rmode='PlayLive' for cname in match: #print cname[2] #addDir(cname[2] ,mainurl+cname[0] ,5,cname[1],isItFolder=False) imageurl=cname[1].replace(' ','%20'); url=cname[0]; if not imageurl.startswith('http'): imageurl=mainurl+'/'+imageurl if not url.startswith('http'): url=mainurl+url #print imageurl listToReturn.append({'name':cname[2],'url':url,'mode':rmode,'iconimage':imageurl,'isFolder':False}) match =re.findall('<span class="pagenav">Next</span></li', link) match2 =re.findall('next', link) if len(match)==0 and len(match2)>0: url=Fromurl; if len(PageNumber)>0: pNumber=str(int(PageNumber) + 16) else: pNumber='16' if 'limitstart' in url: url =url.split("&limitstart")[0] url+="&limitstart="+pNumber #addDir('Next Page' , url ,4,'',pageNum=pNumber) listToReturn.append({'name':'Next Page','url':url,'mode':mode,'iconimage':''}) return listToReturn
def getChannelsEnteries(Fromurl, PageNumber, mode): link = getURL(Fromurl).result # print 'getEnteriesList',link if mode == "IC": match = re.findall('<a.*?href="(.*?)".*?title="(.*?)".*?src="(.*?)"', link) else: match = re.findall('<li><a href="(.*?)" rel="bookmark" title="(.*?)"><img.*?src="(.*?)"', link) listToReturn = [] rmode = "PlayC" # if mode=='ALLC': # rmode='PlayLive' listToReturn.append( { "name": "Peacetv Bangla", "url": "http://www.peacetvbangla.com/live_peacetv.html", "mode": rmode, "iconimage": "http://www.peacetvbangla.com/images/top-1.jpg", "isFolder": False, } ) for cname in match: imageurl = cname[2].replace(" ", "%20") url = cname[0] if imageurl.startswith("//"): imageurl = "http:" + imageurl if not imageurl.startswith("http"): imageurl = mainurl + "/" + imageurl if not url.startswith("http"): url = mainurl + url # print imageurl listToReturn.append({"name": cname[1], "url": url, "mode": rmode, "iconimage": imageurl, "isFolder": False}) return listToReturn
def getChannelsEnteries(Fromurl, PageNumber, mode): link = getURL(Fromurl).result #print 'getEnteriesList',link match = re.findall( '<li><a href="(.*?)" rel="bookmark" title="(.*?)"><img.*?src="(.*?)"', link) listToReturn = [] rmode = 'PlayC' #if mode=='ALLC': # rmode='PlayLive' for cname in match: imageurl = cname[2].replace(' ', '%20') url = cname[0] if not imageurl.startswith('http'): imageurl = mainurl + '/' + imageurl if not url.startswith('http'): url = mainurl + url #print imageurl listToReturn.append({ 'name': cname[1], 'url': url, 'mode': rmode, 'iconimage': imageurl, 'isFolder': False }) return listToReturn
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update( 10, "", "Finding links..", "" ) #print 'fetching url',url link=getURL(url).result; #print 'link',link progress.update( 30, "", "Finding links..", "" ) h=HTMLParser.HTMLParser() print 'link',link match= re.findall('ass="stremb">.*?href="(http.*?)"', link) if len(match)==0: progress.update( 60, "", "Finding links..", "" ) print 'match1',match match= re.findall('fid="(.*?)";', link) #print link,match print 'match2',match zzUrl="http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com"%(match[0]) else: print 'match3',match zzUrl=h.unescape(match[0]) print zzUrl,'zzURL' if len(zzUrl)==0: return None progress.update( 70, "", "Finding links..", "" ) refUrl=url print zzUrl,'zzURL','referer',refUrl #zzUrl="http://annanfsfjsdfjsdklfjdflkds.com" #link=getURL(zzUrl,referer=refUrl).result; req = urllib2.Request(zzUrl) print 'stage1' req.add_header('User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10') print 'stage2' req.add_header('Referer', refUrl) print 'stage3' response = urllib2.urlopen(req) print 'stage4' link=response.read() print 'stage5' response.close() progress.update( 90, "", "Finding links..", "" ) print 'link',link match= re.findall('SWFObject\(\'(.*?)\',.*?file\',\'(.*?)\'.*?streamer\',\'(.*?)\'', link, re.DOTALL) print 'match',match progress.update( 100, "", "Finding links..", "" ) if len(match)==0: return None return {'rtmp':match[0][2],'playpath':match[0][1],'swf':match[0][0]}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update( 10, "", "Finding links..", "" ) #print 'fetching url',url link=getURL(url).result; #print 'link',link progress.update( 30, "", "Finding links..", "" ) h=HTMLParser.HTMLParser() match= re.findall('<iframe name="ifram2" src="(.*?)"', link) if len(match)==0: progress.update( 60, "", "Finding links..", "" ) match= re.findall('fid="(.*?)";', link) #print link,match zzUrl="http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com"%(match[0]) else: zzUrl=h.unescape(match[0]) print zzUrl,'zzURL' if len(zzUrl)==0: return None #print zzUrl,'zzURL' progress.update( 70, "", "Finding links..", "" ) link=getURL(zzUrl,referer=url, mobile=True).result; #print link,zzUrl #link=zzUrl progress.update( 90, "", "Finding links..", "" ) #match= re.findall('SWFObject\(\'(.*?)\',.*file\',\'(.*?)\'.*streamer\',\'(.*?)\'', link, re.DOTALL) #match= re.findall('href="(http.*?playlist.*?)"', link) #print match #link=getURL(match[0][0],referer=url, mobile=True).result; match= re.findall('(http.*?)\\s', link, re.DOTALL) print match progress.update( 100, "", "Finding links..", "" ) if len(match)==0: return None return {'url':match[0]}
def getShowUrl(url): line1 = "Fetching URL" timeWait = 2000 xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, timeWait, __icon__)) link = getURL(url).result match = re.findall('<param name="flashvars" .*?vid=(.*?)&*.?pid=(.*?)"', link) vidId = match[0][0] pid = match[0][1] url = "http://www.pitelevision.com/index.php?option=com_allvideoshare&view=config&vid=%s&pid=%s&lang=en" % ( vidId, pid) #print 'url',url link = getURL(url).result # print url match = re.findall('<video>(.*?)<', link) #print 'lowmatch', match lowLink = '' if len(match) > 0: lowLink = match[0] match = re.findall('<hd>(.*?)<', link) hdLink = '' if len(match) > 0: hdLink = match[0] print 'Low and HD Link', lowLink, hdLink urlToPlay = '' if len(hdLink) > 0: urlToPlay = hdLink if len(urlToPlay) <= 0: urlToPlay = lowLink urlToPlay = urlToPlay.replace(" ", "%20") return {'url': urlToPlay} return
def getShowUrl(url): line1 = "Fetching URL" timeWait = 2000 xbmc.executebuiltin("Notification(%s, %s, %d, %s)" % (__addonname__, line1, timeWait, __icon__)) link = getURL(url).result match = re.findall('<param name="flashvars" .*?vid=(.*?)&*.?pid=(.*?)"', link) vidId = match[0][0] pid = match[0][1] url = "http://www.pitelevision.com/index.php?option=com_allvideoshare&view=config&vid=%s&pid=%s&lang=en" % ( vidId, pid, ) # print 'url',url link = getURL(url).result # print url match = re.findall("<video>(.*?)<", link) # print 'lowmatch', match lowLink = "" if len(match) > 0: lowLink = match[0] match = re.findall("<hd>(.*?)<", link) hdLink = "" if len(match) > 0: hdLink = match[0] print "Low and HD Link", lowLink, hdLink urlToPlay = "" if len(hdLink) > 0: urlToPlay = hdLink if len(urlToPlay) <= 0: urlToPlay = lowLink urlToPlay = urlToPlay.replace(" ", "%20") return {"url": urlToPlay} return
def getEnteriesList(Fromurl, PageNumber, mode): link = getURL(Fromurl).result #print 'getEnteriesList',link match = re.findall( '<div class="a.*href="(.*)"\'>\s*.*\s*.*src="(.*?)".*\s*.*?>(.*?)<', link) #print 'match',match listToReturn = [] rmode = 'PlayVOD' if mode == 'ALLC': rmode = 'PlayLive' for cname in match: #print cname[2] #addDir(cname[2] ,mainurl+cname[0] ,5,cname[1],isItFolder=False) imageurl = cname[1].replace(' ', '%20') url = cname[0] if not imageurl.startswith('http'): imageurl = mainurl + '/' + imageurl if not url.startswith('http'): url = mainurl + url #print imageurl listToReturn.append({ 'name': cname[2], 'url': url, 'mode': rmode, 'iconimage': imageurl, 'isFolder': False }) match = re.findall('<span class="pagenav">Next</span></li', link) match2 = re.findall('next', link) if len(match) == 0 and len(match2) > 0: url = Fromurl if len(PageNumber) > 0: pNumber = str(int(PageNumber) + 16) else: pNumber = '16' if 'limitstart' in url: url = url.split("&limitstart")[0] url += "&limitstart=" + pNumber #addDir('Next Page' , url ,4,'',pageNum=pNumber) listToReturn.append({ 'name': 'Next Page', 'url': url, 'mode': mode, 'iconimage': '' }) return listToReturn
def getLiveUrl(url): line1 = "Fetching Live URL" time = 2000 xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, time, __icon__)) #print 'fetching url',url link = getURL(url).result match = re.findall('flashvars="src=(.*?)\.f', link) #print 'match',match url = "" if len(match) > 0: url = match[0] + '.m3u8' #print 'url',url return {'url': url} return
def getChannelsEnteries(Fromurl,PageNumber,mode): link=getURL(Fromurl).result; #print 'getEnteriesList',link match =re.findall('<a target="_top" href=\"(.*?)\".*?title=\"(.*?)\".*?src=\"(.*?)\"', link) listToReturn=[] rmode='PlayC'; #if mode=='ALLC': # rmode='PlayLive' for cname in match: imageurl=cname[2].replace(' ','%20'); url=cname[0]; if not imageurl.startswith('http'): imageurl=mainurl+'/'+imageurl if not url.startswith('http'): url=mainurl+url #print imageurl listToReturn.append({'name':cname[1],'url':url,'mode':rmode,'iconimage':imageurl,'isFolder':False}) return listToReturn
def getLiveUrl(url): line1 = "Fetching Live URL" timeWait = 2000 xbmc.executebuiltin("Notification(%s, %s, %d, %s)" % (__addonname__, line1, timeWait, __icon__)) # print 'fetching url',url link = getURL(url).result match = re.findall('flashvars="src=(.*?)&', link) # print 'match',match url = "" if len(match) > 0: url = match[0] # +'.f4m'#url=match[0]+'.m3u8' # url='rtsp://202.125.131.170:554/pitelevision/starsports41' # print 'url',url return {"url": url} return
def getVODList(Fromurl,mode): link=getURL(Fromurl).result regstring='<div class="a.*href="(.*)"\'>\s*.*<h2><span>(.*?)<.*\s*.*src="(.*?)"' match =re.findall(regstring, link) #print match listToReturn=[] for cname in match: if mode=='VOD': modeToUse='VODSerial'; # series, 4=enteries if 'Music' in cname[1] or 'Films' in cname[1] or 'Telefilms' in cname[1] or 'Entertainment' in cname[1]: modeToUse='VODEntry' else: modeToUse='VODEntry'; #print modeToUse,cname[1] listToReturn.append({'name':cname[1],'url':mainurl+cname[0],'mode':modeToUse,'iconimage':cname[2].replace(' ','%20')}) return listToReturn;
def getLiveUrl(url): line1="Fetching Live URL"; time=2000 xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(__addonname__,line1, time, __icon__)) #print 'fetching url',url link=getURL(url).result; match= re.findall('flashvars="src=(.*?)\.f', link) #print 'match',match url="" if len(match)>0: url=match[0]+'.m3u8' #print 'url',url return {'url':url} return
def getLiveUrl(url): line1 = "Fetching Live URL" timeWait = 2000 xbmc.executebuiltin('Notification(%s, %s, %d, %s)' % (__addonname__, line1, timeWait, __icon__)) #print 'fetching url',url link = getURL(url).result match = re.findall('flashvars="src=(.*?)&', link) #print 'match',match url = "" if len(match) > 0: url = match[0] #+'.f4m'#url=match[0]+'.m3u8' #url='rtsp://202.125.131.170:554/pitelevision/starsports41' #print 'url',url return {'url': url} return
def getChannelsEnteries(Fromurl, PageNumber, mode): link = getURL(Fromurl).result # print 'getEnteriesList',link match = re.findall('<a target="_top" href="(.*?)".*title="(.*?)"><img src="(.*?)"', link) listToReturn = [] rmode = "PlayC" # if mode=='ALLC': # rmode='PlayLive' for cname in match: imageurl = cname[2].replace(" ", "%20") url = cname[0] if not imageurl.startswith("http"): imageurl = mainurl + "/" + imageurl if not url.startswith("http"): url = mainurl + url # print imageurl listToReturn.append({"name": cname[1], "url": url, "mode": rmode, "iconimage": imageurl, "isFolder": False}) return listToReturn
def getVODList(Fromurl, mode): link = getURL(Fromurl).result regstring = '<div class="a.*href="(.*)"\'>\s*.*<h2><span>(.*?)<.*\s*.*src="(.*?)"' match = re.findall(regstring, link) # print match listToReturn = [] for cname in match: if mode == "VOD": modeToUse = "VODSerial" # series, 4=enteries if "Music" in cname[1] or "Films" in cname[1] or "Telefilms" in cname[1] or "Entertainment" in cname[1]: modeToUse = "VODEntry" else: modeToUse = "VODEntry" # print modeToUse,cname[1] listToReturn.append( {"name": cname[1], "url": mainurl + cname[0], "mode": modeToUse, "iconimage": cname[2].replace(" ", "%20")} ) return listToReturn
def getChannelsEnteries(Fromurl,PageNumber,mode): link=getURL(Fromurl).result; #print 'getEnteriesList',link if mode=='IC': match =re.findall('<a.*?href="(.*?)".*?title="(.*?)".*?src="(.*?)"', link) else: match =re.findall('<li><a href="(.*?)" rel="bookmark" title="(.*?)"><img.*?src="(.*?)"', link) listToReturn=[] rmode='PlayC'; #if mode=='ALLC': # rmode='PlayLive' listToReturn.append({'name':"Peacetv Bangla",'url':"http://www.peacetvbangla.com/live_peacetv.html",'mode':rmode,'iconimage':"http://www.peacetvbangla.com/images/top-1.jpg",'isFolder':False}) for cname in match: imageurl=cname[2].replace(' ','%20'); url=cname[0]; if imageurl.startswith('//'): imageurl="http:"+imageurl if not imageurl.startswith('http'): imageurl=mainurl+'/'+imageurl if not url.startswith('http'): url=mainurl+url #print imageurl listToReturn.append({'name':cname[1],'url':url,'mode':rmode,'iconimage':imageurl,'isFolder':False}) return listToReturn
def getEnteriesList(Fromurl, PageNumber, mode): link = getURL(Fromurl).result # print 'getEnteriesList',link match = re.findall('<div class="a.*href="(.*)"\'>\s*.*\s*.*src="(.*?)".*\s*.*?>(.*?)<', link) # print 'match',match listToReturn = [] rmode = "PlayVOD" if mode == "ALLC": rmode = "PlayLive" for cname in match: # print cname[2] # addDir(cname[2] ,mainurl+cname[0] ,5,cname[1],isItFolder=False) imageurl = cname[1].replace(" ", "%20") url = cname[0] if not imageurl.startswith("http"): imageurl = mainurl + "/" + imageurl if not url.startswith("http"): url = mainurl + url # print imageurl listToReturn.append({"name": cname[2], "url": url, "mode": rmode, "iconimage": imageurl, "isFolder": False}) match = re.findall('<span class="pagenav">Next</span></li', link) match2 = re.findall("next", link) if len(match) == 0 and len(match2) > 0: url = Fromurl if len(PageNumber) > 0: pNumber = str(int(PageNumber) + 16) else: pNumber = "16" if "limitstart" in url: url = url.split("&limitstart")[0] url += "&limitstart=" + pNumber # addDir('Next Page' , url ,4,'',pageNum=pNumber) listToReturn.append({"name": "Next Page", "url": url, "mode": mode, "iconimage": ""}) return listToReturn
def getChannelsEnteries(Fromurl, PageNumber, mode): link = getURL(Fromurl).result #print 'getEnteriesList',link if mode == 'IC': match = re.findall('<a.*?href="(.*?)".*?title="(.*?)".*?src="(.*?)"', link) else: match = re.findall( '<li><a href="(.*?)" rel="bookmark" title="(.*?)"><img.*?src="(.*?)"', link) listToReturn = [] rmode = 'PlayC' #if mode=='ALLC': # rmode='PlayLive' listToReturn.append({ 'name': "Peacetv Bangla", 'url': "http://www.peacetvbangla.com/live_peacetv.html", 'mode': rmode, 'iconimage': "http://www.peacetvbangla.com/images/top-1.jpg", 'isFolder': False }) for cname in match: imageurl = cname[2].replace(' ', '%20') url = cname[0] if imageurl.startswith('//'): imageurl = "http:" + imageurl if not imageurl.startswith('http'): imageurl = mainurl + '/' + imageurl if not url.startswith('http'): url = mainurl + url #print imageurl listToReturn.append({ 'name': cname[1], 'url': url, 'mode': rmode, 'iconimage': imageurl, 'isFolder': False }) return listToReturn
def getEnteriesList(Fromurl, PageNumber, mode): link = getURL(Fromurl).result # print 'getEnteriesList',link listToReturn = [] links = link.split('<div class="col-md-12">') rmode = "PlayVOD" for lnk in links: if "<h1>" in lnk: pat = "<h1>(.*?)<\/h1>" # print lnk SName = re.findall(pat, lnk)[0] match = re.findall('<a href="(.*)" class="ajax"><img src="(.*?)".*?\s*.*title">(.*?)<', lnk) listToReturn.append( { "name": SName, "url": "http://ignoreme", "mode": "ignore", "iconimage": "http://ignoreme", "isFolder": False, } ) for cname in match: # print cname[2] # addDir(cname[2] ,mainurl+cname[0] ,5,cname[1],isItFolder=False) imageurl = cname[1].replace(" ", "%20") url = cname[0] if not imageurl.startswith("http"): imageurl = mainurl + "/" + imageurl if not url.startswith("http"): url = mainurl + url # print imageurl listToReturn.append( {"name": " " + cname[2], "url": url, "mode": rmode, "iconimage": imageurl, "isFolder": False} ) if "Page " in link: # print 'ppppppppppppppppppage' try: patt = "Page ([0-9]*) of ([0-9]*)" match = re.findall(patt, link) currentPage = match[0][0] lastPage = match[0][1] # print 'currentPage',currentPage url = Fromurl nextPage = "" previousPage = "" prevurl = "" if not currentPage == lastPage: nextPage = ">>Next Page" nextPageNum = int(currentPage) + 1 nexturl = url.split("page=")[0] + "page=" + str(nextPageNum) if not currentPage == "1": previousPage = "<<<< Previous Page" nextPageNum = int(currentPage) - 1 prevurl = url.split("page=")[0] + "page=" + str(nextPageNum) p = "Page %s of %s" p = p % (currentPage, lastPage) currentpage = "[COLOR FF11b500]" + p + "[/COLOR]" prevpage = "[COLOR FF11b500]" + previousPage + "[/COLOR]" # addDir('Next Page' , url ,4,'',pageNum=pNumber) listToReturn.insert(0, {"name": currentpage, "url": nexturl, "mode": "null", "iconimage": ""}) listToReturn.append({"name": currentpage, "url": nexturl, "mode": "null", "iconimage": ""}) if not nextPage == "": nextpage = "[COLOR FF11b500]" + nextPage + "[/COLOR]" listToReturn.insert(1, {"name": nextpage, "url": nexturl, "mode": mode, "iconimage": ""}) listToReturn.append({"name": nextpage, "url": nexturl, "mode": mode, "iconimage": ""}) if not prevurl == "": listToReturn.insert(1, {"name": prevpage, "url": prevurl, "mode": mode, "iconimage": ""}) listToReturn.append({"name": prevpage, "url": prevurl, "mode": mode, "iconimage": ""}) except: traceback.print_exc() return listToReturn
def getpeacetvbangla ( url ): link=getURL(url, mobile=False).result; reg="file=(.*?)&.*streamer=(.*?)&" fl,st=re.findall(reg,link)[0] return {'url':'%s playpath=%s'%(st,fl)}
def getLiveUrl(url): progress = xbmcgui.DialogProgress() progress.create('Progress', 'Fetching Streaming Info') progress.update(10, "", "Finding links..", "") #print 'fetching url',url link = getURL(url).result #print 'link',link progress.update(30, "", "Finding links..", "") h = HTMLParser.HTMLParser() print 'link', link match = re.findall('ass="stremb">.*?href="(http.*?)"', link) if len(match) == 0: progress.update(60, "", "Finding links..", "") print 'match1', match match = re.findall('fid="(.*?)";', link) #print link,match print 'match2', match zzUrl = "http://www.zzcast.com/embed.php?u=%s&vw=600&vh=400&domain=www.jagobd.com" % ( match[0]) else: print 'match3', match zzUrl = h.unescape(match[0]) print zzUrl, 'zzURL' if len(zzUrl) == 0: return None progress.update(70, "", "Finding links..", "") refUrl = url print zzUrl, 'zzURL', 'referer', refUrl #zzUrl="http://annanfsfjsdfjsdklfjdflkds.com" #link=getURL(zzUrl,referer=refUrl).result; req = urllib2.Request(zzUrl) print 'stage1' req.add_header( 'User-Agent', 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10' ) print 'stage2' req.add_header('Referer', refUrl) print 'stage3' response = urllib2.urlopen(req) print 'stage4' link = response.read() print 'stage5' response.close() progress.update(90, "", "Finding links..", "") print 'link', link match = re.findall( 'SWFObject\(\'(.*?)\',.*?file\',\'(.*?)\'.*?streamer\',\'(.*?)\'', link, re.DOTALL) print 'match', match progress.update(100, "", "Finding links..", "") if len(match) == 0: return None return {'rtmp': match[0][2], 'playpath': match[0][1], 'swf': match[0][0]}
def getEnteriesList(Fromurl, PageNumber, mode): link = getURL(Fromurl).result #print 'getEnteriesList',link listToReturn = [] links = link.split('<div class="col-md-12">') rmode = 'PlayVOD' for lnk in links: if '<h1>' in lnk: pat = '<h1>(.*?)<\/h1>' # print lnk SName = re.findall(pat, lnk)[0] match = re.findall( '<a href="(.*)" class="ajax"><img src="(.*?)".*?\s*.*title">(.*?)<', lnk) listToReturn.append({ 'name': SName, 'url': 'http://ignoreme', 'mode': 'ignore', 'iconimage': 'http://ignoreme', 'isFolder': False }) for cname in match: #print cname[2] #addDir(cname[2] ,mainurl+cname[0] ,5,cname[1],isItFolder=False) imageurl = cname[1].replace(' ', '%20') url = cname[0] if not imageurl.startswith('http'): imageurl = mainurl + '/' + imageurl if not url.startswith('http'): url = mainurl + url #print imageurl listToReturn.append({ 'name': ' ' + cname[2], 'url': url, 'mode': rmode, 'iconimage': imageurl, 'isFolder': False }) if 'Page ' in link: # print 'ppppppppppppppppppage' try: patt = 'Page ([0-9]*) of ([0-9]*)' match = re.findall(patt, link) currentPage = match[0][0] lastPage = match[0][1] # print 'currentPage',currentPage url = Fromurl nextPage = '' previousPage = '' prevurl = '' if not currentPage == lastPage: nextPage = '>>Next Page' nextPageNum = int(currentPage) + 1 nexturl = url.split('page=')[0] + 'page=' + str(nextPageNum) if not currentPage == "1": previousPage = '<<<< Previous Page' nextPageNum = int(currentPage) - 1 prevurl = url.split('page=')[0] + 'page=' + str(nextPageNum) p = 'Page %s of %s' p = p % (currentPage, lastPage) currentpage = '[COLOR FF11b500]' + p + '[/COLOR]' prevpage = '[COLOR FF11b500]' + previousPage + '[/COLOR]' #addDir('Next Page' , url ,4,'',pageNum=pNumber) listToReturn.insert( 0, { 'name': currentpage, 'url': nexturl, 'mode': 'null', 'iconimage': '' }) listToReturn.append({ 'name': currentpage, 'url': nexturl, 'mode': 'null', 'iconimage': '' }) if not nextPage == '': nextpage = '[COLOR FF11b500]' + nextPage + '[/COLOR]' listToReturn.insert( 1, { 'name': nextpage, 'url': nexturl, 'mode': mode, 'iconimage': '' }) listToReturn.append({ 'name': nextpage, 'url': nexturl, 'mode': mode, 'iconimage': '' }) if not prevurl == '': listToReturn.insert( 1, { 'name': prevpage, 'url': prevurl, 'mode': mode, 'iconimage': '' }) listToReturn.append({ 'name': prevpage, 'url': prevurl, 'mode': mode, 'iconimage': '' }) except: traceback.print_exc() return listToReturn
def getpeacetvbangla(url): link = getURL(url, mobile=False).result reg = "file=(.*?)&.*streamer=(.*?)&" fl, st = re.findall(reg, link)[0] return {'url': '%s playpath=%s' % (st, fl)}