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


Python Net.set_cookies方法代码示例

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


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

示例1: GetFileHostsForContent

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

示例2: GetContent

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

示例3: Resolve

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

示例4: Resolve

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

示例5: Resolve

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

示例6: GetFileHostsForContent

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

示例7: GetFileHosts

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

示例8: Resolve

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

示例9: GetFileHostsForContent

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

示例10: GetFileHosts

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

示例11: GetFileHosts

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

示例12: GetFileHosts

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

示例13: GetFileHosts

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

示例14: Resolve

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

示例15: GetFileHostsForContent

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


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