コード例 #1
0
    def GetFileHosts(self, url, list, lock, message_queue):
        from entertainment.net import Net
        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)

        custom_url = self.get_url()

        if self.Settings().get_setting('proxy') == "true":
            import socks
            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        content = common.unescape(common.str_conv(net.http_GET(url).content))

        import re
        #print content
        for sq in re.finditer(r"quality_(.+?)>.+?url=(.+?)&", content):

            quality = sq.group(1).upper()
            quality = quality.replace('"', '')

            if quality == 'UNKNOWN':
                continue

            import base64
            host_url = base64.b64decode(sq.group(2))

            if not 'affbuzz' in host_url.lower():
                if not 'ads.ad-center.com' in host_url.lower():
                    if not 'offer?' in host_url.lower():
                        #print quality
                        self.AddFileHost(list, quality, host_url)
コード例 #2
0
    def GetFileHosts(self, url, list, lock, message_queue):
        from entertainment.net import Net

        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)

        custom_url = self.get_url()

        if self.Settings().get_setting("proxy") == "true":
            import socks

            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        content = common.unescape(common.str_conv(net.http_GET(url).content))

        import re

        for sq in re.finditer(r"<span class=quality_(.+?)>.+?<a href=\".+?external.+?url=(.+?)&", content):

            quality = sq.group(1).upper()

            if quality == "UNKNOWN":
                continue

            import base64

            host_url = base64.b64decode(sq.group(2))
            if not "affbuzz" in host_url.lower():
                self.AddFileHost(list, quality, host_url)
コード例 #3
0
    def Search(self,
               srcr,
               keywords,
               type,
               list,
               lock,
               message_queue,
               page='',
               total_pages=''):

        from entertainment.net import Net
        net = Net(cached=False, do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting('proxy') == "true":
            import socks
            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

        keywords = self.CleanTextForSearch(keywords)

        search_page_url = custom_url + 'index.php?search'

        search_page_content = common.unescape(
            common.str_conv(net.http_GET(search_page_url).content))

        import re

        search_key = re.compile(
            'input type="hidden" name="key" value="([0-9a-f]*)"',
            re.DOTALL).findall(search_page_content)[0]

        import urllib
        from entertainment import odict
        search_dict = odict.odict({
            'key':
            search_key,
            'search_keywords':
            keywords,
            'search_section':
            '1' if type == 'movies' else '2',
            'sort':
            'featured'
        })
        search_dict.sort(key=lambda x: x[0].lower())

        search_for_url = custom_url + 'index.php?' + urllib.urlencode(
            search_dict)

        self.ExtractContentAndAddtoList(srcr,
                                        'search',
                                        search_for_url,
                                        type,
                                        list,
                                        page=page,
                                        total_pages=total_pages)
コード例 #4
0
    def SearchContent(self, search_key, search_keywords, type, year):
        from entertainment.net import Net
        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting('proxy') == "true":
            import socks
            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

        import re

        import urllib
        search_dict = {
            'key': search_key,
            'search_keywords': search_keywords,
            'search_section': '1' if type == 'movies' else '2',
            'year': year
        }
        search_for_url = custom_url + 'index.php?' + urllib.urlencode(
            search_dict)

        from entertainment import odict
        search_dict_for_cache = odict.odict(search_dict)
        search_dict_for_cache.update({'key': ''})
        search_dict_for_cache.sort(key=lambda x: x[0].lower())
        search_for_url_for_cache = custom_url + 'index.php?' + urllib.urlencode(
            search_dict_for_cache)

        search_results = common.unescape(
            common.str_conv(
                net.http_GET(search_for_url,
                             url_for_cache=search_for_url_for_cache).content))
        search_content = None

        #print search_results
        for search_item in re.finditer(
                r"<div class=\"index_item.+?\"><a href=\"(.+?)\" title=\"Watch (.+?)\"",
                search_results):

            searchitem = search_item.group(2)
            if year == '0' or year == '':
                searchitem = re.sub(' \([0-9]+\)', '', searchitem)

            if common.CreateIdFromString(
                    searchitem) == common.CreateIdFromString(
                        search_keywords +
                        (' (' + year +
                         ')' if year != '0' and year != '' else '')):
                search_content = search_item
                break

        return search_content
コード例 #5
0
    def SearchContent(self, search_key, search_keywords, type, year):
        from entertainment.net import Net

        net = Net(do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting("proxy") == "true":
            import socks

            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

        import re

        import urllib

        search_dict = {
            "key": search_key,
            "search_keywords": search_keywords,
            "search_section": "1" if type == "movies" else "2",
            "year": year,
            "advanced": "1",
        }
        search_for_url = custom_url + "index.php?" + urllib.urlencode(search_dict)

        from entertainment import odict

        search_dict_for_cache = odict.odict(search_dict)
        search_dict_for_cache.update({"key": ""})
        search_dict_for_cache.sort(key=lambda x: x[0].lower())
        search_for_url_for_cache = custom_url + "index.php?" + urllib.urlencode(search_dict_for_cache)

        search_results = common.unescape(
            common.str_conv(net.http_GET(search_for_url, url_for_cache=search_for_url_for_cache).content)
        )
        search_content = None

        for search_item in re.finditer(
            r"<div class=\"index_item.+?\"><a href=\"(.+?)\" title=\"Watch (.+?)\"", search_results
        ):

            searchitem = search_item.group(2)
            if year == "0" or year == "":
                searchitem = re.sub(" \([0-9]+\)", "", searchitem)

            if common.CreateIdFromString(searchitem) == common.CreateIdFromString(
                search_keywords + (" (" + year + ")" if year != "0" and year != "" else "")
            ):
                search_content = search_item
                break

        return search_content
コード例 #6
0
    def GetFileHosts(self, url, list, lock, message_queue):

        from entertainment.net import Net
        net = Net()

        content = common.unescape(common.str_conv(net.http_GET(url).content))

        import re
        for link in re.finditer(r"href='(/watch/.+?)'>(.+?)</a>", content):
            if link.group(2).startswith('</a>'):
                continue
            self.AddLiveLink(list, link.group(2),
                             self.get_url() + link.group(1))
コード例 #7
0
    def GetFileHosts(self, url, list, lock, message_queue): 
        
        from entertainment.net import Net
        net = Net()        
        
        content = common.unescape(common.str_conv(net.http_GET(url).content))

        import re
        for link in re.finditer(r"href='(/watch/.+?)'>(.+?)</a>", content):
            if link.group(2).startswith('</a>'):
                continue
            self.AddLiveLink(list, link.group(2), self.get_url() + link.group(1))
            
コード例 #8
0
    def Search(self, srcr, keywords, type, list, lock, message_queue, page="", total_pages=""):

        from entertainment.net import Net

        net = Net(cached=False, do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting("proxy") == "true":
            import socks

            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

        keywords = self.CleanTextForSearch(keywords)

        search_page_url = custom_url + "index.php?search"

        search_page_content = common.unescape(common.str_conv(net.http_GET(search_page_url).content))

        import re

        search_key = re.search('input type="hidden" name="key" value="([0-9a-f]*)"', search_page_content).group(1)

        import urllib
        from entertainment import odict

        search_dict = odict.odict(
            {
                "key": search_key,
                "search_keywords": keywords,
                "search_section": "1" if type == "movies" else "2",
                "sort": "featured",
            }
        )
        search_dict.sort(key=lambda x: x[0].lower())

        search_for_url = custom_url + "index.php?" + urllib.urlencode(search_dict)

        self.ExtractContentAndAddtoList(srcr, "search", search_for_url, type, list, page=page, total_pages=total_pages)
コード例 #9
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type,
                               list, lock, message_queue):
        from entertainment.net import Net
        net = Net(cached=False, do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting('proxy') == "true":
            import socks
            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

        if 'primeware.racing' in custom_url:

            import xbmcaddon
            ADDON = xbmcaddon.Addon(
                id='script.icechannel.primewireag.settings')
            ADDON.setSetting('custom_text_url', 'http://www.primewire.ch/')

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

        search_page_url = custom_url + 'index.php?search'

        search_page_content = common.unescape(
            common.str_conv(net.http_GET(search_page_url).content))

        if 'virginmedia.com/courtorders' in search_page_content.lower(
        ) or 'ukispcourtorders' in search_page_content.lower(
        ) or 'is not available through bskyb' in search_page_content.lower(
        ) or 'ACCESS TO THE WEBSITES LISTED ON THIS PAGE HAS BEEN BLOCKED PURSUANT TO ORDERS OF THE HIGH COURT' in search_page_content.upper(
        ):
            import xbmcaddon
            ADDON = xbmcaddon.Addon(
                id='script.icechannel.primewireag.settings')
            ADDON.setSetting('custom_url', 'Custom')
            ADDON.setSetting('custom_text_url', 'http://www.primewire.ch/')

        import re

        search_key = re.compile(
            'input type="hidden" name="key" value="([0-9a-f]*)"',
            re.DOTALL).findall(search_page_content)[0]

        search_content = None
        name = name.replace("'", " ")
        search_content = self.SearchContent(search_key, name, type, year)

        if search_content == None and ':' in name:
            new_name = name.replace(':', ' -')
            search_content = self.SearchContent(search_key, new_name, type,
                                                year)

            if search_content == None and (new_name.endswith('s')
                                           or new_name.endswith('?')):
                new_name = new_name[:len(new_name) - 1]
                search_content = self.SearchContent(search_key, new_name, type,
                                                    year)

                if search_content == None:
                    search_content = self.SearchContent(
                        search_key, new_name, type, '0')

            if search_content == None:
                new_name = name.replace(':', '')
                search_content = self.SearchContent(search_key, new_name, type,
                                                    year)

                if search_content == None and (new_name.endswith('s')
                                               or new_name.endswith('?')):
                    new_name = new_name[:len(new_name) - 1]
                    search_content = self.SearchContent(
                        search_key, new_name, type, year)

                    if search_content == None:
                        search_content = self.SearchContent(
                            search_key, new_name, type, '0')

        if search_content == None:
            search_content = self.SearchContent(search_key, name, type, '')

        if type == 'tv_episodes' and search_content:
            show_url = search_content.group(1)
            show_url = re.sub('watch-', 'tv-', show_url)
            show_url = show_url + '/season-' + season + '-episode-' + episode

            search_content = re.search('(.*)', show_url)

        if search_content:
            self.GetFileHosts(custom_url + search_content.group(1), list, lock,
                              message_queue)
コード例 #10
0
    def GetFileHostsForContent(self, title, name, year, season, episode, type, list, lock, message_queue):
        from entertainment.net import Net

        net = Net(cached=False, do_not_cache_if_any=do_no_cache_keywords_list)

        if self.Settings().get_setting("proxy") == "true":
            import socks

            (proxy, port) = self.get_proxy()
            socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, proxy, port)
            net.set_socket_class(socks.socksocket)

        custom_url = self.get_url()

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

        search_page_url = custom_url + "index.php?search"

        search_page_content = common.unescape(common.str_conv(net.http_GET(search_page_url).content))

        if custom_url == "http://primewire.unblocked.pw/":

            import xbmcaddon

            ADDON = xbmcaddon.Addon(id="script.icechannel.PrimeWire.settings")
            ADDON.setSetting("custom_text_url", "https://www.primewire.ag/")
        if (
            "virginmedia.com/courtorders" in search_page_content
            or "ukispcourtorders" in search_page_content
            or "is not available through BSkyB" in search_page_content
            or "ACCESS TO THE WEBSITES LISTED ON THIS PAGE HAS BEEN BLOCKED PURSUANT TO ORDERS OF THE HIGH COURT"
            in search_page_content
        ):
            import xbmcaddon

            ADDON = xbmcaddon.Addon(id="script.icechannel.PrimeWire.settings")
            ADDON.setSetting("custom_url", "Custom")
            ADDON.setSetting("custom_text_url", "https://www.primewire.ag/")

        import re

        search_key = re.search('input type="hidden" name="key" value="([0-9a-f]*)"', search_page_content).group(1)

        search_content = None
        name = name.replace("'", " ")
        search_content = self.SearchContent(search_key, name, type, year)

        if search_content == None and ":" in name:
            new_name = name.replace(":", " -")
            search_content = self.SearchContent(search_key, new_name, type, year)

            if search_content == None and (new_name.endswith("s") or new_name.endswith("?")):
                new_name = new_name[: len(new_name) - 1]
                search_content = self.SearchContent(search_key, new_name, type, year)

                if search_content == None:
                    search_content = self.SearchContent(search_key, new_name, type, "0")

            if search_content == None:
                new_name = name.replace(":", "")
                search_content = self.SearchContent(search_key, new_name, type, year)

                if search_content == None and (new_name.endswith("s") or new_name.endswith("?")):
                    new_name = new_name[: len(new_name) - 1]
                    search_content = self.SearchContent(search_key, new_name, type, year)

                    if search_content == None:
                        search_content = self.SearchContent(search_key, new_name, type, "0")

        if search_content == None:
            search_content = self.SearchContent(search_key, name, type, "")

        if type == "tv_episodes" and search_content:
            show_url = search_content.group(1)
            show_url = re.sub("watch-", "tv-", show_url)
            show_url = show_url + "/season-" + season + "-episode-" + episode

            search_content = re.search("(.*)", show_url)

        if search_content:
            self.GetFileHosts(custom_url + search_content.group(1), list, lock, message_queue)