예제 #1
0
    def Login(self):
        trakt_user = self.Settings().get_setting('username')
        trakt_password = self.Settings().get_setting('password')
        if trakt_user=="" or trakt_password == "":
            return

        from entertainment.net import Net        
        net = Net(cached=False)            
        
        signin_page = net.http_GET(self.base_url + '/auth/signin').content
        
        import re
        signin_form = re.search('<form class="simple_form form-signin"[^>]+?>(.+?)</form>', signin_page)
        if signin_form:
            signin_form = signin_form.group(1)
            signin_params = {}
            inputs = re.compile('(<input[^>]+?>)').findall(signin_form)
            for input in inputs:
                if 'type="hidden"' in input:
                    name = re.search('name="([^"]+?)"', input).group(1)
                    value = re.search('value="([^"]+?)"', input).group(1)
                    
                    signin_params[name] = value
            
            signin_params['user[login]'] = trakt_user
            signin_params['user[password]'] = trakt_password
            
            net.http_POST(self.base_url + '/auth/signin', signin_params).content
            
            net.save_cookies(self.cookie_file)
예제 #2
0
    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 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('\/', '/'))
예제 #4
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):                 
        new_url = 'http://www.movie-tube.co/index.php'
        import re
        from entertainment.net import Net
        
        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        
        if os.path.exists(self.cookie_file):
                try: os.remove(self.cookie_file)
                except: pass
                
        headers={'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36','Origin':'http://www.movie-tube.co','Referer':'http://www.movie-tube.co','Host':'www.movie-tube.co', 'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}

        title = self.CleanTextForSearch(title) 
        name = self.CleanTextForSearch(name)

        form_data={'query':name}
        content = net.http_POST('http://www.movie-tube.co/engine/ajax/search.php', form_data, headers).content


           
        
        match=re.compile('href="(.+?)"><span class="searchheading">(.+?)</',re.DOTALL).findall(content)


        for url,TITLE in match:
            if name in TITLE:
                self.GetFileHosts(url, list, lock, message_queue)
예제 #5
0
    def GetFileHosts(self, url, list, lock, message_queue, season, episode,
                     type, year):

        from entertainment.net import Net
        import re
        net = Net(
            cached=False,
            user_agent=
            'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko'
        )

        movie_links_url = self.base_url + 'movies/play_online'
        query = {'movie': url}

        content = net.http_POST(movie_links_url, query).content

        server_quality_list = {}
        servers_content = re.compile(
            '<a class="servers[^"]+?" value="([^"]+?)">(.+?)</a>',
            re.DOTALL).findall(content)
        for server_number, quality in servers_content:
            server_quality = self.GetQuality(quality)
            server_quality_list['server' + server_number] = server_quality

        sources_list = content.split('<div class="popup1 popup" ')
        for source in sources_list:
            if source.startswith('id='):
                server_id = re.search('id="([^"]+?)"', source)
                if server_id:
                    server_id = server_id.group(1)
                    server_quality = server_quality_list[server_id]
                    if 'sources:' in source:
                        import base64
                        import urllib
                        source_sources = re.search('sources:(.+?)</script>',
                                                   source, re.DOTALL)
                        if source_sources:
                            source_sources = source_sources.group(1)
                            source_sources_details = re.compile(
                                '\'([^\']+?)\'[^"]+?"([^"]+?)"',
                                re.DOTALL).findall(source_sources)
                            for source_sources_details_url, source_sources_details_quality in source_sources_details:
                                source_sources_details_quality = self.GetQuality(
                                    source_sources_details_quality)
                                self.AddFileHost(
                                    list,
                                    source_sources_details_quality.upper(),
                                    base64.b64decode(
                                        source_sources_details_url).replace(
                                            ' ', '%20'),
                                    host=self.display_name.upper().replace(
                                        ' ', ''))
                    elif '<table' in source:
                        source_sources_details_url = re.search(
                            'src="([^"]+?)"', source, re.IGNORECASE)
                        if source_sources_details_url:
                            source_sources_details_url = source_sources_details_url.group(
                                1)
                            self.AddFileHost(list, server_quality.upper(),
                                             source_sources_details_url)
예제 #6
0
 def Resolve(self, url):
     
     from entertainment.net import Net
     net = Net()
     
     if 'playsominaltv.com' in url:
         
         net._cached = False
         
         premium_url = 'http://www.playsominaltv.com/login/?redirect_to=' + url
         content = net.http_GET(premium_url, headers={'Referer':url}).content
         params={'log':self.Settings().get_setting('user'), 'pwd':self.Settings().get_setting('pass'), 'wp-submit':'1'}
         for hidden_param in re.finditer('(<input.+?type=[\'"]{1}hidden[\'"]{1}.+?/>)', content):
             hidden_param_input = hidden_param.group(1)
             param_name = re.search('name=[\'"]{1}(.+?)[\'"]{1}', hidden_param_input).group(1)
             param_value = re.search('value=[\'"]{1}(.+?)[\'"]{1}', hidden_param_input).group(1)
             params.update( { param_name : param_value } )
         content = net.http_POST('http://www.playsominaltv.com/login/',params,headers={'Referer':premium_url}).content
     
     if 'playsominaltv.com' in url or 'sominaltvfilms.com' in url or 'desionlinetheater.com' in url:
         content = net.http_GET(url).content
         content=dekode(content)
         if content:
             source_url=re.search('<iframe.+?src.+?(http.+?)[\'"\\\\]{1}', content)
             if source_url:
                 return MovieSource.Resolve(self, source_url.group(1))
     else:
         return MovieSource.Resolve(self, url)
         
     return url
    def GetFileHosts(self, url, list, lock, message_queue, type, season,
                     episode):

        if not type == 'tv_episodes':
            FINAL_URL = url.split('//')[1]
            FINAL_URL = FINAL_URL.split('/')[0]
            self.AddFileHost(list, '720P', url, host=FINAL_URL.upper())
        else:
            import json
            from entertainment.net import Net
            net = Net(cached=False)

            data = {
                'DeviceId': '6a48880da9855891b8baad7d7b34570d998b28c5',
                'Hash': 'f93e3156637c9fce37154e2d091bca8a',
                'Key': 'AA9FSK1323X3F',
                'Id': url,
                'PageSize': '20',
                'StartIndex': '0',
                'Version': '5'
            }

            link = json.loads(
                net.http_POST(self.GETLINK, data,
                              headers=self.HEADERS).content)

            data = link['Data']

            for field in data:
                TITLE = field['Name'].encode('utf8')
                id = field['VideoId']
                if 'S%s Epi %s' % (season, episode) in TITLE:
                    FINAL_URL = id.split('//')[1]
                    FINAL_URL = FINAL_URL.split('/')[0]
                    self.AddFileHost(list, '720P', id, host=FINAL_URL.upper())
예제 #8
0
    def GetFileHosts(self, url, list, lock, message_queue):

        from entertainment.net import Net
        net = Net()

        custom_url = self.get_url()

        source_args = {'iqs': '', 'url': '', 'cap': ''}

        content = net.http_GET(url).content

        import random
        import copy
        import urllib
        import re

        sec = re.search("f\.lastChild\.value=\"(.+?)\",a", content).group(1)
        source_args['sec'] = sec

        t = re.search('"&t=([^"]+)",', content).group(1)
        source_args['t'] = t

        ajax_url = custom_url + 'membersonly/components/com_iceplayer/video.phpAjaxResp.php'
        headers = {'Content-type': 'application/x-www-form-urlencoded'}

        for sq in re.finditer(
                r"<div class=ripdiv><b>(.+?)</b><p>(.+?)<p></div>", content):
            quality = sq.group(1)

            if 'DVD' in quality:
                quality = 'DVD'

            elif '1080' in quality:
                quality = '1080P'
            elif '720' in quality:
                quality = '720P'

            else:
                quality = 'SD'
            for source in re.finditer(r"<a.+?go\((.+?)\)", sq.group(2)):
                a = source.group(1)

                m = random.randrange(100, 300) * -1
                s = random.randrange(5, 50)
                source_params = copy.copy(source_args)
                cache_source_params = copy.copy(source_args)
                source_params['id'] = a
                cache_source_params['id'] = a
                source_params['m'] = m
                source_params['s'] = s

                ajax_content = net.http_POST(
                    ajax_url,
                    source_params,
                    headers,
                    form_data_for_cache=cache_source_params).content
                host_url = urllib.unquote(
                    re.search(r"url=(.*)", ajax_content).group(1))

                self.AddFileHost(list, quality, host_url)
예제 #9
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):                 
        new_url = 'http://www.movie-tube.co/index.php'
        import re
        from entertainment.net import Net
        
        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        
        if os.path.exists(self.cookie_file):
                try: os.remove(self.cookie_file)
                except: pass
                
        headers={'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36','Origin':'http://www.movie-tube.co','Referer':'http://www.movie-tube.co','Host':'www.movie-tube.co', 'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}

        title = self.CleanTextForSearch(title) 
        name = self.CleanTextForSearch(name)

        form_data={'query':name}
        content = net.http_POST('http://www.movie-tube.co/engine/ajax/search.php', form_data, headers).content


           
        
        match=re.compile('href="(.+?)"><span class="searchheading">(.+?)</',re.DOTALL).findall(content)


        for url,TITLE in match:
            if name in self.CleanTextForSearch(TITLE):
                self.GetFileHosts(url, list, lock, message_queue)
예제 #10
0
파일: yify_mvs.py 프로젝트: bialagary/mw
    def GetFileHosts(self, url, list, lock, message_queue,name): 
        
        import re,json
        
        from entertainment.net import Net

        net = Net(cached=False)
        content = net.http_GET(url).content
        links=re.compile('pic=([^&]+)').findall (content)
        links = [x for y,x in enumerate(links) if x not in links[:y]]

        for i in links:

            data = {'url': i, 'fv': '16'}
            headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36'}
            html=   net.http_POST('http://yify.tv/player/pk/pk/plugins/player_p2.php',data,headers=headers).content
            result = json.loads(html)     
            for field in result:

                     if field['width']== 1920:
                         url = field['url']
                         res= '1080P'
                         host=url.split('://')[1]
                         host=host.split('/')[0].replace('www','')
                         self.AddFileHost(list, res, url,host=host.upper())
                     if field['width']== 1280:
                         url = field['url']
                         res= '720P'
                         host=url.split('://')[1]
                         host=host.split('/')[0].replace('www','')                       
                         self.AddFileHost(list, res, url,host=host.upper())
예제 #11
0
파일: oss_ltvs.py 프로젝트: bialagary/mw
    def Resolve(self, url):
        import re

        from entertainment.net import Net
        net = Net()
        loginurl = 'http://offsidestreams.com/site/wp-login.php'
        username = self.Settings().get_setting('tv_user')
        password = self.Settings().get_setting('tv_pwd')
        site = 'http://offsidestreams.com/site/live-tv/'
        data = {
            'pwd': password,
            'log': username,
            'wp-submit': 'Log In',
            'redirect_to': 'http://offsidestreams.com/site',
            'testcookie': '1'
        }
        headers = {
            'Host': 'offsidestreams.com',
            'Origin': 'http://offsidestreams.com',
            'Referer': 'http://offsidestreams.com/site/wp-login.php',
            'X-Requested-With': 'XMLHttpRequest'
        }
        html = net.http_POST(loginurl, data, headers).content

        auth = re.findall('urlkey1 = "(.+?)"', html, re.M | re.DOTALL)[0]
        stream_url = '%s swfUrl=http://p.jwpcdn.com/6/8/jwplayer.flash.swf app=liveedge?wmsAuthSign=%s pageUrl=%s swfVfy=true live=true timeout=15' % (
            url.replace('" + urlkey1 + "', auth), auth, site)
        return stream_url
예제 #12
0
    def GetFileHosts(self, url, list, lock, message_queue):

        import re,urllib
        from entertainment.net import Net
        
        net = Net(user_agent='Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5')
                  

        loginurl = 'https://m.genvideos.org/video_info/html5'
        
        v=url.split('v=')[1]
        data={'v': v}
        headers = {'host': 'm.genvideos.org','origin':'https://m.genvideos.org', 'referer': url,
                   'user-agent':'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5','x-requested-with':'XMLHttpRequest'}

        first= net.http_POST(loginurl,data,headers).content

        import json

        link= json.loads(first)

        for j in link:
            quality = j.upper()
            if '360P' in quality:
                quality='SD'
                
            THEURL = urllib.unquote(link[j][3])+'**'+url
            self.AddFileHost(list, quality, THEURL,host='GOOGLEVIDEO.COM')
예제 #13
0
    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
예제 #14
0
    def Resolve(self, url):
        import re        
        from entertainment.net import Net
        
        episode=url.split('|')[1]
        url=url.split('|')[0]


        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        headers={'Referer':'http://www.kissdrama.net/results.php', 'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}
        key = url.split('=')[1]

        form_data={ 'c':'result', 'a':'getplayerinfo', 'p':'{"KeyWord":"%s","Episode":%s,"Part":"01"}' % (key,episode) }
        content = net.http_POST('http://www.kissdrama.net/index.php', form_data, headers).content
        
        match=re.compile('src="http(.+?)"').findall(content)[0]
        
        if 'docs.google.com' in match:
            match='http'+match
            headers={'Referer':str(match), 'Host':'docs.google.com','User-Agent':'Mozilla/5.0 (Windows NT 6.1; rv:27.0) Gecko/20100101 Firefox/27.0','Connection':'keep-alive','Accept-Encoding':'gzip, deflate','Accept-Language':'en-US,en;q=0.5','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'}
            
            html = net.http_GET(match, headers=headers).content.encode("utf-8").rstrip()
            video_url=re.search('fmt_stream_map".+?(http.+?),', html).group(1)
            video_url=video_url.replace('|', '').replace('\u003d','=').replace('\u0026','&')

            return video_url

        else:
            match='http'+match
            return match
예제 #15
0
 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)
예제 #16
0
    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')
예제 #17
0
 def get_api_key(self):
     api_key = self.Settings().get_setting('api_key')
     if api_key==None or api_key=='':                                
         furk_user = self.Settings().get_setting('furk_user')
         furk_pwd = self.Settings().get_setting('furk_pwd')
         
         if furk_user != '' and furk_pwd != '':
         
             import json
             from entertainment.net import Net
             net = Net(cached=False)
         
             trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
             
             login_command = "/api/login/login"
             login_params = {"login": furk_user, "pwd": furk_pwd}
             login_url = "%s%s" % (self.api_url, login_command)
             #try:login_content = net.http_POST(login_url, login_params).content.translate(trans_table)
             login_content = net.http_POST(login_url, login_params).content#.translate(trans_table)
             login_data = json.loads(login_content)
             if login_data['status'] == 'ok':
                 api_key = login_data['api_key']
                 self.Settings().set_setting('api_key', api_key)
             
     return api_key
예제 #18
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):

        from entertainment.net import Net
        import re
        net = Net(cached=False)

        name = self.CleanTextForSearch(name)
        season = self.CleanTextForSearch(season)
        episode = self.CleanTextForSearch(episode)

        scrape = 'S' + season + ', Ep' + episode
        search_term = name
        helper_term = 'tvshow'
        data = {'q': name}
        headers = {
            'Host':
            'hdtvshows.net',
            'Origin':
            'http://hdtvshows.net',
            'Referer':
            'http://hdtvshows.net',
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36'
        }
        html = net.http_POST('http://hdtvshows.net/find.php', data,
                             headers).content

        r = '%s Free " href="(.+?)">' % name
        match = re.compile(r).findall(html)[0]
        self.GetFileHosts(self.base_url + match, list, lock, message_queue,
                          scrape)
예제 #19
0
    def Resolve(self, url):

        from entertainment.net import Net
        import re

        net = Net(cached=False)
        headers = {
            'Referer':
            url,
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
        }
        data = {
            url.split('?')[1].replace('=', ''): '',
            'chtc': 'Click Here to Continue'
        }
        html = net.http_POST(url, data, headers=headers).content

        #print html.encode('ascii','ignore')

        match2 = re.compile('id="showvideo" src="(.+?)"').findall(html)[0]
        xbmc.log(match2)
        from entertainment import istream
        play_url = istream.ResolveUrl(match2)
        return play_url
예제 #20
0
파일: shared2_hrv.py 프로젝트: bialagary/mw
    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
예제 #21
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):
        new_url = 'http://www.kissdrama.net/index.php'
        import re
        from entertainment.net import Net

        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)

        if os.path.exists(self.cookie_file):
            try:
                os.remove(self.cookie_file)
            except:
                pass

        headers = {
            'Referer': 'http://www.kissdrama.net/results.php',
            'X-Requested-With': 'XMLHttpRequest',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
        }

        name = self.CleanTextForSearch(name)

        form_data = {
            'c': 'result',
            'a': 'retrieve',
            'p':
            '{"KeyWord":"%s (%s)","Page":"1","NextToken":""}' % (name, year)
        }
        content = net.http_POST('http://www.kissdrama.net/index.php',
                                form_data, headers).content

        helper = '%s (%s)' % (name, year)

        if len(episode) < 2:
            episode = '0%s' % episode

        match = re.compile(
            '<h1 class="text"><a href="(.+?)" target="_blank">(.+?)</a>.+?width="20" height="20" />(.+?)</h3>',
            re.DOTALL).findall(content)
        urlselect = []

        for url, TITLE, res in match:

            url = 'http://www.kissdrama.net/' + url
            if url not in urlselect:
                urlselect.append(url)

                quality = 'SD'
                res_lower = '.' + res.lower() + '.'
                for quality_key, quality_value in common.quality_dict.items():
                    if re.search('[^a-zA-Z0-0]' + quality_key + '[^a-zA-Z0-0]',
                                 res_lower):
                        quality = quality_value
                        break

                if year in TITLE:
                    if '>full<' in TITLE.lower():
                        self.GetFileHosts(url, list, lock, message_queue,
                                          quality, episode)
예제 #22
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):
        import re, json, time
        from entertainment.net import Net

        net = Net(cached=False)

        if os.path.exists(self.cookie_file):
            try:
                os.remove(self.cookie_file)
            except:
                pass

        time = time.time()
        title = self.CleanTextForSearch(title)
        name = self.CleanTextForSearch(name)
        REF = 'https://123movies4u.net/index.php?menu=search&query=' + name.replace(
            ' ', '+')
        headers = {
            'Host':
            '123movies4u.net',
            'Origin':
            'https://123movies4u.net',
            'Referer':
            REF,
            'Connection':
            'keep-alive',
            'Content-Type':
            'application/x-www-form-urlencoded; charset=UTF-8',
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36'
        }

        form_data = {
            'q': name,
            'limit': '5',
            'timestamp': str(time).split('.')[0],
            'verifiedCheck': ''
        }

        content = net.http_POST('https://123movies4u.net/ajax/search.php',
                                form_data, headers).content

        data = json.loads(content)

        for field in data:
            movie_url = field['permalink']
            _name = field['title']
            if type == 'tv_episodes':

                if name.lower() in self.CleanTextForSearch(_name.lower()):
                    movie_url = movie_url + '/season/%s/episode/%s' % (season,
                                                                       episode)
                    self.GetFileHosts(movie_url, list, lock, message_queue,
                                      REF)
            else:
                if name.lower() in self.CleanTextForSearch(_name.lower()):
                    self.GetFileHosts(movie_url, list, lock, message_queue,
                                      REF)
예제 #23
0
    def GetFileHosts(self, url, list, lock, message_queue): 

        from entertainment.net import Net
        net = Net()
        
        custom_url = self.get_url()
        
        source_args = {
              'iqs': '',
              'url': '',
              'cap': ''
          }
        
        content = net.http_GET(url).content        
        
        import random
        import copy
        import urllib
        import re
        
        sec = re.search("f\.lastChild\.value=\"(.+?)\",a", content).group(1)        
        source_args['sec'] = sec
        
        t = re.search('"&t=([^"]+)",', content).group(1)
        source_args['t'] = t           
        
        ajax_url = custom_url + 'membersonly/components/com_iceplayer/video.phpAjaxResp.php'
        headers = {'Content-type':'application/x-www-form-urlencoded'}
        
        for sq in re.finditer(r"<div class=ripdiv><b>(.+?)</b><p>(.+?)<p></div>", content):
            quality = sq.group(1)
            
            if 'DVD' in quality:
                quality = 'DVD'

            elif '1080' in quality:
                quality = '1080P'                
            elif '720' in quality:
                quality = '720P'
                
            else:
                quality = 'SD'
            for source in re.finditer(r"<a.+?go\((.+?)\)", sq.group(2)):                
                a = source.group(1)
                
                m = random.randrange(100, 300) * -1
                s = random.randrange(5, 50)
                source_params = copy.copy(source_args)
                cache_source_params = copy.copy(source_args)
                source_params['id'] = a
                cache_source_params['id'] = a
                source_params['m'] = m
                source_params['s'] = s                
                
                ajax_content = net.http_POST(ajax_url, source_params, headers, form_data_for_cache=cache_source_params).content
                host_url = urllib.unquote(re.search(r"url=(.*)", ajax_content).group(1))
                
                self.AddFileHost(list, quality, host_url)
예제 #24
0
    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("\/", "/"))
예제 #25
0
    def Resolve(self, url):
        import re
        from entertainment.net import Net

        episode = url.split('|')[1]
        url = url.split('|')[0]

        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        headers = {
            'Referer': 'http://www.kissdrama.net/results.php',
            'X-Requested-With': 'XMLHttpRequest',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
        }
        key = url.split('=')[1]

        form_data = {
            'c': 'result',
            'a': 'getplayerinfo',
            'p': '{"KeyWord":"%s","Episode":%s,"Part":"01"}' % (key, episode)
        }
        content = net.http_POST('http://www.kissdrama.net/index.php',
                                form_data, headers).content

        match = re.compile('src="http(.+?)"').findall(content)[0]

        if 'docs.google.com' in match:
            match = 'http' + match
            headers = {
                'Referer':
                str(match),
                'Host':
                'docs.google.com',
                'User-Agent':
                'Mozilla/5.0 (Windows NT 6.1; rv:27.0) Gecko/20100101 Firefox/27.0',
                'Connection':
                'keep-alive',
                'Accept-Encoding':
                'gzip, deflate',
                'Accept-Language':
                'en-US,en;q=0.5',
                'Accept':
                'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
            }

            html = net.http_GET(
                match, headers=headers).content.encode("utf-8").rstrip()
            video_url = re.search('fmt_stream_map".+?(http.+?),',
                                  html).group(1)
            video_url = video_url.replace('|', '').replace('\u003d',
                                                           '=').replace(
                                                               '\u0026', '&')

            return video_url

        else:
            match = 'http' + match
            return match
예제 #26
0
    def GetFileHosts(self, id, other_names, region, language, list, lock, message_queue):

        quality_dict = {'1200':'HD', '800':'SD', '600':'LOW'}
        
        import re
        from entertainment.net import Net
        net = Net(cached=False)
        
        if not 'itv' in id: return
        
        if '2' in id or '3' in id:

            id=id.split('itv')[1]           
            name='ITV '+id
            
            SoapMessage=self.TEMPLATE('sim'+id,'itv'+id)
            
            headers={'Content-Length':'%d'%len(SoapMessage),'Content-Type':'text/xml; charset=utf-8','Host':'mercury.itv.com','Origin':'http://www.itv.com','Referer':'http://www.itv.com/Mercury/Mercury_VideoPlayer.swf?v=null','SOAPAction':"http://tempuri.org/PlaylistService/GetPlaylist",'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36'}

            response = net.http_POST("http://mercury.itv.com/PlaylistService.svc",SoapMessage, headers=headers).content
            
            response = response.split('VideoEntries')[1]
        
        
            

        if id =='itv1':
            name='ITV 1'
            url='http://www.itv.com/mediaplayer/xml/channels.itv1.xml'
            response = net.http_GET(url).content
    
            
        if id =='itv4':
            name='ITV 4'
            url='http://www.itv.com/mediaplayer/xml/channels.itv4.xml'



            response = net.http_GET(url).content

        

        rtmp=re.compile('<MediaFiles base="(.+?)"').findall(response)[0]
        match=re.compile('CDATA\[(.+?)\]').findall(response)
        for playpath in match:
            print playpath
            res=playpath.split('_')[1]
            res=res.split('@')[0]
            
            resolved_media_url=rtmp+' playpath='+playpath+' swfUrl=http://www.itv.com/mediaplayer/ITVMediaPlayer.swf?v=12.18.4 live=true timeout=10 swfvfy=true'
        
            
            self.AddLiveLink( list, name, resolved_media_url, language='English',host='ITV PLAYER',quality=quality_dict.get(res, 'NA') )
예제 #27
0
    def Resolve(self, url):
        resolved_media_url = ''
        import re
        from entertainment.net import Net
        net = Net()

        content = net.http_GET(url, headers={'Referer': self.base_url}).content
        answer = re.compile('Question: (.+?) =').findall(content)[0].replace(
            'x', '*')

        data = {'captcha': eval(answer)}
        content = net.http_POST(url, data, headers={
            'Referer': self.base_url
        }).content
        '''
        m3u8_url = re.search('[\'"](http.+?\.m3u8.+?)[\'"]', content)
        if m3u8_url:
            resolved_media_url = m3u8_url.group(1)
        '''
        token_url = re.compile('\$.getJSON\("(.+?)",').findall(content)[0]
        import datetime
        time_now = datetime.datetime.now()
        import time
        epoch = time.mktime(
            time_now.timetuple()) + (time_now.microsecond / 1000000.)
        epoch_str = str('%f' % epoch)
        epoch_str = epoch_str.replace('.', '')
        epoch_str = epoch_str[:-3]

        token_url = token_url + '&_=' + epoch_str
        token = re.compile('":"(.+?)"').findall(
            net.http_GET(token_url + '&_=' + str(epoch),
                         headers={
                             'Referer': url
                         }).content)[0]

        streamer = re.search('streamer: "(.+?)"', content).group(1)

        playpath = re.search('file: "(.+?)"', content).group(1)
        if playpath.endswith('.flv'):
            playpath = playpath[:-4]
        elif playpath.endswith('.mp4'):
            playpath = 'mp4:' + playpath

        player = re.search('flashplayer: "(.+?)"', content).group(1)
        pageurl = self.base_url  #url
        streamer = streamer.replace('\/', '/')
        app = re.search('rtmp://[\.\w\:]*/(.*)', streamer).group(1)

        resolved_media_url = streamer + ' app=' + app + ' playpath=' + playpath + ' swfUrl=' + player + ' live=1 timeout=15 token=' + token + ' swfVfy=1 pageUrl=' + pageurl

        return resolved_media_url
예제 #28
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):

        import urllib2
        import re
        from entertainment.net import Net

        net = Net(cached=False,user_agent='Magic Browser')
        
        title = self.CleanTextForSearch(title) 
        name = self.CleanTextForSearch(name)


        wait=False
        new_url='http://movietv.to/index/loadmovies'
        if type == 'tv_episodes':
            types='tv'
            r='href="/series/(.+?)".+?movie-title">(.+?)</h2>'
            NEW='http://movietv.to/series/'
        else:
            types='movie'
            r='href="/movies/(.+?)".+?movie-title">(.+?)</h2>'
            NEW='http://movietv.to/movies/'
            
        data={'loadmovies':'showData','page':'1','abc':'All','genres':'','sortby':'Popularity','quality':'All','type':types,'q':name}
        content=net.http_POST(new_url,data,headers={'Referer':'http://movietv.to'}).content
        
       
        match=re.compile(r,re.DOTALL).findall (content)
        print 'wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww'
        print match
        for URL , TITLE in match:
                print TITLE
                print URL
                if name.lower() in TITLE.lower():
                    if type == 'tv_episodes':
                        id=URL.split('-')[0]
                        LINKURL='http://movietv.to/series/getLink?id=%s&s=%s&e=%s' % (id,season,episode)
                        contents=net.http_GET(LINKURL).content
                        import json
                        match=json.loads(contents)['url']
                        

                    else:
                        
                        contents=net.http_GET(NEW+URL).content
                        
                        match=re.compile('<source src="(.+?)" type=\'video/mp4\'>').findall(contents)[0]
                    
                    self.GetFileHosts(match, list, lock, message_queue,URL)
예제 #29
0
    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)
예제 #30
0
    def Resolve(self, url):
        resolved_media_url = ''
        import re
        from entertainment.net import Net
        net = Net()
        
        content = net.http_GET(url, headers={'Referer':self.base_url}).content
        answer=re.compile('Question: (.+?) =').findall(content)[0].replace('x','*')

        data={'captcha':eval(answer)}
        content = net.http_POST(url,data, headers={'Referer':self.base_url}).content

        '''
        m3u8_url = re.search('[\'"](http.+?\.m3u8.+?)[\'"]', content)
        if m3u8_url:
            resolved_media_url = m3u8_url.group(1)
        '''
        token_url = re.compile('\$.getJSON\("(.+?)",').findall(content)[0]
        import datetime
        time_now=datetime.datetime.now()
        import time
        epoch=time.mktime(time_now.timetuple())+(time_now.microsecond/1000000.)
        epoch_str = str('%f' % epoch)
        epoch_str = epoch_str.replace('.','')
        epoch_str = epoch_str[:-3]

        token_url = token_url + '&_=' + epoch_str
        token = re.compile('":"(.+?)"').findall(net.http_GET(token_url+'&_='+str(epoch), headers={'Referer':url}).content)[0]
        
        streamer = re.search('streamer: "(.+?)"', content).group(1)
        
        playpath = re.search('file: "(.+?)"', content).group(1)
        if playpath.endswith('.flv'):
            playpath = playpath[:-4]
        elif playpath.endswith('.mp4'):
            playpath = 'mp4:' + playpath
        
        player = re.search('flashplayer: "(.+?)"', content).group(1)
        pageurl = self.base_url #url
        streamer = streamer.replace('\/', '/')
        app = re.search('rtmp://[\.\w\:]*/(.*)', streamer).group(1)
        
        resolved_media_url = streamer + ' app=' + app + ' playpath=' + playpath + ' swfUrl=' + player + ' live=1 timeout=15 token=' + token + ' swfVfy=1 pageUrl=' + pageurl
        
        return resolved_media_url
예제 #31
0
    def Resolve(self, url):

        from entertainment.net import Net
        net = Net()

        if 'playsominaltv.com' in url:

            net._cached = False

            premium_url = 'http://www.playsominaltv.com/login/?redirect_to=' + url
            content = net.http_GET(premium_url, headers={
                'Referer': url
            }).content
            params = {
                'log': self.Settings().get_setting('user'),
                'pwd': self.Settings().get_setting('pass'),
                'wp-submit': '1'
            }
            for hidden_param in re.finditer(
                    '(<input.+?type=[\'"]{1}hidden[\'"]{1}.+?/>)', content):
                hidden_param_input = hidden_param.group(1)
                param_name = re.search('name=[\'"]{1}(.+?)[\'"]{1}',
                                       hidden_param_input).group(1)
                param_value = re.search('value=[\'"]{1}(.+?)[\'"]{1}',
                                        hidden_param_input).group(1)
                params.update({param_name: param_value})
            content = net.http_POST('http://www.playsominaltv.com/login/',
                                    params,
                                    headers={
                                        'Referer': premium_url
                                    }).content

        if 'playsominaltv.com' in url or 'sominaltvfilms.com' in url or 'desionlinetheater.com' in url:
            content = net.http_GET(url).content
            content = dekode(content)
            if content:
                source_url = re.search('<iframe.+?src.+?(http.+?)[\'"\\\\]{1}',
                                       content)
                if source_url:
                    return MovieSource.Resolve(self, source_url.group(1))
        else:
            return MovieSource.Resolve(self, url)

        return url
예제 #32
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):                 
        new_url = 'http://www.kissdrama.net/index.php'
        import re
        from entertainment.net import Net
        
        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)
        
        if os.path.exists(self.cookie_file):
                try: os.remove(self.cookie_file)
                except: pass
                
        headers={'Referer':'http://www.kissdrama.net/results.php', 'X-Requested-With':'XMLHttpRequest','Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}

         
        name = self.CleanTextForSearch(name)

        form_data={ 'c':'result', 'a':'retrieve', 'p':'{"KeyWord":"%s (%s)","Page":"1","NextToken":""}' % (name,year) }
        content = net.http_POST('http://www.kissdrama.net/index.php', form_data, headers).content
        
        helper = '%s (%s)' %(name,year)

        if len(episode)<2:
            episode='0%s' % episode
        
        match=re.compile('<h1 class="text"><a href="(.+?)" target="_blank">(.+?)</a>.+?width="20" height="20" />(.+?)</h3>',re.DOTALL).findall(content)
        urlselect  = []

        for url,TITLE, res in match:
            
            url= 'http://www.kissdrama.net/'+url
            if url not in urlselect:
                urlselect.append(url)

                quality = 'SD'
                res_lower = '.' + res.lower() + '.'
                for quality_key, quality_value in common.quality_dict.items():
                    if re.search('[^a-zA-Z0-0]' + quality_key + '[^a-zA-Z0-0]', res_lower):
                        quality = quality_value
                        break 
        
                if year in TITLE:
                    if '>full<' in TITLE.lower():
                        self.GetFileHosts(url, list, lock, message_queue,quality,episode)
예제 #33
0
    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
예제 #34
0
    def GetFileHosts(self, url, list, lock, message_queue,season,episode,showname):

        import re
        from entertainment.net import Net
        
        net = Net(cached=False,user_agent='Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko')
                  
        new_url = url

        r='%s-sezon-%s' % (season,episode)
  
        content= net.http_GET(new_url,headers={'X-Requested-With': 'XMLHttpRequest'}).content
        match=re.compile('img alt="(.+?)".+?class="seep" href="(.+?)"',re.DOTALL).findall(content)
        for title , url in match:
       

            if showname.lower() in title.lower():
                
                if r in url:
                    page = net.http_GET(url,headers={'X-Requested-With': 'XMLHttpRequest'}).content
                    video_id = re.compile('var video_id.+?"(.+?)"').findall(page)[0]
                    part_name = re.compile('var part_name.+?"(.+?)"').findall(page)[0]
                    videourl='http://sezonlukdizi.com/service/get_video_part'

                    data = {'video_id': video_id, 'part_name': part_name,'page':'0'}
                    html=  net.http_POST(videourl,data,headers={'X-Requested-With': 'XMLHttpRequest'}).content
                    print html
                    import json

                    link= json.loads(html)
          
                    scriptpage=re.compile('src="(.+?)"').findall(str(link))[0]
                    contents= net.http_GET(scriptpage,headers={'X-Requested-With': 'XMLHttpRequest'}).content
                    contented=contents.split('{')
                    for p in contented:
                        try:
                            source =re.compile('file.+?"(.+?)"').findall(p)[0]
                            res =re.compile('label.+?"(.+?)"').findall(p)[0]
                            if res.endswith('p'):
                                self.AddFileHost(list, res.upper(), source+'|'+scriptpage,host='GOOGLEVIDEO.COM')
                        except:pass       
예제 #35
0
파일: yify_mvs.py 프로젝트: bialagary/mw
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):

        from entertainment.net import Net
        import re
        net = Net(cached=False)        
        
        name = self.CleanTextForSearch(name) 


        data={'action': 'ajaxy_sf', 'sf_value': name}
        headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36'}
        html=   net.http_POST('http://yify.tv/wp-admin/admin-ajax.php',data,headers=headers).content
        
        import json
        result=json.loads(html)
        data=result['post']['all']
        for field in data:
           url =field['post_link']
           title =field['post_title']
           if name == title:
               self.GetFileHosts(url, list, lock, message_queue,name)
예제 #36
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):

        from entertainment.net import Net
        import re
        net = Net(cached=False)        
        
        name = self.CleanTextForSearch(name) 
        season = self.CleanTextForSearch(season) 
        episode = self.CleanTextForSearch(episode)
            
        scrape ='S' + season+ ', Ep' + episode
        search_term = name
        helper_term = 'tvshow'
        data     = {'q': name}
        headers  = {'Host':'hdtvshows.net',
                                            'Origin':'http://hdtvshows.net',
                                            'Referer':'http://hdtvshows.net','User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36'}
        html = net.http_POST('http://hdtvshows.net/find.php', data, headers).content
           
        r='%s Free " href="(.+?)">' % name
        match=re.compile(r).findall(html)[0]
        self.GetFileHosts(self.base_url+match, list, lock, message_queue,scrape)
예제 #37
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):

        if type != 'movies': return
        import re

        from entertainment.net import Net
        net = Net(cached=False)

        title = self.CleanTextForSearch(title)
        name = self.CleanTextForSearch(name)

        headers = {
            'User-Agent':
            'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36'
        }

        import urllib

        movie_url = self.base_url + (
            'search.php?q=%s' % name.replace(' ', '+') + '+' +
            year.replace(' ', '+'))

        content = net.http_GET(movie_url, headers=headers).content

        DATA = re.compile('type="submit" name=".+?" id="(.+?)" value="(.+?)"'
                          ).findall(content)

        content = net.http_POST(movie_url, {
            DATA[0][0]: DATA[0][1]
        },
                                headers=headers).content

        search_result = re.search(r'<div class="movie_pic"><a href="(.+?)"',
                                  content)
        if search_result:
            search_result = search_result.group(1)

            self.GetFileHosts(search_result, list, lock, message_queue)
예제 #38
0
파일: oss_ltvs.py 프로젝트: bialagary/mw
    def Resolve(self, url):
        import re
        
        from entertainment.net import Net
        net = Net()
        loginurl = 'http://offsidestreams.com/site/wp-login.php'
        username = self.Settings().get_setting('tv_user')
        password = self.Settings().get_setting('tv_pwd')
        site='http://offsidestreams.com/site/live-tv/'
        data     = {'pwd': password,
                                                'log': username,
                                                'wp-submit': 'Log In','redirect_to':'http://offsidestreams.com/site','testcookie':'1'}
        headers  = {'Host':'offsidestreams.com',
                                                'Origin':'http://offsidestreams.com',
                                                'Referer':'http://offsidestreams.com/site/wp-login.php',
                                                        'X-Requested-With':'XMLHttpRequest'}
        html = net.http_POST(loginurl, data, headers).content

        
        auth  = re.findall('urlkey1 = "(.+?)"',html,re.M|re.DOTALL)[0]
        stream_url = '%s swfUrl=http://p.jwpcdn.com/6/8/jwplayer.flash.swf app=liveedge?wmsAuthSign=%s pageUrl=%s swfVfy=true live=true timeout=15' % (url.replace('" + urlkey1 + "', auth), auth, site)
        return stream_url
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):

        import json
        from entertainment.net import Net
        net = Net(cached=False)

        name = self.CleanTextForSearch(name)
        data = {
            'DeviceId': '6a48880da9855891b8baad7d7b34570d998b28c5',
            'Hash': 'f93e3156637c9fce37154e2d091bca8a',
            'Key': 'AA9FSK1323X3F',
            'Pagesize': '-1',
            'Keyword': name,
            'StartIndex': '0',
            'Version': '5'
        }

        link = json.loads(
            net.http_POST(self.SEARCHLINK, data, headers=self.HEADERS).content)

        data = link['Data']

        for field in data:
            TITLE = field['Name'].encode('utf8')
            iconimage = field['ThumbnailUrl'].encode('utf8')
            id = field['Link']
            if not id:
                id = field['Id']
                if name.lower() in self.CleanTextForSearch(TITLE.lower()):
                    self.GetFileHosts(id, list, lock, message_queue, type,
                                      season, episode)
            else:
                if name.lower() in self.CleanTextForSearch(TITLE.lower()):
                    if year in TITLE:
                        self.GetFileHosts(id, list, lock, message_queue, type,
                                          season, episode)
예제 #40
0
    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')
예제 #41
0
 def get_api_key(self):
     api_key = self.Settings().get_setting('api_key')
     if api_key==None or api_key=='':                                
         furk_user = self.Settings().get_setting('furk_user')
         furk_pwd = self.Settings().get_setting('furk_pwd')
         
         if furk_user != '' and furk_pwd != '':
         
             import json
             from entertainment.net import Net
             net = Net()
         
             trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
             
             login_command = "/api/login/login"
             login_params = {"login": furk_user, "pwd": furk_pwd}
             login_url = "%s%s" % (self.api_url, login_command)
             login_content = net.http_POST(login_url, login_params).content.translate(trans_table)
             login_data = json.loads(login_content)
             if login_data['status'] == 'ok':
                 api_key = login_data['api_key']
                 self.Settings().set_setting('api_key', api_key)
             
     return api_key
예제 #42
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):
        import re
        from entertainment.net import Net

        net = Net(cached=False)

        title = self.CleanTextForSearch(title)
        name = self.CleanTextForSearch(name)

        if type == 'tv_episodes':
            search_term = '%s</h1>' % (re.sub('\A(a|A|the|THE|The)\s', '',
                                              name))
            episode_get = '?season=%s&episode=%s#searialinks' % (season,
                                                                 episode)

            movie_url = 'http://moviestorm.eu/search'
            data = {'q': name, 'go': 'Search'}
            content = net.http_POST(movie_url, data).content

            html = content.split('<div class="movie_box">')

            for p in html:
                if search_term in p:

                    match = re.compile('<a href="(.+?)"').findall(p)
                    for url in match:
                        if 'http://moviestorm.eu/view' in url:

                            new_tv_url = url + episode_get

                            link = net.http_GET(new_tv_url).content

                            quality = link.split('<td class="quality_td">')
                            for p in quality:
                                res = p.split('</td>')[0].strip()
                                ep = re.compile(
                                    '<a target="_blank" href="(.+?)">WATCH</a>'
                                ).findall(p)
                                try:
                                    episode_link = re.compile(
                                        'href="(.+?)">WATCH</a>').findall(p)[0]

                                    host = movie_link.split('//')[1]
                                    host = host.split('/')[0]
                                    self.GetFileHosts(episode_link, list, lock,
                                                      message_queue, res, host)
                                except:
                                    pass

        elif type == 'movies':
            name = name.rstrip()
            search_term = '%s</h1>' % (re.sub('\A(a|A|the|THE|The)\s', '',
                                              name))
            movie_url = 'http://moviestorm.eu/search'
            data = {'q': name, 'go': 'Search'}
            content = net.http_POST(movie_url, data).content

            html = content.split('<div class="movie_box">')

            for p in html:
                if search_term in p:

                    new_url = re.compile('<a href="(.+?)"').findall(p)[0]

                    if 'http://moviestorm.eu/view' in new_url:

                        link = net.http_GET(new_url).content
                        quality = link.split('<td class="quality_td">')
                        for p in quality:
                            res = p.split('</td>')[0].strip()
                            try:
                                movie_link = re.compile(
                                    'href="(.+?)">WATCH</a>').findall(p)[0]

                                host = movie_link.split('//')[1]
                                host = host.split('/')[0]
                                self.GetFileHosts(movie_link, list, lock,
                                                  message_queue, res, host)
                            except:
                                pass
예제 #43
0
    def Resolve(self, url):
    
        api_key = self.get_api_key()
        if api_key == None or api_key == '':
            return
    
        import json
        from entertainment.net import Net
        net = Net(cached=False)
        
        from entertainment import odict
        resolved_media_urls = odict.odict()
        
        trans_table = ''.join( [chr(i) for i in range(256)] + [' '] * 256 )
    
        file_get_command = "/api/file/get"
        file_get_params = {"id" : url, 't_files':'1', 'api_key':api_key}
        file_get_url = "%s%s" % (self.api_url, file_get_command)

        try:
            file_get_content = net.http_POST(file_get_url, file_get_params).content.translate(trans_table)
        except:
            file_get_content = net.http_POST(file_get_url, file_get_params).content#.translate(trans_table)
        file_get_data = json.loads(file_get_content)

        if file_get_data['status'] != 'ok' or file_get_data['found_files'] != '1' :
            return
            
        data_files = file_get_data['files']
        data_files = (data_files[0])['t_files']
        for data_file in data_files:
            data_file_name = data_file['name']
            data_file_format = "[COLOR red][" + (data_file_name[data_file_name.rfind('.')+1:]).upper() + "][/COLOR]"
            if 'video' in data_file['ct'] and 'sample' not in data_file_name.lower():
            
                bitrate = data_file.get('bitrate', None)
                if bitrate:
                    
                    file_url =  data_file.get('url_dl', None)
                    if file_url:
                    
                        file_size_fmt = '[COLOR orange][%s][/COLOR]'
                        file_size = 'NA'
                        
                        file_size_in_bytes =  data_file['size']
                        if file_size_in_bytes:
                            flt_file_size_in_bytes = float(file_size_in_bytes)
                                                    
                            if flt_file_size_in_bytes <= 1024: 
                                file_size = '.%2f KB' % (flt_file_size_in_bytes/1024)
                            elif flt_file_size_in_bytes <= 1048576: 
                                file_size = '%.2f MB' % (flt_file_size_in_bytes/1048576)
                            else:
                                file_size = "%.2f GB" % (flt_file_size_in_bytes/1073741824)
                                
                            file_name = data_file_format + " " + (file_size_fmt % file_size) + " " + data_file_name
                
                            resolved_media_urls[file_name] = file_url

        if len(resolved_media_urls) == 0:
            resolved_media_urls == None
        elif len(resolved_media_urls) == 1:
            resolved_media_urls = ((resolved_media_urls.items())[0])[1]

        return resolved_media_urls
예제 #44
0
    def Resolve(self, url):
        import decrypter
        from entertainment.net import Net
        import re
        net = Net(cached=False)
        html = net.http_GET(url).content
        encoded_stuff = re.search('(?s)(<script>eval.+?</script>)', html)
        if encoded_stuff:
            encoded_stuff = encoded_stuff.group(1)
            self.decode(encoded_stuff)
            
            kplayer_root_url = re.search('KPlayer.kplayer_root_url = [\'"](.+?)[\'"]', decoded_stuff).group(1).replace('\/','/')
            kplayer_e = re.search('KPlayer.init\([\'"](.+?)[\'"]\)', decoded_stuff).group(1)
            html = net.http_POST(kplayer_root_url, {'url':kplayer_e}, headers={'Referer':url}).content
            j = json.loads(html)
            captcha_k = ""
            if j['status'] == False and j['code']==3:
                captcha_dict = common.handle_captcha(url, '<script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js">', params={'site':j['k']})
                if captcha_dict['status'] == 'ok':
                    html = net.http_POST(kplayer_root_url, {'url':kplayer_e, 'chall':captcha_dict['challenge'], 'res':captcha_dict['captcha']}, headers={'Referer':url}).content
                    print html
                    playfiles = json.loads(html)
                    
                    res_name = []
                    res_url = []
                    
                    if playfiles['status']==True and playfiles['code']==1000:
                        for playfile in playfiles['source']:
                            res_name.append(playfile['label'])
                            res_url.append(playfile['file'])
                            
                        dialog = xbmcgui.Dialog()
                        ret = dialog.select('Please Select Stream Quality.',res_name)
                        if ret < 0:
                            return None

                        else:
                            return res_url[ret].replace('\/','/').replace('\u003d','=').replace('\u0026','&')

        else:
            headers={'Host':'r20---googlevideo.com', 'Referer': url , 'User-Agent':'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36'}
            html = net.http_GET(url).content
            if '<div id="embedHolder" style="display:none;"><iframe src="' in html:
                item_url=re.compile('<div id="embedHolder" style="display:none;"><iframe src="(.+?)"').findall(html)[0]
                headers={'Host':'r20---googlevideo.com', 'Referer': url , 'User-Agent':'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36'}

                content = net.http_GET(item_url,headers).content

                new_url = re.search("[\"']{1}file[\"']{1}\:[\"']{1}(.+?)[\"']{1}", content)
                if new_url:
                    new_url = new_url.group(1).replace("\/", "/")

                    headers.update({'Referer':item_url, 'Accept':'*/*', 'Accept-Encoding':'identity;q=1, *;q=0', 'Range':'bytes=0-'})
                    import urllib2
                    try:
                        new_content =  net.http_GET(new_url,headers,auto_read_response=False)
                        play_url = new_content.get_url()
                    except urllib2.HTTPError, error:
                        play_url = error.geturl()
                    
                    return play_url        
                
            else:
예제 #45
0
    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)           
예제 #46
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):                 
        import re
        from entertainment.net import Net
        
        net = Net(cached=False)
        
        title = self.CleanTextForSearch(title) 
        name = self.CleanTextForSearch(name) 

        
        if type == 'tv_episodes':
            search_term = '%s</h1>'%(re.sub('\A(a|A|the|THE|The)\s','',name))
            episode_get = '?season=%s&episode=%s#searialinks'%(season,episode)

            movie_url = 'http://moviestorm.eu/search'
            data={'q':name,'go':'Search'}         
            content = net.http_POST(movie_url,data).content
            
            html=content.split('<div class="movie_box">')
            
            for p in html:
                if search_term in p:
                    
                    match=re.compile('<a href="(.+?)"').findall(p)
                    for url in match:
                        if 'http://moviestorm.eu/view' in url:
                            
                            new_tv_url= url+episode_get
                            
                            link = net.http_GET(new_tv_url).content

                            quality=link.split('<td class="quality_td">')
                            for p in quality:
                                res= p.split('</td>')[0]
                                ep=re.compile('<a target="_blank" href="(.+?)">WATCH</a>').findall(p)
                                host=re.compile('data-host="(.+?)"').findall(p)[0]
                                for episode_link in ep:
                            
                                    self.GetFileHosts(episode_link,list, lock, message_queue,res,host)
                            
                
            

                

            
        elif type == 'movies':
            name = name.rstrip()
            search_term = '%s</h1>'%(re.sub('\A(a|A|the|THE|The)\s','',name))
            movie_url = 'http://moviestorm.eu/search'
            data={'q':name,'go':'Search'}         
            content = net.http_POST(movie_url,data).content
        
            html=content.split('<div class="movie_box">')
            
            for p in html:
                if search_term in p:
                    
                    new_url=re.compile('<a href="(.+?)"').findall(p)[0]
                        
                    if 'http://moviestorm.eu/view' in new_url:
                        
                        link = net.http_GET(new_url).content
                        quality=link.split('<td class="quality_td">')
                        for p in quality:
                            res= p.split('</td>')[0]
                            try:
                                movie_link=re.compile('href="(.+?)">WATCH</a>').findall(p)[0]
                                host=re.compile('data-host="(.+?)"').findall(p)[0]
                                self.GetFileHosts(movie_link, list, lock, message_queue,res,host)
                            except:pass                                        
    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)           
예제 #48
0
    def Resolve(self, url):
        #print url
        import urllib

        if '|' in url:
            splits = url.split('|')
            data_name = splits[0]
            data_film = splits[1]
            data_server = splits[2]
            REF = splits[3]

            from entertainment.net import Net
            import time, json, re

            net = Net(
                cached=False,
                user_agent=
                'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko'
            )

            headers = {'X-Requested-With': 'XMLHttpRequest', 'Referer': REF}

            query = {
                'ipplugins': '1',
                'ip_film': data_film,
                'ip_server': data_server,
                'ip_name': data_name
            }

            url = 'http://9movies.tv/ip.temp/swf/plugins/ipplugins.php'
            #print url
            result = net.http_POST(url, query, headers=headers).content

            result = json.loads(result)
            #print result

            if 'error' in result:
                return ''

            try:
                plugin_s = result['s']
                url = 'http://9movies.tv/ip.temp/swf/ipplayer/ipplayer.php?u=%s&w=%s&h=%s&s=%s' % (
                    result['s'], '100%25', '500', data_server)
                headers = {
                    'X-Requested-With': 'XMLHttpRequest',
                    'Referer': REF
                }
                result = net.http_GET(url, headers=headers).content
                result = json.loads(result)

                if result["type"] == 3:
                    url = result["data"].replace('\/', '/')
                elif result["type"] == 1:
                    url = result["data"][0]["files"]

                if 'redirector' in url:
                    url = urllib.urlopen(url).geturl()
                    if 'requiressl=yes' in url:
                        url = url.replace('http://', 'https://')
                    else:
                        url = url.replace('https://', 'http://')
                else:
                    from entertainment import istream
                    url = istream.ResolveUrl(url)
            except:
                pass

        else:
            from entertainment import istream
            url = istream.ResolveUrl(url)

        return url
예제 #49
0
    def Resolve(self, url):
    
        api_key = self.get_api_key()
        if api_key == None or api_key == '':
            return
    
        import json
        from entertainment.net import Net
        net = Net()
        
        from entertainment import odict
        resolved_media_urls = odict.odict()
        
        trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
    
        file_get_command = "/api/file/get"
        file_get_params = {"id" : url, 't_files':'1', 'api_key':api_key}
        file_get_url = "%s%s" % (self.api_url, file_get_command)

        file_get_content = net.http_POST(file_get_url, file_get_params).content.translate(trans_table)
        file_get_data = json.loads(file_get_content)

        if file_get_data['status'] != 'ok' or file_get_data['found_files'] != '1' :
            return
            
        data_files = file_get_data['files']
        data_files = (data_files[0])['t_files']
        for data_file in data_files:
            data_file_name = data_file['name']
            data_file_format = "[COLOR red][" + (data_file_name[data_file_name.rfind('.')+1:]).upper() + "][/COLOR]"
            if 'video' in data_file['ct'] and 'sample' not in data_file_name.lower():
            
                bitrate = data_file.get('bitrate', None)
                if bitrate:
                    
                    file_url =  data_file.get('url_dl', None)
                    if file_url:
                    
                        file_size_fmt = '[COLOR orange][%s][/COLOR]'
                        file_size = 'NA'
                        
                        file_size_in_bytes =  data_file['size']
                        if file_size_in_bytes:
                            flt_file_size_in_bytes = float(file_size_in_bytes)
                                                    
                            if flt_file_size_in_bytes <= 1024: 
                                file_size = '.%2f KB' % (flt_file_size_in_bytes/1024)
                            elif flt_file_size_in_bytes <= 1048576: 
                                file_size = '%.2f MB' % (flt_file_size_in_bytes/1048576)
                            else:
                                file_size = "%.2f GB" % (flt_file_size_in_bytes/1073741824)
                                
                            file_name = data_file_format + " " + (file_size_fmt % file_size) + " " + data_file_name
                
                            resolved_media_urls[file_name] = file_url

        if len(resolved_media_urls) == 0:
            resolved_media_urls == None
        elif len(resolved_media_urls) == 1:
            resolved_media_urls = ((resolved_media_urls.items())[0])[1]

        return resolved_media_urls
예제 #50
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):                 
        
        api_key = self.get_api_key()
        if api_key == None or api_key == '':
            return
        
        furk_adult_filter = self.Settings().get_setting('furk_adult_filter')
            
        import json
        from entertainment.net import Net
        net = Net()
                
        name = self.CleanTextForSearch(name) 
        
        match_name = name.lower()
        
        trans_table = ''.join( [chr(i) for i in range(128)] + [' '] * 128 )
        
        search_command = "/api/plugins/metasearch"
        search_query = name
        if 'movie' in type:
            search_query += " " + year
        elif 'tv' in type:
            season_episode = "s%02de%02d" % ( int(season), int(episode) )
            search_query += " " + season_episode
        
        res = self.resolution(type)
        if res == '1':
            search_query += " -1080p"
        elif res == '2':
            search_query += " 720p"
        elif res == '3':
            search_query += " 1080p"
            
        ext = self.fileext(type)
        if ext != "ANY":
            search_query += " " + ext
            
        minsz = self.minfilesize(type)
        maxsz = self.maxfilesize(type)
            
        search_params = {"match" : "extended", "sort" : "relevance", 
            "moderated" : "yes" if furk_adult_filter == "true" else "no", "offset": "0", "filter" : "cached",
            "limit" : self.maxresults(type), "q" : search_query, 'api_key':api_key}
        search_url = "%s%s" % (self.api_url, search_command)

        search_content = net.http_POST(search_url, search_params).content.translate(trans_table)
        search_data = json.loads(search_content)

        if search_data['status'] != 'ok':
            return
        
        search_stats = search_data['stats']
        total_found = search_stats['total_found']
        if int(total_found) <= 0:
            return
        
        import re
        
        data_files = search_data['files']
        for data_file in data_files:
        
            file_name = data_file['name']           
            file_name_lower = file_name.lower()
            if self.Match(match_name, file_name_lower) == False:
                continue
            
            file_info = data_file['video_info']           
            file_id = data_file['id']

            if data_file['is_ready'] == '1' and data_file['type'] == 'video':
            
                bitrate = re.compile('bitrate: (.+?)\n').findall(file_info)
                if bitrate:
                    bitrate = bitrate[0]
                    
                    file_size_fmt = '[COLOR orange][FMT: %s, FSZ: %s][/COLOR]'
                    file_size = 'NA'
                    
                    file_size_in_bytes =  data_file['size']
                    if file_size_in_bytes:
                        flt_file_size_in_bytes = float(file_size_in_bytes)

                        if minsz != None and flt_file_size_in_bytes < minsz:
                            continue
                        if maxsz != None and flt_file_size_in_bytes > maxsz:
                            continue

                        if flt_file_size_in_bytes <= 1048576: 
                            file_size = '.%2f KB' % (flt_file_size_in_bytes/1024)
                        elif flt_file_size_in_bytes <= 1073741824: 
                            file_size = '%.2f MB' % (flt_file_size_in_bytes/1048576)
                        else:
                            file_size = "%.2f GB" % (flt_file_size_in_bytes/1073741824)
                        
                        res = 'NA'
                        for key, value in common.quality_dict.iteritems():
                            if re.search('[^a-zA-Z0-9]' + key + '[^a-zA-Z0-9]', file_name_lower):
                                res = value
                                break
                            
                        if '3d' in file_name_lower:
                            res='3D'
                            
                        if res == 'NA':
                            if 'GB' in file_size:
                                file_sz_flt = float( re.search( '([0-9\.]+)', file_size ).group(1) )
                                if file_sz_flt >= 2.0:
                                    res = 'HD'
                                else:
                                    res = 'SD'
                            else:
                                res = 'LOW'
                                
                        file_format = 'NA'
                        for key, value in common.movie_container_dict.iteritems():
                            if re.search('[^a-zA-Z0-9]' + key + '[^a-zA-Z0-9]', file_name_lower) or file_name_lower.endswith(key):
                                file_format = value
                                break
                            
                        file_name = (file_size_fmt % (file_format, file_size)) + " " + file_name
            
                        self.GetFileHosts(file_id, list, lock, message_queue, res, file_name)
예제 #51
0
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
    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)