def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'www.einthusan.com', 'Origin': 'http://www.einthusan.com', 'Referer': 'http://www.einthusan.com/index.php?lang=hindi', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36'} net.http_GET('http://www.einthusan.com/etc/login.php') net.http_POST('http://www.einthusan.com/etc/login.php', {'username': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) name = self.CleanTextForSearch(name) import urllib movie_url=self.GoogleSearchByTitleReturnFirstResultOnlyIfValid('einthusan.com', name, 'watch.php', item_count=10, title_extrctr='(.+?) (?:Hindi|hindi|Tamil|tamil|Telugu|telugu|Malayalam|malayalam) movie') if movie_url: self.GetFileHosts(movie_url, list, lock, message_queue)
def Resolve(self, url): import re from entertainment.net import Net net = Net(user_agent=self.UA) url = url.replace('muchmovies.org', 'umovies.me') try: net.set_cookies(self.cookie_file) content = net.http_GET(url).content print '##########################' print 'NET' except: from entertainment import cloudflare content = cloudflare.solve(url, self.cookie_file, self.UA) content = content.replace('\n', '') link = content.split('href=') for p in link: if '.mp4' in p: resolved_media_url = re.compile('"(.+?)"').findall(p)[0] host = resolved_media_url.split('//')[1] host = host.split('/')[0] cookie = open(self.cookie_file).read() __cfduid = re.compile('__cfduid=(.+?);').findall(cookie)[0] cf_clearance = re.compile('cf_clearance="(.+?)"').findall( cookie)[0] COOKIE = '__cfduid=%s; cf_clearance=%s' % (__cfduid, cf_clearance) resolved_media_url = resolved_media_url + '|User-Agent=' + self.UA + '&Referrer=' + url + '&host=' + host + '&Cookie=' + COOKIE print resolved_media_url return resolved_media_url
def Resolve(self, url): import re from entertainment.net import Net net = Net(cached=False) common.addon.log( self.name.upper() + ' - Link: %s' % url ) common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]', 'Resolving', 700, self.icon) html = net.http_GET(url).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) try: if not re.search(r'value=\"Continue to video',html,re.I): raise Exception ('File Not Found') html = net.http_POST(url,form_data={'Continue':'Continue to video'}, headers={'Content-Type':'application/x-www-form-urlencoded'} ).content finalLink = re.search(r'var\sxxxx\s\=\s\"(.*?)\"',html) if finalLink: return finalLink.group(1) else: raise Exception ('No Media Found To Stream') except Exception, e: common.addon.log(self.name.upper() + ' - Exception occured: %s' % e) common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]', '[COLOR red]'+str(e)+'[/COLOR]', 3000, self.icon) return None
def GetContent(self, indexer, url, title, name, year, season, episode, type, list): import urllib url = urllib.unquote_plus(url) title = urllib.unquote_plus(title) name = urllib.unquote_plus(name) name = (name).lower() import re from entertainment.net import Net net = Net(cached=False) net.set_cookies(self.cookie_file) content = net.http_GET(url).content if type == 'tv_seasons': match=re.compile('<br><br><b>(.+?)x').findall(content) for seasonnumber in match: item_title = 'Season ' + seasonnumber item_id = common.CreateIdFromString(title + ' ' + item_title) self.AddContent(list, indexer, common.mode_Content, item_title, item_id, 'tv_episodes', url=url, name=name, season=seasonnumber) elif type == 'tv_episodes': match=re.compile("<br><b>"+season+"x(.+?)\s-\s<a style=.+?color.+?\shref='/(.+?)'>(.+?)</a>").findall(content) for item_v_id_2,url,item_title in match: season = "0%s"%season if len(season)<2 else season item_v_id_2 = "0%s"%item_v_id_2 if len(item_v_id_2)<2 else item_v_id_2 item_url = self.base_url + url item_v_id_2 = str(int(item_v_id_2)) self.AddContent(list, indexer, common.mode_File_Hosts, item_title, item_id, type, url=item_url, name=name, season=season, episode=item_v_id_2)
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): from entertainment.net import Net net = Net(user_agent=self.UA) title = self.CleanTextForSearch(title) name = self.CleanTextForSearch(name) search_term = name.replace(' ','-')+'-'+year import re url='http://umovies.me/search/'+search_term try: net.set_cookies(self.cookie_file) link = net.http_GET(url).content print '##########################' print 'NET' except: from entertainment import cloudflare link = cloudflare.solve(url,self.cookie_file,self.UA) match = re.compile('lass="movies list inset">.+?href="(.+?)">.+?class="label">(.+?)<',re.DOTALL).findall(link) for movie_url, TITLE in match: if year in TITLE: self.GetFileHosts('http://umovies.me'+movie_url, list, lock, message_queue)
def Resolve(self, url): import re from entertainment.net import Net net = Net(user_agent=self.UA) url=url.replace('muchmovies.org','umovies.me') try: net.set_cookies(self.cookie_file) content = net.http_GET(url).content print '##########################' print 'NET' except: from entertainment import cloudflare content=cloudflare.solve(url,self.cookie_file,self.UA) content = content.replace('\n','') link=content.split('href=') for p in link: if '.mp4' in p: resolved_media_url = re.compile('"(.+?)"').findall(p)[0] host =resolved_media_url.split('//')[1] host = host.split('/')[0] cookie =open(self.cookie_file).read() __cfduid =re.compile('__cfduid=(.+?);').findall(cookie)[0] cf_clearance =re.compile('cf_clearance="(.+?)"').findall(cookie)[0] COOKIE = '__cfduid=%s; cf_clearance=%s' % (__cfduid,cf_clearance) resolved_media_url = resolved_media_url+'|User-Agent='+self.UA+'&Referrer='+url+'&host='+host+'&Cookie='+COOKIE print resolved_media_url return resolved_media_url
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): from entertainment.net import Net net = Net(user_agent=self.UA) title = self.CleanTextForSearch(title) name = self.CleanTextForSearch(name) search_term = name.replace(' ', '-') + '-' + year import re url = 'http://umovies.me/search/' + search_term try: net.set_cookies(self.cookie_file) link = net.http_GET(url).content print '##########################' print 'NET' except: from entertainment import cloudflare link = cloudflare.solve(url, self.cookie_file, self.UA) match = re.compile( 'lass="movies list inset">.+?href="(.+?)">.+?class="label">(.+?)<', re.DOTALL).findall(link) for movie_url, TITLE in match: if year in TITLE: self.GetFileHosts('http://umovies.me' + movie_url, list, lock, message_queue)
def Resolve(self, url): print url import re from entertainment.net import Net net = Net(cached=False,user_agent='Apple-iPhone/') tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') loginurl = 'http://hdtvshows.net/reg.php' html = net.http_GET(loginurl).content match=re.compile('name="Token(.+?)" value="(.+?)"').findall(html) _Token=re.compile('name="data\[\_Token\]\[fields\]" value="(.+?)"').findall(html)[0] data = {'_method':'POST','subscriptionsPass': tv_pwd, 'UserUsername': tv_user, 'Token'+match[0][0]:'login','data[_Token][fields]':_Token} headers = {'Host':'hdtvshows.net', 'Origin':'http://hdtvshows.net', 'Referer':'http://hdtvshows.net/login.php', 'X-Requested-With':'XMLHttpRequest'} html = net.http_POST(loginurl, data, headers) cookie_jar = os.path.join(cookie_path, "hdtvshows.lwp") if os.path.exists(cookie_path) == False: os.makedirs(cookie_path) net.save_cookies(cookie_jar) net.set_cookies(cookie_jar) html = net.http_GET(url).content match=re.compile('<video id="ipadvideo" src="(.+?)"').findall(html) return match[0].replace('|','%7C')
def GetContent(self, indexer, url, title, name, year, season, episode, type, list): import urllib url = urllib.unquote_plus(url) title = urllib.unquote_plus(title) name = urllib.unquote_plus(name) name = (name).lower() import re from entertainment.net import Net net = Net(cached=False) net.set_cookies(self.cookie_file) content = net.http_GET(url).content if type == 'tv_seasons': match=re.compile('<br><br><b>(.+?)x').findall(content) for seasonnumber in match: item_title = 'Season ' + seasonnumber item_id = common.CreateIdFromString(title + ' ' + item_title) self.AddContent(list, indexer, common.mode_Content, item_title, item_id, 'tv_episodes', url=url, name=name, season=seasonnumber) elif type == 'tv_episodes': match=re.compile("<br><b>"+season+"x(.+?)\s-\s<a style=.+?color.+?\shref='/(.+?)'>(.+?)</a>").findall(content) for item_v_id_2,url,item_title in match: season = "0%s"%season if len(season)<2 else season item_v_id_2 = "0%s"%item_v_id_2 if len(item_v_id_2)<2 else item_v_id_2 item_url = self.base_url + url item_v_id_2 = str(int(item_v_id_2)) item_id = common.CreateIdFromString(name + '_season_' + season + '_episode_' + item_v_id_2) self.AddContent(list, indexer, common.mode_File_Hosts, item_title, item_id, type, url=item_url, name=name, season=season, episode=item_v_id_2)
def GetFileHosts(self, url, list, lock, message_queue): import re from entertainment.net import Net net = Net( user_agent= 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25' ) net.set_cookies(self.cookie_file) content = net.http_GET(url).content r = "<source src='(.+?)' type='(.+?)'>" match = re.compile(r).findall(content) for url, res in match: url = '%s|User-Agent=%s&Cookie=%s' % ( url, urllib.quote_plus( 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36' ), urllib.quote_plus('video=true')) quality = 'HD' if 'video/mp4' in res: quality = 'HD' else: quality = 'SD' self.AddFileHost(list, quality, url, 'ORORO.TV')
def Resolve(self, url): from entertainment.net import Net from entertainment import cloudflare import re #print url UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36' net = Net(cached=False, user_agent=UA) try: net.set_cookies(self.cookie_file) result = net.http_GET(url).content net.save_cookies(self.cookie_file) except: result = cloudflare.solve(url, self.cookie_file, UA) #print result.encode('ascii','ignore') stream = re.compile('return\("(.+?)"').findall(result)[0] final = stream.split('://')[1] host = final.split('/')[0] #cf_clearance=re.compile('cf_clearance=(.+?);').findall(open(self.cookie_file).read())[0] #cfduid=re.compile('cfduid=(.+?);').findall(open(self.cookie_file).read())[0] #AND='|Host=%s&User-Agent=%s&Referrer=%s&Connection=keep-alive&Cookie=cfduid=%s;' %(host,UA,url,cfduid) return stream #+AND
def GetFileHosts(self, url, list, lock, message_queue): import re from entertainment.net import Net net = Net(do_not_cache_if_any=do_no_cache_keywords_list) net._cached = False tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') loginurl = 'https://directdownload.tv' data = { 'password': tv_pwd, 'username': tv_user, 'Login': '******', 'mode': 'normal' } headers = { 'Referer': 'https://directdownload.tv', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded', 'Host': 'directdownload.tv', 'Origin': 'http://directdownload.tv', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36' } net.http_POST(loginurl, data, headers).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) content = net.http_GET(url).content r = '{"url":"(.+?)","hostname":".+?"}' match = re.compile(r).findall(content) urlselect = [] for url in match: #print url if url not in urlselect: urlselect.append(url) quality = 'SD' url_lower = '.' + url.lower() + '.' for quality_key, quality_value in common.quality_dict.items(): if re.search('[^a-zA-Z0-0]' + quality_key + '[^a-zA-Z0-0]', url_lower): quality = quality_value break self.AddFileHost(list, quality, url.replace('\/', '/'))
def GetFileHosts(self, url, list, lock, message_queue): import re from entertainment.net import Net net = Net(cached=False) net.set_cookies(self.cookie_file) content = net.http_GET(url).content resolved_url = re.compile("{ 'file': '(.+?)'").findall(content)[0] self.AddFileHost(list, 'HD', resolved_url,'EINTHUSAN.COM')
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): if os.path.exists(common.cookies_path) == False: os.makedirs(common.cookies_path) import re from entertainment.net import Net net = Net( cached=False, user_agent= 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25' ) title = self.CleanTextForSearch(title) name = self.CleanTextForSearch(name) main_url = self.base_url helper = '%s (%s)' % (name, year) if type == 'movies': self.login() url = 'http://ororo.tv/nl/movies' html = net.http_GET(url).content net.save_cookies(self.cookie_file) name_lower = common.CreateIdFromString(name) r = '<span class=\'value\'>(\d{4}).*?href="([^"]+)[^>]+>([^<]+)' match = re.compile(r, re.DOTALL).findall(html) for item_year, item_url, item_title in match: item_title = item_title.lower() if item_title in name_lower: self.GetFileHosts(item_url, list, lock, message_queue) elif type == 'tv_episodes': self.login() name_lower = common.CreateIdFromString(name) name_lower = name_lower.replace('_', '-') title_url = 'http://ororo.tv/en/shows/' + name_lower net.set_cookies(self.cookie_file) html2 = net.http_GET(title_url).content net.save_cookies(self.cookie_file) r = '%s-%s' % (season, episode) match = re.compile( 'data-href="(.+?)".+?class="episode" href="#(.+?)">').findall( html2) for item_url, passer in match: item_url = 'http://ororo.tv/' + item_url if r in passer: self.GetFileHosts(item_url, list, lock, message_queue)
def Resolve(self, url): try: from entertainment.net import Net net = Net(cached=False) import os cookie_file = os.path.join(common.cookies_path, 'realdebrid.lwp') if net.set_cookies(cookie_file) == False: import urllib credentials = urllib.urlencode({'user' : self.Settings().get_setting('realdebrid-username'), 'pass' : self.Settings().get_setting('realdebrid-password')}) content = net.http_GET(self.base_url + 'ajax/login.php?' + credentials ).content net.save_cookies(cookie_file) elif 'My Account' not in net.http_GET(self.base_url).content: import urllib credentials = urllib.urlencode({'user' : self.Settings().get_setting('realdebrid-username'), 'pass' : self.Settings().get_setting('realdebrid-password')}) content = net.http_GET(self.base_url + 'ajax/login.php?' + credentials ).content net.save_cookies(cookie_file) content = net.http_GET(self.base_url + 'ajax/unrestrict.php?link=' + url).content import re r = re.search('[\'"]{1}main_link[\'"]{1}\:[\'"]{1}(.+?)[\'"]{1}', content) if r: stream_url = r.group(1) if stream_url: return stream_url.replace('\/', '/') except Exception, e: common.addon.log(self.name.upper() + ' - Exception occured: %s' % e) common.addon.show_small_popup('[B][COLOR white]' + self.name.upper() + '[/COLOR][/B]', '[COLOR red]Exception occured, check logs.[/COLOR]') return None
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): if os.path.exists(common.cookies_path) == False: os.makedirs(common.cookies_path) import re from entertainment.net import Net net = Net(cached=False,user_agent='Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25') title = self.CleanTextForSearch(title) name = self.CleanTextForSearch(name) main_url=self.base_url helper = '%s (%s)' %(name,year) if type == 'movies': self.login() url='http://ororo.tv/nl/movies' html = net.http_GET(url).content net.save_cookies(self.cookie_file) name_lower = common.CreateIdFromString(name) r = '<span class=\'value\'>(\d{4}).*?href="([^"]+)[^>]+>([^<]+)' match = re.compile(r,re.DOTALL).findall(html) for item_year,item_url,item_title in match: item_title=item_title.lower() if item_title in name_lower: self.GetFileHosts(item_url, list, lock, message_queue) elif type == 'tv_episodes': self.login() name_lower = common.CreateIdFromString(name) name_lower = name_lower.replace('_','-') title_url='http://ororo.tv/en/shows/'+name_lower net.set_cookies(self.cookie_file) html2 = net.http_GET(title_url).content net.save_cookies(self.cookie_file) r = '%s-%s' % (season, episode) match = re.compile('data-href="(.+?)".+?class="episode" href="#(.+?)">').findall(html2) for item_url , passer in match: item_url='http://ororo.tv/'+item_url if r in passer: self.GetFileHosts(item_url, list, lock, message_queue)
def GetFileHosts(self, url, list, lock, message_queue): import re from entertainment.net import Net net = Net(do_not_cache_if_any=do_no_cache_keywords_list) net._cached = False tv_user = self.Settings().get_setting("tv_user") tv_pwd = self.Settings().get_setting("tv_pwd") loginurl = "https://directdownload.tv" data = {"password": tv_pwd, "username": tv_user, "Login": "******", "mode": "normal"} headers = { "Referer": "https://directdownload.tv", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Connection": "keep-alive", "Content-Type": "application/x-www-form-urlencoded", "Host": "directdownload.tv", "Origin": "http://directdownload.tv", "User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36", } net.http_POST(loginurl, data, headers).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) content = net.http_GET(url).content r = '{"url":"(.+?)","hostname":".+?"}' match = re.compile(r).findall(content) urlselect = [] for url in match: print url if url not in urlselect: urlselect.append(url) quality = "SD" url_lower = "." + url.lower() + "." for quality_key, quality_value in common.quality_dict.items(): if re.search("[^a-zA-Z0-0]" + quality_key + "[^a-zA-Z0-0]", url_lower): quality = quality_value break self.AddFileHost(list, quality, url.replace("\/", "/"))
def Resolve(self, url): import re from entertainment.net import Net net = Net(cached=False) common.addon.log(self.name.upper() + ' - Link: %s' % url) common.addon.show_small_popup( '[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]', 'Resolving', 700, self.icon) html = net.http_GET(url).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) try: if not re.search(r'value=\"Continue to video', html, re.I): raise Exception('File Not Found') html = net.http_POST(url, form_data={ 'Continue': 'Continue to video' }, headers={ 'Content-Type': 'application/x-www-form-urlencoded' }).content finalLink = re.search(r'var\sxxxx\s\=\s\"(.*?)\"', html) if finalLink: return finalLink.group(1) else: raise Exception('No Media Found To Stream') except Exception, e: common.addon.log(self.name.upper() + ' - Exception occured: %s' % e) common.addon.show_small_popup( '[B][COLOR blue]I[/B][/COLOR]stream: [B][COLOR white]' + self.name.upper() + '[/B][/COLOR]', '[COLOR red]' + str(e) + '[/COLOR]', 3000, self.icon) return None
def GetFileHosts(self, url, list, lock, message_queue): get_1080p = False; if url.endswith('__movies'): url = url.split('__')[0]; get_1080p = True import re from entertainment.net import Net net = Net(cached=False) net.set_cookies(self.cookie_file) content = net.http_GET(url).content fileid = re.compile('"file": "(.+?)"').findall(content)[0] resolved_url = net.http_GET('http://superchillin.com'+fileid, headers={'Rrferer':url}, auto_read_response=False).get_url() if self.Settings().get_setting('premium')=='true': self.AddFileHost(list, 'HD', resolved_url, 'SUPERCHILLIN.COM') if 'Watch in 1080p' in content: self.AddFileHost(list, 'HD', resolved_url+'&hd=1', 'SUPERCHILLIN.COM 1080P') else: self.AddFileHost(list, 'HD', resolved_url, 'SUPERCHILLIN.COM')
def GetFileHosts(self, url, list, lock, message_queue): get_1080p = False; if url.endswith('__movies'): url = url.split('__')[0]; get_1080p = True import re from entertainment.net import Net net = Net(cached=False) net.set_cookies(self.cookie_file) content = net.http_GET(url).content fileid = re.compile('"file": "(.+?)"').findall(content)[0] resolved_url = net.http_GET('http://superchillin.com'+fileid, headers={'Rrferer':url}, auto_read_response=False).get_url() if self.Settings().get_setting('premium')=='true': self.AddFileHost(list, 'HD', resolved_url, 'SUPERCHILLIN.COM') if 'Watch in 1080p' in content: self.AddFileHost(list, 'HD', resolved_url+'&hd=1', 'SUPERCHILLIN.COM 1080P') else: self.AddFileHost(list, 'HD', resolved_url, 'SUPERCHILLIN.COM')
def GetFileHosts(self, url, list, lock, message_queue): import re from entertainment.net import Net net = Net(user_agent='Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25') net.set_cookies(self.cookie_file) content = net.http_GET(url).content r = "<source src='(.+?)' type='(.+?)'>" match = re.compile(r).findall(content) for url,res in match: url = '%s|User-Agent=%s&Cookie=%s' % (url,urllib.quote_plus('Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36'), urllib.quote_plus('video=true')) quality = 'HD' if 'video/mp4' in res: quality = 'HD' else: quality = 'SD' self.AddFileHost(list, quality, url,'ORORO.TV')
def Resolve(self, url): print url import re from entertainment.net import Net net = Net(cached=False, user_agent='Apple-iPhone/') tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') loginurl = 'http://hdtvshows.net/reg.php' html = net.http_GET(loginurl).content match = re.compile('name="Token(.+?)" value="(.+?)"').findall(html) _Token = re.compile( 'name="data\[\_Token\]\[fields\]" value="(.+?)"').findall(html)[0] data = { '_method': 'POST', 'subscriptionsPass': tv_pwd, 'UserUsername': tv_user, 'Token' + match[0][0]: 'login', 'data[_Token][fields]': _Token } headers = { 'Host': 'hdtvshows.net', 'Origin': 'http://hdtvshows.net', 'Referer': 'http://hdtvshows.net/login.php', 'X-Requested-With': 'XMLHttpRequest' } html = net.http_POST(loginurl, data, headers) cookie_jar = os.path.join(cookie_path, "hdtvshows.lwp") if os.path.exists(cookie_path) == False: os.makedirs(cookie_path) net.save_cookies(cookie_jar) net.set_cookies(cookie_jar) html = net.http_GET(url).content match = re.compile('<video id="ipadvideo" src="(.+?)"').findall(html) return match[0].replace('|', '%7C')
def GetFileHosts(self, url, list, lock, message_queue, type, season, episode): import re, json from entertainment.net import Net net = Net(cached=False) headers = { 'Host': 'moviehdmax.com', 'Connection': 'keep-alive', 'Accept': 'text/plain, */*; q=0.01', 'X-Requested-With': 'XMLHttpRequest', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8' } net.set_cookies(self.cookie_file) if type == 'tv_episodes': headers = { 'Host': 'moviehdmax.com', 'Connection': 'keep-alive', 'Referer': url, 'X-Requested-With': 'XMLHttpRequest', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8' } data = {'p': episode} POST = url.replace('/watch/', '/getepisode/') content = net.http_POST(POST, data, headers=headers).content link = json.loads(content) data = link['sources'] for field in data: quality = field['quality'] + 'P' FINAL_URL = field['host'] if '1080P' in quality.upper(): Q = '1080P' elif '720P' in quality.upper(): Q = '720P' elif '480P' in quality.upper(): Q = 'HD' else: Q = 'SD' self.AddFileHost(list, Q, FINAL_URL) else: content = net.http_GET(url, headers=headers).content match = re.compile( '<source src="(.+?)".+?data-res="(.+?)"').findall(content) for FINAL_URL, quality in match: if '1080' in quality.upper(): Q = '1080P' elif '720' in quality.upper(): Q = '720P' elif '480' in quality.upper(): Q = 'HD' else: Q = 'SD' self.AddFileHost(list, Q, FINAL_URL)
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): #if type!= 'movies': return from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) name = self.CleanTextForSearch(name) name = name.rstrip() # import urllib movie_url='http://superchillin.com/search.php?q=%s' %(name.replace(' ','+')) html = net.http_GET(movie_url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) if type == 'movies': name_lower = common.CreateIdFromString(name) for item in re.finditer(r"href='/(.+?)'>(.+?)</a> \((.+?)\)", html): item_url = self.base_url + item.group(1) item_name = common.CreateIdFromString(item.group(2)) item_year = item.group(3) #item_url = item_url+'&hd=1' if item_name == name_lower and item_year == year: self.GetFileHosts(item_url + '__movies', list, lock, message_queue) elif type == 'tv_episodes': name_lower = common.CreateIdFromString(name) for item in re.finditer(r"<i>TV Series</i></b><br><br>.+? href='/(.+?)'>(.+?)</a>", html): item_url = self.base_url + item.group(1) item_name = common.CreateIdFromString(item.group(2)) html = net.http_GET(item_url).content #<b>(.+?)x(.+?) - <a style='text.+? href='/(.+?)'>(.+?)</a></b> #<b>(.+?)x(.+?) .+? href='/(.+?)'>(.+?)</a> season_pull = "0%s"%season if len(season)<2 else season episode_pull = "0%s"%episode if len(episode)<2 else episode for item in re.finditer(r"<b>"+season+"x"+episode_pull+" - <a style='text.+? href='/(.+?)'>(.+?)</a></b>", html): item_url2 = self.base_url + item.group(1) item_title = item.group(2) if item_name == name_lower: self.GetFileHosts(item_url2, list, lock, message_queue)
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''): if section == 'latest': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Noobroom', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html)#[:25]#, [26:50] ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'azlist': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("href='/(.+?)'>(.+?)</a><br>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name,'',type, url=url, name=name) elif section == 'year': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'rating': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br><b>(.+?)</b> - (.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for rating,year,url,name in match: name = self.CleanTextForSearch(name)#href='/?3304'>Annie</a> - PG</div> url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name +' ('+'[COLOR royalblue]'+rating+'[/COLOR])'+' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'kids': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<b><a style=\'color:#fff\' href=\'(.+?)\'>(.+?)</a> - (.+?)</div>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name,pg in match: name = self.CleanTextForSearch(name) url = self.base_url + url pg = '[COLOR royalblue]'+pg+'[/COLOR]' self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + pg +')','',type, url=url, name=name) elif section == 'random': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Noobroom', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile('<a title="The Internet Movie Database" style="text-decoration: none; color: .+? href="(.+?)"').findall(html) for url in match: html2 = net.http_GET(url).content match2=re.compile('<title>(.+?) (\([\d]{4}\)) - IMDb</title>').findall(html2) for name,year in match2: name = self.CleanTextForSearch(name) url = self.base_url year=year.replace('(','').replace(')','') self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'tvshows': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("href='/(.+?)'>(.+?)</a></b><br><br>\s*<span style='color:.+?;font-size:14px'>.+?Latest: (.+?) - <b>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name,eps in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list, indexer, common.mode_Content, name+ ' (' + '[COLOR red]'+eps+'[/COLOR]' +')', '', 'tv_seasons', url=url, name=name) elif section == 'tvshowsadded': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<a href='(.+?)'><img style='border:0' src='(.+?)' width='53' height='79'></a>.+?<a style='color:#fff' href='.+?'>(.+?)</a></b><br><br>.+?Latest: (.+?) - <b><span style='color:#fff'>(.+?)</span>",re.DOTALL).findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,image,name,eps,title in match: url = 'http://superchillin.com'+url name = self.CleanTextForSearch(name) self.AddContent(list, indexer, common.mode_Content, name+ ' (' + '[COLOR red]'+eps+'[/COLOR]' +')', '', 'tv_seasons', url=url, name=name) else: from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year)
def Resolve(self, url): resolved_media_url = '' quality=url.split('__')[1] url=url.split('__')[0] from entertainment.net import Net net = Net(cached=False) sess = self.GET_SESSION_ID() net.set_cookies(self.cookie_file) r='http://www.filmon.com/api/channel/%s?session_key=%s' % (url,sess) print r content = net.http_GET(r).content import json data = json.loads(content) channels= data['streams'] for stream in channels: if stream['quality'] == 'low': import re foregex= stream['url']+'<' playpath=stream['name'] name=stream['quality'] if re.search('mp4',playpath ,re.IGNORECASE): regex = re.compile('rtmp://(.+?)/(.+?)/(.+?)/<') match1 = regex.search(foregex) app = '%s/%s/' %(match1.group(2), match1.group(3)) swfUrl='http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf' url=stream['url']+playpath if re.search('m4v',playpath ,re.IGNORECASE): app = 'vodlast' swfUrl= 'http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf' url= stream['url']+'/'+playpath else: try: regex = re.compile('rtmp://(.+?)/live/(.+?)id=(.+?)<') match = regex.search(foregex) app = 'live/%sid=%s' %(match.group(2),match.group(3)) url= stream['url'] swfUrl= 'http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf' except: pass try: regex = re.compile('rtmp://(.+?)/(.+?)id=(.+?)"') match1 = regex.search(foregex) app = '%sid=%s' %(match1.group(2), match1.group(3)) swfUrl='http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf?v=28' except: pass try: regex = re.compile('rtmp://(.+?)/(.+?)/<') match = regex.search(foregex) app = '%s/' %(match.group(2)) url= stream['url']+'/'+playpath swfUrl= 'http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon/FilmonPlayer.swf' except: pass tcUrl=stream['url'] pageUrl = 'http://www.filmon.com/' resolved_media_url= str(url)+' playpath='+str(playpath)+' app='+str(app)+' swfUrl='+str(swfUrl)+' tcUrl='+str(tcUrl)+' pageurl='+str(pageUrl)+' live=true' if quality=='HD': return resolved_media_url.replace('low','high') else: return resolved_media_url
def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue): #if type!= 'movies': return from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) name = self.CleanTextForSearch(name) name = name.rstrip() # import urllib movie_url='http://superchillin.com/search.php?q=%s' %(name.replace(' ','+')) html = net.http_GET(movie_url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) if type == 'movies': name_lower = common.CreateIdFromString(name) for item in re.finditer(r"href='/(.+?)'>(.+?)</a> \((.+?)\)", html): item_url = self.base_url + item.group(1) item_name = common.CreateIdFromString(item.group(2)) item_year = item.group(3) #item_url = item_url+'&hd=1' if item_name == name_lower and item_year == year: self.GetFileHosts(item_url + '__movies', list, lock, message_queue) elif type == 'tv_episodes': name_lower = common.CreateIdFromString(name) for item in re.finditer(r"<i>TV Series</i></b><br><br>.+? href='/(.+?)'>(.+?)</a>", html): item_url = self.base_url + item.group(1) item_name = common.CreateIdFromString(item.group(2)) html = net.http_GET(item_url).content #<b>(.+?)x(.+?) - <a style='text.+? href='/(.+?)'>(.+?)</a></b> #<b>(.+?)x(.+?) .+? href='/(.+?)'>(.+?)</a> season_pull = "0%s"%season if len(season)<2 else season episode_pull = "0%s"%episode if len(episode)<2 else episode for item in re.finditer(r"<b>"+season+"x"+episode_pull+" - <a style='text.+? href='/(.+?)'>(.+?)</a></b>", html): item_url2 = self.base_url + item.group(1) item_title = item.group(2) if item_name == name_lower: self.GetFileHosts(item_url2, list, lock, message_queue)
def GetFileHosts(self, url, list, lock, message_queue, type): import re, time, base64 from entertainment.net import Net net = Net(cached=False) headers = { 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.8', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Host': 'www.cartoonhd.mobi', 'Origin': 'http://www.cartoonhd.mobi', 'Pragma': 'no-cache', 'Referer': 'http://www.cartoonhd.mobi', 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4', 'X-Requested-With': 'XMLHttpRequest' } cookie = net.http_GET('http://cartoonhd.mobi/index.php', headers=headers).content #cookie=net.get_cookies() #print cookie net.save_cookies(self.cookie_file) COOKIE = re.compile('__utmx="(.+?)"').findall( open(self.cookie_file).read())[0] #print COOKIE net.set_cookies(self.cookie_file) content = net.http_GET(url, headers=headers).content TIME = time.time() - 3600 TIME = str(TIME).split('.')[0] TIME = base64.b64encode(TIME, 'strict') TIME = TIME.replace('==', '%3D%3D') token = re.compile("var tok='(.+?)'").findall(content)[0] match = re.compile('elid="(.+?)"').findall(content) id = match[0] #COOKIE='flixy=%s; %s=%s' % (token,id,TIME) headers = { 'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.8', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Content-Length': '94', #'Cookie':COOKIE, 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Host': 'www.cartoonhd.mobi', 'Origin': 'http://www.cartoonhd.mobi', 'Pragma': 'no-cache', 'Referer': url, 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4', 'X-Requested-With': 'XMLHttpRequest', 'Authorization': 'Bearer ' + COOKIE.replace('%3D', '=') } OPTION = re.compile( '<option value="(.+?)" data-type="(.+?)">').findall(content) if type == 'tv_episodes': get = 'getEpisodeEmb' else: get = 'getMovieEmb' new_search = 'http://www.cartoonhd.mobi/ajax/embeds.php' data = {'action': get, 'idEl': id, 'token': token, 'elid': TIME} import requests content = requests.post(new_search, data=data, headers=headers).content #print content for option, server in OPTION: #print option #print server if '-' in server: quality = server.split('-')[1].strip().upper() name = server.split('-')[0].strip().upper() if '320P' in quality: quality = 'SD' else: quality = 'SD' name = server.upper() r = '"%s".+?iframe src="(.+?)"' % option #print r FINAL_URL = re.compile(r, re.IGNORECASE).findall( content.replace('\\', ''))[0] if 'mail.ru' in FINAL_URL: matchme = re.compile('"metadataUrl":"(.+?)"').findall( net.http_GET(FINAL_URL).content)[0] quality, url = self.GrabMailRu(matchme, list) else: self.AddFileHost(list, quality, FINAL_URL.split('"')[0], host=name)
def GetFileHosts(self, url, list, lock, message_queue,type): import re,time,base64 from entertainment.net import Net net = Net(cached=False) headers={'Accept':'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'en-US,en;q=0.8', 'Cache-Control':'no-cache', 'Connection':'keep-alive', 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'Host':'www.cartoonhd.mobi', 'Origin':'http://www.cartoonhd.mobi', 'Pragma':'no-cache', 'Referer':'http://www.cartoonhd.mobi', 'User-Agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4', 'X-Requested-With':'XMLHttpRequest'} cookie = net.http_GET('http://cartoonhd.mobi/index.php',headers=headers).content #cookie=net.get_cookies() #print cookie net.save_cookies(self.cookie_file) COOKIE=re.compile('__utmx="(.+?)"').findall(open(self.cookie_file).read())[0] #print COOKIE net.set_cookies(self.cookie_file) content = net.http_GET(url,headers=headers).content TIME = time.time()- 3600 TIME= str(TIME).split('.')[0] TIME= base64.b64encode(TIME,'strict') TIME=TIME.replace('==','%3D%3D') token=re.compile("var tok='(.+?)'").findall(content)[0] match=re.compile('elid="(.+?)"').findall(content) id = match[0] #COOKIE='flixy=%s; %s=%s' % (token,id,TIME) headers={'Accept':'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding':'gzip, deflate', 'Accept-Language':'en-US,en;q=0.8', 'Cache-Control':'no-cache', 'Connection':'keep-alive', 'Content-Length':'94', #'Cookie':COOKIE, 'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8', 'Host':'www.cartoonhd.mobi', 'Origin':'http://www.cartoonhd.mobi', 'Pragma':'no-cache', 'Referer':url, 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_4 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H143 Safari/600.1.4', 'X-Requested-With':'XMLHttpRequest', 'Authorization': 'Bearer '+COOKIE.replace('%3D','=')} OPTION= re.compile('<option value="(.+?)" data-type="(.+?)">').findall(content) if type == 'tv_episodes': get='getEpisodeEmb' else: get='getMovieEmb' new_search='http://www.cartoonhd.mobi/ajax/embeds.php' data={'action':get,'idEl':id,'token':token,'elid':TIME} import requests content = requests.post(new_search, data=data, headers=headers).content #print content for option , server in OPTION: #print option #print server if '-' in server: quality= server.split('-')[1].strip().upper() name= server.split('-')[0].strip().upper() if '320P' in quality: quality= 'SD' else: quality= 'SD' name= server.upper() r = '"%s".+?iframe src="(.+?)"' % option #print r FINAL_URL = re.compile(r,re.IGNORECASE).findall(content.replace('\\',''))[0] if 'mail.ru' in FINAL_URL: matchme=re.compile('"metadataUrl":"(.+?)"').findall(net.http_GET(FINAL_URL).content)[0] quality,url=self.GrabMailRu(matchme,list) else: self.AddFileHost(list, quality, FINAL_URL.split('"')[0],host=name)
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''): from entertainment.net import Net net = Net(cached=False) trakt_user = self.Settings().get_setting('username') trakt_password = self.Settings().get_setting('password') if trakt_user!="" and trakt_password != "" and section != 'search': net.set_cookies(self.cookie_file) import re new_url = url if section != 'list' or total_pages != '': if page == '': page = '1' else: page = str( int(page) ) new_url = new_url + ('&' if section=='search' else '?') + 'page=' + page if total_pages == '': total_pages = '500' if section == 'boxoffice': total_pages = '1' elif section == 'search': total_pages = '5' self.AddInfo(list, indexer, section, url, type, str(page), total_pages) html = net.http_GET(new_url).content if section == 'list' and page == '' and total_pages == '': pagination_match = re.search('<ul class="pagination">(.+?)</ul>', html, re.DOTALL) if pagination_match: if page == '': page ='1' pagination = pagination_match.group(1) page_match = re.compile('<a href=[^>]+?>([^<]+?)<').findall(pagination) if page_match: total_pages = page_match[-1].strip() self.AddInfo(list, indexer, section, url, type, str(page), total_pages) match = re.compile('(<div class="grid-item col.+?<div class="titles[^>]+?>.+?</div>.+?</div>)', re.DOTALL).findall(html) for item in match: url_match = re.search('<a href="([^"]+?)">', item) if url_match: url = self.base_url + url_match.group(1) item_indexer = '' mode = '' name = '' year = '' season = '' episode = '' item_id = '' displayname = '' if '/shows/' in url: if indexer == common.indxr_Movies and section == 'list': continue item_indexer = common.indxr_TV_Shows mode = common.mode_Content type = 'tv_seasons' if section == 'list': name_match = re.search('<h3>(.+?)</h3>', item) else: name_match = re.search('<meta content="([^"]+?)" itemprop="name">', item) year_match = re.search('<span class="year">(.+?)</span>', item) if year_match: year = year_match.group(1) if name_match: name = name_match.group(1) displayname = name if year: displayname = displayname + ' (' + year + ')' if '/seasons/' in url: type = 'tv_episodes' name_span = re.search('itemprop="partOfSeries"(.+?)</span>', item, re.DOTALL).group(1) name = re.search('<meta content="([^"]+?)" itemprop="name">', name_span).group(1) season = re.search('/seasons/([0-9]+)', url).group(1) displayname = name + ' - Season: ' + season if 'episodes/' in url: mode = common.mode_File_Hosts type = 'tv_episode' episode = re.search('/episodes/([0-9]+)', url).group(1) item_id = common.CreateIdFromString(name + '_' + year + '_season_' + season + '_episode_' + episode) episode_name = '' episode_name_match = re.compile('<meta content="([^"]+?)" itemprop="name">').findall(item) if episode_name_match: episode_name = episode_name_match[-1].strip() displayname = name + ' - S' + season + 'E' + episode + ' - ' + episode_name item_id = common.CreateIdFromString(name + '_season_' + season + '_episode_' + episode) else: if indexer == common.indxr_TV_Shows and section == 'list': continue item_indexer = common.indxr_Movies mode = common.mode_File_Hosts type = common.indxr_Movies if section == 'list': name = re.search('<h3>(.+?)</h3>', item).group(1) else: name = re.search('<meta content="([^"]+?)" itemprop="name">', item).group(1) displayname = name year_match = re.search('\-([0-9]{4})$', url) if year_match: year = year_match.group(1) displayname += ' (' + year + ')' self.AddContent(list, item_indexer, mode, displayname, item_id, type, url=url, name=name, year=year, season=season, episode=episode)
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''): if section == 'latest': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Noobroom', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html)#[:25]#, [26:50] ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'azlist': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("href='/(.+?)'>(.+?)</a><br>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name,'',type, url=url, name=name) elif section == 'year': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'rating': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br><b>(.+?)</b> - (.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for rating,year,url,name in match: name = self.CleanTextForSearch(name)#href='/?3304'>Annie</a> - PG</div> url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name +' ('+'[COLOR royalblue]'+rating+'[/COLOR])'+' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'kids': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<b><a style=\'color:#fff\' href=\'(.+?)\'>(.+?)</a> - (.+?)</div>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name,pg in match: name = self.CleanTextForSearch(name) url = self.base_url + url pg = '[COLOR royalblue]'+pg+'[/COLOR]' self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + pg +')','',type, url=url, name=name) elif section == 'random': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Noobroom', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile('<a title="The Internet Movie Database" style="text-decoration: none; color: .+? href="(.+?)"').findall(html) for url in match: html2 = net.http_GET(url).content match2=re.compile('<title>(.+?) (\([\d]{4}\)) - IMDb</title>').findall(html2) for name,year in match2: name = self.CleanTextForSearch(name) url = self.base_url year=year.replace('(','').replace(')','') self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year) elif section == 'tvshows': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("href='/(.+?)'>(.+?)</a></b><br><br>\s*<span style='color:.+?;font-size:14px'>.+?Latest: (.+?) - <b>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,name,eps in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list, indexer, common.mode_Content, name+ ' (' + '[COLOR red]'+eps+'[/COLOR]' +')', '', 'tv_seasons', url=url, name=name) elif section == 'tvshowsadded': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<a href='(.+?)'><img style='border:0' src='(.+?)' width='53' height='79'></a>.+?<a style='color:#fff' href='.+?'>(.+?)</a></b><br><br>.+?Latest: (.+?) - <b><span style='color:#fff'>(.+?)</span>",re.DOTALL).findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for url,image,name,eps,title in match: url = 'http://superchillin.com'+url name = self.CleanTextForSearch(name) self.AddContent(list, indexer, common.mode_Content, name+ ' (' + '[COLOR red]'+eps+'[/COLOR]' +')', '', 'tv_seasons', url=url, name=name) else: from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if tv_user == 'Enter your Superchillin email' or tv_pwd == 'xunity' or tv_user == '' or tv_pwd == '': if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Enter Login & Password in Settings[/COLOR]', 7000, self.icon) return if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'superchillin.com', 'Origin': 'http://superchillin.com', 'Referer': 'http://superchillin.com/login.php', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'} net.http_GET('http://superchillin.com/login.php') net.http_POST('http://superchillin.com/login2.php', {'email': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) import urllib html = net.http_GET(url).content if not re.search(r'\"logout.php\"\>Logout\<\/a\>', html, re.I): common.addon.show_small_popup('[B][COLOR blue]I[/B][/COLOR]stream: Superchillin', '[COLOR red]Please Check Login & Password Are Correct[/COLOR]', 7000, self.icon) match=re.compile("<br>(.+?) - <a[^>]+?href='(.+?)'>(.+?)</a>").findall(html) ''' Pagination Code Start ''' num_items_on_a_page = 25 if page == '': page = '1' total_items = len(match) total_pages = str ( ( total_items / num_items_on_a_page ) + ( 1 if total_items % num_items_on_a_page >= 1 else 0) ) self.AddInfo(list, indexer, section, url, type, page, total_pages, sort_by, sort_order) start_index = ( int(page) - 1 ) * num_items_on_a_page match = match[ start_index : start_index + num_items_on_a_page ] ''' Pagination Code End ''' for year,url,name in match: name = self.CleanTextForSearch(name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name + ' (' + '[COLOR red]'+year+'[/COLOR]' +')','',type, url=url, name=name, year=year)
def GetSection(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''): self.Login() url_type = '' content_type = '' trakt_user = self.Settings().get_setting('username') trakt_password = self.Settings().get_setting('password') if (indexer == common.indxr_Movies or indexer == common.indxr_TV_Shows) and section != 'mytrakt' and 'list' not in section: if indexer == common.indxr_Movies: url_type = 'movies' else: url_type = 'shows' if section == 'main': self.AddSection(list, indexer,'mytrakt','My Trakt',self.base_url,indexer) self.AddSection(list, indexer,'trending','Trending',self.base_url + '/' + url_type + '/trending',indexer) if indexer == common.indxr_Movies: self.AddSection(list, indexer,'boxoffice','Box Office',self.base_url + '/' + url_type + '/boxoffice',indexer) self.AddSection(list, indexer,'popular','Popular',self.base_url + '/' + url_type + '/popular',indexer) self.AddSection(list, indexer,'watched','Watched',self.base_url + '/' + url_type + '/watched/weekly',indexer) self.AddSection(list, indexer,'played','Played',self.base_url + '/' + url_type + '/played/weekly',indexer) self.AddSection(list, indexer,'collected','Collected',self.base_url + '/' + url_type + '/collected/weekly',indexer) self.AddSection(list, indexer,'anticipated','Anticipated',self.base_url + '/' + url_type + '/anticipated',indexer) else: self.ExtractContentAndAddtoList(indexer, section, url, type, list, page, total_pages, sort_by, sort_order) else: if section == 'main' or section == 'mytrakt': if trakt_user != "": if indexer == common.indxr_Movies: url_type = '/movies' elif indexer == common.indxr_TV_Shows: url_type = '/shows' else: url_type = '' self.AddSection(list, indexer,'list','History',self.base_url + '/users/'+trakt_user+'/history' + url_type ,indexer) #self.AddSection(list, indexer,'list','Progress',self.base_url + '/users/'+trakt_user+'/progress',indexer) self.AddSection(list, indexer,'list','Collection',self.base_url + '/users/'+trakt_user+'/collection' + url_type,indexer) self.AddSection(list, indexer,'list','Ratings',self.base_url + '/users/'+trakt_user+'/ratings' + url_type,indexer) self.AddSection(list, indexer,'lists','Lists',self.base_url + '/users/'+trakt_user+'/lists',indexer) elif section == 'lists': from entertainment.net import Net net = Net(cached=False) if trakt_user!="" and trakt_password != "": net.set_cookies(self.cookie_file) import re match = re.compile(r'<div class="user-name"><a href="(.+?)"><h3 itemprop="name">(.+?)</h3></a>').findall( net.http_GET(url).content) for list_url, list_title in match: list_url=self.base_url+list_url self.AddSection(list, indexer, 'list', list_title, list_url, indexer) else: self.ExtractContentAndAddtoList(indexer, section, url, type, list, page, total_pages, sort_by, sort_order)
def ExtractContentAndAddtoList(self, indexer, section, url, type, list, page='', total_pages='', sort_by='', sort_order=''): if section == 'Recently Posted': from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'www.einthusan.com', 'Origin': 'http://www.einthusan.com', 'Referer': 'http://www.einthusan.com/index.php?lang=hindi', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36'} net.http_GET('http://www.einthusan.com/etc/login.php') net.http_POST('http://www.einthusan.com/etc/login.php', {'username': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) lang = url.split('=')[1].split('&')[0] print lang new_url = url if page == '': page = '1' else: page = str( int(page) ) new_url = 'http://www.einthusan.com/movies/index.php?lang='+lang+'&organize=Activity&filtered=RecentlyPosted&org_type=Activity&page='+page import urllib url = urllib.unquote_plus(url) html = net.http_GET(new_url+'&page='+str(page)).content if total_pages == '': r= '>([0-9]*)</a></div></div><div id="footer"' total_pages = re.compile(r).findall(html)[0] self.AddInfo(list, indexer, 'Recently Posted', url, type, str(page), total_pages) match=re.compile('<h1><a class="movie-title" href="..(.+?)">(.+?)</a></h1>').findall(html) for url, name in match: name = self.CleanTextForSearch(name) name=re.sub('\((Hindi|hindi|Tamil|tamil|Telugu|telugu|Malayalam|malayalam)\)','', name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name,'',type, url, name=name) else: print 'BLUERAY____________________________________________________________________' from entertainment.net import Net import re net = Net(cached=False) tv_user = self.Settings().get_setting('tv_user') tv_pwd = self.Settings().get_setting('tv_pwd') if os.path.exists(self.cookie_file): try: os.remove(self.cookie_file) except: pass headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0', 'Host': 'www.einthusan.com', 'Origin': 'http://www.einthusan.com', 'Referer': 'http://www.einthusan.com/index.php?lang=hindi', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36'} net.http_GET('http://www.einthusan.com/etc/login.php') net.http_POST('http://www.einthusan.com/etc/login.php', {'username': str(tv_user), 'password': str(tv_pwd)}, headers, auto_read_response=False).content net.save_cookies(self.cookie_file) net.set_cookies(self.cookie_file) lang = url.split('=')[1].split('&')[0] print lang new_url = url if page == '': page = '1' else: page = str( int(page) ) new_url = 'http://www.einthusan.com/bluray/index.php?lang='+lang+'&organize=Activity&filtered=RecentlyPosted&org_type=Activity&page='+page import urllib url = urllib.unquote_plus(url) html = net.http_GET(new_url+'&page='+str(page)).content if total_pages == '': r= '>([0-9]*)</a></div></div><div id="footer"' total_pages = re.compile(r).findall(html)[0] self.AddInfo(list, indexer, 'Recently Postedb', url, type, str(page), total_pages) match=re.compile('<h1><a class="movie-title" href="..(.+?)">(.+?) Blu-ray</a></h1>').findall(html) for url, name in match: name = self.CleanTextForSearch(name) name=re.sub('\((Hindi|hindi|Tamil|tamil|Telugu|telugu|Malayalam|malayalam)\)','', name) url = self.base_url + url self.AddContent(list,indexer,common.mode_File_Hosts,name,'',type, url, name=name)