def SEARCHSHOWOLD(url): if settings.getSetting('tmovies_account') == 'true': net.set_cookies(cookiejar) link = OPEN_URL(url) match=re.compile('<a href="(.+?)">\r\n <img src=".+?" data-original="(.+?)" class=".+?" style=".+?" border=".+?" height=".+?" width=".+?" alt="Watch (.+?) Online for Free">\r\n').findall(link) if len(match) > 0: for url,sitethumb,name in match: matchyear=re.compile('<div class="filmyar"><a class="filmyar" href="http://'+domain+'/browse_tv_shows/all/byViews/.+?/">(.+?)</a>').findall(link) if len(match) > 0: for year in matchyear: data = main.GRABTVMETA(name,year) thumb = data['cover_url'] types = 'tvshow' if 'watch_tv_show' in url: main.addTVDir(name+'('+year+')',url,'episodes',thumb,data,types,'') main.AUTO_VIEW('tvshows')
def TVPLAYYEAR (url): if settings.getSetting('tmovies_account') == 'true': net.set_cookies(cookiejar) link = OPEN_URL(url) match=re.compile('<a href="(.+?)" title=".+?">\r\n <img src="(.+?)" class=".+?" style=".+?" border=".+?" height=".+?" width=".+?" alt="Watch (.+?) Online for Free">\r\n').findall(link) if len(match) > 0: for url,sitethumb,name in match: matchyear=re.compile('<a class="filmyar" href="http://'+domain+'/browse_tv_shows/all/byViews/(.+?)/">\r\n').findall(link) if len(matchyear) > 0: for year in matchyear: data = main.GRABTVMETA(name,year) thumb = data['cover_url'] types = 'tvshow' main.addSDir(name+'('+year+')',url,'episodes',thumb,'',types,data) nmatch=re.compile('<a id="next" class=".+?" href="(.+?)">Next »</a>').findall(link) if len(nmatch) > 0: main.addDir('Next Page',(nmatch[0]),'tvplayyear',artwork + '/tvshows/nextpage.png','','dir',1) main.AUTO_VIEW('tvshow')
def NDMODE(mname,murl): link=OPEN_URL(murl) #link=OPEN_URL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<poster>(.+?)</poster>',link) if r: vip=r[0] else: vip='' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fanart=f[0] else: fanart='' #print 'FANART IS ' +fanart md=re.findall('<meta>(.+?)</meta>',link) if md: mymeta=md[0] else: mymeta='' srt=re.findall('<sort>(.+?)</sort>',link) if srt: mysort=srt[0] else: mysort='' #print "SORT METHOD IS = " +mysort info=re.findall('<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail></popup>').findall(link) for name,image,thumb in popup: main.addDir(name,image,'vpop',thumb,fanart,'','','') directory=re.compile('<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail><fanart>([^<]+)</fanart></dir>').findall(link) #for name,url,thumb,fanart in directory: for name,url,thumb,fanart2 in directory: main.addDir(name,url,'ndmode',thumb,fanart2,'','','') directory2=re.compile('<dir><name>([^<]+)</name.+?link>([^<]+)</link.+?thumbnail>([^<]+)</thumbnail></dir>').findall(link) for name,url,thumb in directory2: main.addDir(name,url,'ndmode',thumb,fanart,'','','') match=re.compile('<title>([^<]+)</title.+?link>(.+?)</link.+?thumbnail>([^<]+)</thumbnail>').findall(link) if mysort=='yes': for name,url,thumb in sorted(match): sitethumb = thumb data = '' if getinfo == 'true' and mymeta =='movies': try: inc = 0 movie_name = name[:-6] year = name[-6:] movie_name = movie_name.decode('UTF-8','ignore') data = main.GRABMETA(movie_name,year) thumb = data['cover_url'] yeargrab = data['year'] year = str(yeargrab) if thumb == '': thumb = sitethumb except:return if getinfo == 'true' and mymeta =='tv': try: inc = 0 #movie_name = name[:-6] #year = name[-6:] name = name.decode('UTF-8','ignore') data = main.GRABTVMETA(name,'') thumb = data['cover_url'] #yeargrab = data['year'] #year = str(yeargrab) if thumb == '': thumb = sitethumb except:return if 'sublink' in url: main.addDir(name,url,'sublinks',thumb,fanart,'','','') else: favtype = 'movie' #print "DL DIR THUMBNAIL IS =" +thumb main.addDLDir(name,url,'linkmode',thumb,fanart,'','',data,isFolder=False, isPlayable=True) else: for name,url,thumb in match: sitethumb = thumb data = '' if getinfo == 'true' and mymeta =='movies': try: inc = 0 movie_name = name[:-6] year = name[-6:] movie_name = movie_name.decode('UTF-8','ignore') data = main.GRABMETA(movie_name,year) thumb = data['cover_url'] yeargrab = data['year'] year = str(yeargrab) if thumb == '': thumb = sitethumb except:return if getinfo == 'true' and mymeta =='tv': try: inc = 0 #movie_name = name[:-6] #year = name[-6:] name = name.decode('UTF-8','ignore') data = main.GRABTVMETA(name,'') thumb = data['cover_url'] #yeargrab = data['year'] #year = str(yeargrab) if thumb == '': thumb = sitethumb except:return if 'sublink' in url: main.addDir(name,url,'sublinks',thumb,fanart,'','','') else: favtype = 'movie' #print "DL DIR THUMBNAIL IS =" +thumb main.addDLDir(name,url,'linkmode',thumb,fanart,'','',data,isFolder=False, isPlayable=True)
def DMODE(murl): link=OPEN_URL(murl) #link=OPEN_URL(murl) link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') r=re.findall('<poster>(.+?)</poster>',link) if r: vip=r[0] else: vip='' f=re.findall('<fanart>(.+?)</fanart>',link) if f: fanart=f[0] else: fanart='' #print 'FANART IS ' +fanart md=re.findall('<meta>(.+?)</meta>',link) if md: mymeta=md[0] else: mymeta='' srt=re.findall('<sort>(.+?)</sort>',link) if srt: mysort=srt[0] else: mysort='' #print "SORT METHOD IS = " +mysort match=re.compile('<notify><new>(.+?)</new><message1>(.+?)</message1><message2>(.+?)</message2><message3>(.+?)</message3><old>(.+?)</old></notify>').findall(link) if len(match)>0: for new,mes1,mes2,mes3,old in match: continue if new != ' ': new=vip+new onetime=os.path.join(main.datapath,'OneTime') notified=os.path.join(onetime,str(new)) if not os.path.exists(notified): open(notified,'w').write('version="%s",'%new) dialog = xbmcgui.Dialog() ok=dialog.ok('[B] Announcement From '+vip+'![/B]', str(mes1) ,str(mes2),str(mes3)) if old != ' ': old=vip+old notified=os.path.join(onetime,str(old)) if os.path.exists(notified): os.remove(notified) else: print 'No Messages' else: print 'Link Down' match3=re.compile('<name>([^<]+)</name><link>([^<]+)</link><thumbnail>([^<]+)</thumbnail><mode>([^<]+)</mode>').findall(link) if mysort == 'yes': for name,url,thumb,mode in sorted(match3): if re.findall('http',thumb): thumbs=thumb else: thumbs=art+'/'+thumb+'.png' data = '' if getinfo == 'true' and mymeta =='movies': try: inc = 0 movie_name = name[:-6] year = name[-6:] movie_name = movie_name.decode('UTF-8','ignore') data = main.GRABMETA(movie_name,year) thumb = data['cover_url'] yeargrab = data['year'] year = str(yeargrab) except:return elif getinfo == 'true' and mymeta =='tv': try: inc = 0 #movie_name = name[:-6] #year = name[-6:] name = name.decode('UTF-8','ignore') data = main.GRABTVMETA(name,'') thumb = data['cover_url'] #yeargrab = data['year'] #year = str(yeargrab) except:return favtype = 'movie' main.addDir(name,url,mode,thumbs,fanart,data,favtype,'') else: for name,url,thumb,mode in match3: if re.findall('http',thumb): thumbs=thumb else: thumbs=art+'/'+thumb+'.png' data = '' if getinfo == 'true' and mymeta =='movies': try: inc = 0 movie_name = name[:-6] year = name[-6:] movie_name = movie_name.decode('UTF-8','ignore') data = main.GRABMETA(movie_name,year) thumb = data['cover_url'] yeargrab = data['year'] year = str(yeargrab) except:return elif getinfo == 'true' and mymeta =='tv': try: inc = 0 #movie_name = name[:-6] #year = name[-6:] name = name.decode('UTF-8','ignore') data = main.GRABTVMETA(name,'') thumb = data['cover_url'] #yeargrab = data['year'] #year = str(yeargrab) except:return favtype = 'movie' main.addDir(name,url,mode,thumbs,fanart,data,favtype,'') match=re.compile('<name>([^<]+)</name><link>([^<]+)</link><thumbnail>([^<]+)</thumbnail><date>([^<]+)</date>').findall(link) for name,url,thumb,date in match: main.addDir(name+' [COLOR red] Updated '+date+'[/COLOR]',url,'ndmode',thumb,fanart,'','','') info=re.findall('<info><message>(.+?)</message><thumbnail>(.+?)</thumbnail></info>',link) if info: for msg,pic in info: main.addLink(msg,'',pic) popup=re.compile('<popup><name>([^<]+)</name.+?popImage>([^<]+)</popImage.+?thumbnail>([^<]+)</thumbnail.+?sound>([^<]+)</sound></popup>').findall(link) for name,image,thumb,sound in popup: main.addDir(name,image,'vpop',thumb,fanart,'','',sound)
def TVLINKPAGE(url,name,thumb,mainimg): params = {'url':url, 'mode':mode, 'name':name, 'thumb':thumb, 'dlfoldername':dlfoldername,'mainimg':mainimg} inc = 0 mainimg = mainimg showname = name if settings.getSetting('tmovies_account') == 'true': net.set_cookies(cookiejar) link = net.http_GET(url).content link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','') match=re.compile('href="http://twomovies.name/full_movie(.+?)"target="_blank"').findall(link) #match=re.compile('href="(.+?)" target=".+?" rel=".+?" onclick=".+?">Full Movie</a>').findall(link) for url in match: url = 'http://twomovies.name/full_movie'+url '''if inc < 50: link = net.http_GET(url).content urls=re.compile('<iframe.*?src="(http://.+?)".*?>').findall(link) hmf = urlresolver.HostedMediaFile(urls[0])''' if inc < 50: #This gets around the Continue Button link = net.http_GET(url).content conmatch=re.compile('/>Please click (.+?):</p>').findall(link) #formmatch=re.compile('input class="(.+?)" type="(.+?)" value="(.+?)" name="(.+?)" /').findall(link) for button in conmatch: if 'continue button' in conmatch: conmatch =str(conmatch) print 'Button SAYS ' +conmatch url = url header_dict = {} header_dict['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' header_dict['Connection'] = 'keep-alive' header_dict['Content-Type'] = 'application/x-www-form-urlencoded' header_dict['Host'] = 'twomovies.name' header_dict['Referer'] = url header_dict['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36' form_data = {'confirm':'Continue'} net.set_cookies(cookiejar) conbutton = net.http_POST(url, form_data=form_data,headers=header_dict) #This gets around the Continue Button #link = net.http_GET(url).content matchurl=re.compile('go=(.+?)"').findall(link) #print 'MY LINK URL IS '+ urls for urls in matchurl: ################srting conversion######################## urls = str(urls) print 'LINK URL AFTER STRING is' +urls ##################Try to replace urlparts################## urls = urls.replace('&rel=nofollow','') ########################################## #returns true or false media file resolve hmf = urlresolver.HostedMediaFile(urls) ########################################## if hmf: host = hmf.get_host() hthumb = main.GETHOSTTHUMB(host) #dlurl = urlresolver.resolve(url) data = main.GRABTVMETA(showname,'') thumb = data['cover_url'] favtype = 'tvshows' try: main.addTVDLDir(showname,urls,'vidpage',hthumb,data,dlfoldername,favtype,mainimg) inc +=1 except: continue