当前位置: 首页>>代码示例>>Python>>正文


Python Net.save_cookies方法代码示例

本文整理汇总了Python中entertainment.net.Net.save_cookies方法的典型用法代码示例。如果您正苦于以下问题:Python Net.save_cookies方法的具体用法?Python Net.save_cookies怎么用?Python Net.save_cookies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entertainment.net.Net的用法示例。


在下文中一共展示了Net.save_cookies方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GetFileHosts

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    def GetFileHosts(self, id, other_names, region, language, list, lock, message_queue):

        search_term = id
        
        from entertainment.net import Net
        net = Net(cached=False)
                
        user = self.Settings().get_setting('user')
        pwd = self.Settings().get_setting('pwd')
        if user and pwd:
            
            content = net.http_POST('http://www.filmon.com/user/login', {'login':user, 'password':pwd, 'remember':'1'}, 
                headers={'Referer':self.base_url}).content
                
            net.save_cookies(self.cookie_file)

        
        content = net.http_GET(self.base_url).content.encode("utf-8")
        link = content.split('{"id":')
        import re
        for p in link:            
            if '"filmon_' in p: 
                title=p.split('"title":"')[1]
                ITEM_TITLE=title.split('"')[0]
                p_id = common.CreateIdFromString( common.CleanTextForSearch(ITEM_TITLE, strip=True) )
                if id == p_id or p_id in other_names :
                    channel_id=p.split(',')[0]
                    res=['SD','HD']
                    for quality in res:
                        channel_id_with_quality=channel_id + '__' + quality
                        self.AddLiveLink( list, ITEM_TITLE, channel_id_with_quality, language = language.title(),host='FILMON',quality=quality)
                    break
开发者ID:bialagary,项目名称:mw,代码行数:34,代码来源:filmon_ltvs_cst.py

示例2: login

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
 def login(self):
     
     headers={'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',
              'Host':'ororo.tv',
              'Pragma':'no-cache',
              'Referer':'http://ororo.tv/en',
              'Upgrade-Insecure-Requests':'1',
              'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
              'Accept-Encoding':'gzip, deflate, sdch',
              'Accept-Language':'en-US,en;q=0.8',
              'Cache-Control':'no-cache',
              'Connection':'keep-alive'}
     tv_user = self.Settings().get_setting('tv_user')
     tv_pwd = self.Settings().get_setting('tv_pwd')        
     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')
     
     tries = 0
     while True:
         html = html = net.http_GET('http://ororo.tv/nl/',headers=headers).content
         if html.startswith('http://') and tries < MAX_REDIRECT:
             tries += 1
             url = html
         else:
             break
     
     data = {'user[email]': tv_user, 'user[password]': tv_pwd, 'user[remember_me]': 1}
     html = net.http_POST('http://ororo.tv/en/users/sign_in',data,headers=headers).content
     net.save_cookies(self.cookie_file)
开发者ID:bialagary,项目名称:mw,代码行数:32,代码来源:ororo_mvi_tvi_mvs_tvs_cst.py

示例3: Resolve

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
 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
开发者ID:bialagary,项目名称:mw,代码行数:32,代码来源:realdebrid_prv.py

示例4: Resolve

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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')
开发者ID:bialagary,项目名称:mw,代码行数:34,代码来源:hdtvshows_tvs.py

示例5: GetFileHostsForContent

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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)
开发者ID:bialagary,项目名称:mw,代码行数:35,代码来源:einthusan_mvi_mvs_cst.py

示例6: Resolve

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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
开发者ID:bialagary,项目名称:mw,代码行数:34,代码来源:shared2_hrv.py

示例7: GetFileHostsForContent

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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)
开发者ID:bialagary,项目名称:mw,代码行数:48,代码来源:ororo_mvi_tvi_mvs_tvs_cst.py

示例8: GetFileHosts

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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": "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("\/", "/"))
开发者ID:bialagary,项目名称:mw,代码行数:47,代码来源:Directdownload_tvs_cst.py

示例9: solve

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
def solve(url,cookie_file='',UA='',wait=True):
        if UA=='':
            UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'
        solverregex = re.compile('var t,r,a,f, (.+?)={"(.+?)":(.+?)};.+challenge-form\'\);.*?\n.*?;(.*?);a\.value',  re.DOTALL)
        vcregex = re.compile('<input type="hidden" name="jschl_vc" value="([^"]+)"/>')
        headers={'User-Agent' : UA,'Referer':url}       
        
        request = requests.get(url,headers=headers).content
        passv = re.compile('<input type="hidden" name="pass" value="([^"]+)"/>').findall(request)[0]
        res = solverregex.findall(request)
        if len(res) == 0:
                print "Couldn't find answer script - No cloudflare check?"
                return False
        res=res[0]
        vc = vcregex.findall(request)
        if len(vc)==0:
                print "Couldn't find vc input - No cloudflare check?"
                return False
        vc = vc[0]
        print "VC is ", vc
        varname = (res[0], res[1])
        solved = int(solveEquation(res[2].rstrip()))
        print "Initial value: ", res[2], "Solved:", solved
        for extra in res[3].split(";"):
                extra = extra.rstrip()
                if extra[:len('.'.join(varname))] != '.'.join(varname):
                        print "Extra does not start with varname (", extra, ")"
                else:
                        extra = extra[len('.'.join(varname)):]
                if extra[:2] == "+=":
                        solved += int(solveEquation(extra[2:]))
                elif extra[:2] == "-=":
                        solved -= int(solveEquation(extra[2:]))
                elif extra[:2] == "*=":
                        solved *= int(solveEquation(extra[2:]))
                elif extra[:2] == "/=":
                        solved /= int(solveEquation(extra[2:]))
                else:
                        print "Unknown modifier", extra
        print "Solved value: ", solved

        http=url.split('//')[0]
        domain1=url.split('//')[1]
        domain=domain1.split('/')[0]
        solved += len(domain)
        print "With domain length", solved
        
        from entertainment.net import Net
        net = Net(cached=False)
        
        if wait ==True:
                print 'Sleepin for 6 Seconds'
                import time
                time.sleep(6)
        
        final = net.http_POST(http+"//"+domain+"/cdn-cgi/l/chk_jschl?jschl_vc={0}&pass={1}&jschl_answer={2}".format(vc,passv, solved),'',headers=headers)

        if not cookie_file == '':
            net.save_cookies(cookie_file)
            

                

             
        return final.content
开发者ID:arKtelix,项目名称:script.icechannel,代码行数:67,代码来源:cloudflare.py

示例10: GetFileHostsForContent

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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)
开发者ID:bialagary,项目名称:mw,代码行数:81,代码来源:superchillin_mvi_tvi_mvs_tvs_cst.py

示例11: ExtractContentAndAddtoList

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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'}

#.........这里部分代码省略.........
开发者ID:bialagary,项目名称:mw,代码行数:103,代码来源:superchillin_mvi_tvi_mvs_tvs_cst.py

示例12: GetFileHosts

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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)
开发者ID:bialagary,项目名称:mw,代码行数:102,代码来源:cartoonhd_mvs_tvs.py

示例13: ExtractContentAndAddtoList

# 需要导入模块: from entertainment.net import Net [as 别名]
# 或者: from entertainment.net.Net import save_cookies [as 别名]
    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)
#.........这里部分代码省略.........
开发者ID:bialagary,项目名称:mw,代码行数:103,代码来源:einthusan_mvi_mvs_cst.py


注:本文中的entertainment.net.Net.save_cookies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。