• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python client.replaceHTMLCodes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中modules.libraries.client.replaceHTMLCodes函数的典型用法代码示例。如果您正苦于以下问题:Python replaceHTMLCodes函数的具体用法?Python replaceHTMLCodes怎么用?Python replaceHTMLCodes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = self.search_link % (urllib.quote_plus(title))
            query = urlparse.urljoin(self.base_link, query)

            result = client.source(query)
            result = client.parseDOM(result, "div", attrs = { "class": "home_post_cont.+?" })

            title = cleantitle.movie(title)
            years = ['(%s)' % str(year), '(%s)' % str(int(year)+1), '(%s)' % str(int(year)-1)]

            result = [(client.parseDOM(i, "a", ret="href")[0], client.parseDOM(i, "img", ret="title")[0]) for i in result]
            result = [(i[0], client.replaceHTMLCodes(i[1])) for i in result]
            result = [(i[0], client.parseDOM(i[1], "a")) for i in result]
            result = [(i[0], i[1][0]) for i in result if len(i[1]) > 0]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[1] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:25,代码来源:movienight_mv.py


示例2: get_sources

    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None:
                return sources

            result = ""
            links = [self.link_1, self.link_2, self.link_3]
            for base_link in links:
                result = client.source(urlparse.urljoin(base_link, url), headers=self.headers)
                if "link_name" in str(result):
                    break

            result = result.decode("iso-8859-1").encode("utf-8")
            result = result.replace("\n", "")

            quality = re.compile(">Links - Quality(.+?)<").findall(result)[0]
            quality = quality.strip()
            if quality == "CAM" or quality == "TS":
                quality = "CAM"
            elif quality == "SCREENER":
                quality = "SCR"
            else:
                quality = "SD"

            links = client.parseDOM(result, "div", attrs={"id": "links"})[0]
            links = client.parseDOM(links, "ul")

            for i in links:
                try:
                    host = client.parseDOM(i, "li", attrs={"id": "link_name"})[-1]
                    try:
                        host = client.parseDOM(host, "span", attrs={"class": "google-src-text"})[0]
                    except:
                        pass
                    host = host.strip().lower()
                    if not host in hostDict:
                        raise Exception()
                    host = client.replaceHTMLCodes(host)
                    host = host.encode("utf-8")

                    url = client.parseDOM(i, "a", ret="href")[0]
                    url = client.replaceHTMLCodes(url)
                    try:
                        url = urlparse.parse_qs(urlparse.urlparse(url).query)["u"][0]
                    except:
                        pass
                    if not url.startswith("http"):
                        url = urlparse.urljoin(self.base_link, url)
                    url = url.encode("utf-8")

                    sources.append({"source": host, "quality": quality, "provider": "Movie25", "url": url})
                except:
                    pass

            return sources
        except:
            return sources
开发者ID:marnnie,项目名称:Cable-buenaventura,代码行数:59,代码来源:movie25_mv.py


示例3: get_sources

    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None: return sources

            result = ''
            links = [self.link_1, self.link_2, self.link_3]
            for base_link in links:
                result = client.source(urlparse.urljoin(base_link, url), headers=self.headers)
                if 'original-title' in str(result): break

            links = client.parseDOM(result, "tr", attrs = { "id": "pt.+?" })

            for i in links:
                try:
                    lang = re.compile('<img src=[\'|\"|\s|\<]*(.+?)[\'|\"|\s|\>]').findall(i)[1]
                    if not 'English' in lang: raise Exception()

                    host = re.compile('<img src=[\'|\"|\s|\<]*(.+?)[\'|\"|\s|\>]').findall(i)[0]
                    host = host.rsplit('.', 1)[0].rsplit('.', 1)[0].rsplit('/', 1)[-1]
                    host = host.strip().lower()
                    host = client.replaceHTMLCodes(host)
                    host = host.encode('utf-8')

                    if '>Cam<' in i or '>TS<' in i: quality = 'CAM'
                    elif '>HD<' in i and host in hosthdDict: quality = 'HD'
                    else: quality = 'SD'

                    if quality == 'HD' and not host in hosthdDict: raise Exception()
                    if quality == 'SD' and not host in hostDict: raise Exception()

                    if '>3D<' in i: info = '3D'
                    else: info = ''

                    url = re.compile('href=[\'|\"|\s|\<]*(.+?)[\'|\"|\s|\>]').findall(i)[0]
                    url = client.replaceHTMLCodes(url)
                    try: url = urlparse.parse_qs(urlparse.urlparse(url).query)['u'][0]
                    except: pass
                    if url.startswith('http'): url = urlparse.urlparse(url).path
                    if not url.startswith('http'): url = urlparse.urljoin(self.base_link, url)
                    url = url.encode('utf-8')

                    sources.append({'source': host, 'quality': quality, 'provider': 'Iwatchonline', 'url': url, 'info': info})
                except:
                    pass

            return sources
        except:
            return sources
开发者ID:Mendim,项目名称:tdbaddon,代码行数:50,代码来源:iwatchonline_mv_tv.py


示例4: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = self.search_link % (urllib.quote_plus(title))
            query = urlparse.urljoin(self.base_link, query)

            result = client.source(query)
            result = client.parseDOM(result, "div", attrs = { "id": "post-.+?" })

            title = cleantitle.movie(title)
            years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]

            result = [(client.parseDOM(i, "a", ret="href")[0], client.parseDOM(i, "a", ret="title")[0], client.parseDOM(i, "div", attrs = { "class": "status status-year" }), client.parseDOM(i, "div", attrs = { "class": "mark-8" })) for i in result]
            result = [(i[0], i[1], i[2][0], i[3]) for i in result if len(i[2]) > 0]
            result = [(i[0], i[1], i[2], i[3], re.compile('Season (\d*)$').findall(i[1])) for i in result]
            result = [(i[0], i[1], i[2], i[3]) for i in result if len(i[4]) == 0]
            result = [(i[0], i[1], i[2]) for i in result if len(i[3]) == 0]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[2] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:26,代码来源:tunemovie_mv_tv.py


示例5: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = self.search_link % (urllib.quote_plus(title))
            query = urlparse.urljoin(self.base_link, query)

            result = sucuri.source(query)
            result = re.compile('showResult\((.*)\)').findall(result)[0]
            result = json.loads(result)
            result = result['feed']['entry']

            title = cleantitle.movie(title)
            years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]

            result = [i for i in result if 'movies' in [x['term'].lower() for x in i['category']]]
            result = [[x for x in i['link'] if x['rel'] == 'alternate' and x['type'] == 'text/html'][0] for i in result]
            result = [(i['href'], i['title']) for i in result]
            result = [(i[0], re.compile('(.+?) (\d{4})(.+)').findall(i[1])) for i in result]
            result = [(i[0], i[1][0][0], i[1][0][1], i[1][0][2]) for i in result if len(i[1]) > 0]
            result = [(i[0], i[1], i[2]) for i in result if not 'TS' in i[3] and not 'CAM' in i[3]]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[2] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:29,代码来源:pubfilm_mv.py


示例6: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = urlparse.urljoin(self.base_link, self.moviesearch_link + urllib.quote_plus(title))

            result = cloudflare.source(query)
            if result == None: result = client.source(self.agent_link + urllib.quote_plus(query))

            result = result.replace('> ', '>').replace(' <', '<')

            r = client.parseDOM(result, "li", attrs = { "class": "first element.+?" })
            r += client.parseDOM(result, "li", attrs = { "class": "element.+?" })

            title = cleantitle.movie(title)
            years = ['(%s)' % str(year), '(%s)' % str(int(year)+1), '(%s)' % str(int(year)-1)]
            result = [(client.parseDOM(i, "a", ret="href"), re.compile('>(.+?\(\d{4}\))<').findall(i)) for i in r]
            result = [(i[0][0], i[1][0]) for i in result if len(i[0]) > 0 and len(i[1]) > 0]
            result = [(i[0], i[1].split('>')[-1]) for i in result]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[1] for x in years)][0]

            url = client.replaceHTMLCodes(result)
            try: url = urlparse.parse_qs(urlparse.urlparse(url).query)['u'][0]
            except: pass
            url = urlparse.urlparse(url).path
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:ooXei1sh,项目名称:lambda-addons,代码行数:28,代码来源:yifystream_mv_tv.py


示例7: get_movie

    def get_movie(self, imdb, title, year):
        try:
            search = 'http://www.omdbapi.com/?i=tt%s' % imdb
            search = client.source(search)
            search = json.loads(search)
            country = [i.strip() for i in search['Country'].split(',')]
            if not 'India' in country: return

            languages = ['hindi', 'tamil', 'telugu', 'malayalam']
            language = [i.strip().lower() for i in search['Language'].split(',')]
            language = [i for i in language if any(x == i for x in languages)][0]

            query = self.search_link % (urllib.quote_plus(title), language)
            query = urlparse.urljoin(self.base_link, query)

            result = client.source(query)
            result = client.parseDOM(result, "div", attrs = { "class": "search-category" })
            result = [i for i in result if 'Movies' in client.parseDOM(i, "p")[0]][0]
            result = client.parseDOM(result, "li")

            title = cleantitle.movie(title)
            years = ['(%s)' % str(year), '(%s)' % str(int(year)+1), '(%s)' % str(int(year)-1)]
            result = [(client.parseDOM(i, "a", ret="href")[0], client.parseDOM(i, "a")[0]) for i in result]
            r = [i for i in result if any(x in i[1] for x in years)]
            if not len(r) == 0: result = r
            result = [i[0] for i in result if title == cleantitle.movie(i[1])][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = url.replace('../', '/')
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:35,代码来源:einthusan_mv.py


示例8: get_show

    def get_show(self, imdb, tvdb, show, show_alt, year):


        # import logging
        # LOG_FILENAME = '/home/keeganmccallum/test.log'
        # logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)

        # logging.debug(','.join([imdb, tvdb, show, show_alt, year]))

        try:
            result = client.source(self.base_link)
            if not "'index show'" in result:
                cookie = client.source(self.sign_link, post=self.key_link, output='cookie')
                result = client.source(self.base_link, cookie=cookie)

            result = client.parseDOM(result, "div", attrs = { "class": "index show" })
            result = [(client.parseDOM(i, "a", attrs = { "class": "name" })[0], client.parseDOM(i, "span", attrs = { "class": "value" })[0], client.parseDOM(i, "a", ret="href")[0]) for i in result]

            shows = [cleantitle.tv(show), cleantitle.tv(show_alt)]
            years = [str(year), str(int(year)+1), str(int(year)-1)]
            result = [i for i in result if any(x in i[1] for x in years)]
            result = [i[2] for i in result if any(x == cleantitle.tv(i[0]) for x in shows)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:keeganmccallum,项目名称:lambda-addons,代码行数:30,代码来源:ororo_tv.py


示例9: get_sources

    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None: return sources

            url = urlparse.urljoin(self.base_link, url)

            result = cloudflare.source(url)
            result = client.parseDOM(result, "a", ret="href")

            u = [i for i in result if '.php' in i and  'i=' in i][0]
            u = client.replaceHTMLCodes(u)
            u = urlparse.parse_qs(urlparse.urlparse(u).query)['i'][0]
 
            url = gkplugins.decrypter(198,128).decrypt(u,base64.urlsafe_b64decode('b3F5czkzZEswc2FEY3pRNW9NSTE='),'ECB').split('\0')[0]
            url = resolvers.request(url)

            if not type(url) == list: raise Exception()

            for i in url: sources.append({'source': 'GVideo', 'quality': i['quality'], 'provider': 'YIFYstream', 'url': i['url']})

            return sources
        except:
            return sources
开发者ID:Mendim,项目名称:tdbaddon,代码行数:25,代码来源:yifystream_mv_tv.py


示例10: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = self.search_link % (urllib.quote_plus(re.sub(r'[\W_]+', ' ', title)))
            query = urlparse.urljoin(self.base_link, query)

            result = cloudflare.source(query)
            result = result.replace('&#8211;','-').replace('&#8217;','\'')
            result = client.parseDOM(result, "ul", attrs = { "class": "listing-videos.+?" })[0]
            result = client.parseDOM(result, "li", attrs = { "class": ".+?" })

            title = cleantitle.movie(title)
            years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]
            result = [(client.parseDOM(i, "a", ret="href")[0], client.parseDOM(i, "a", ret="title")[0]) for i in result]
            result = [(i[0], re.sub('\s(\(|)(\d{4})(.+)', '', i[1]), re.compile('(\d{4})').findall(i[1])) for i in result]
            result = [(i[0], i[1], i[2][0]) for i in result if len(i[2]) > 0]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[2] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:marnnie,项目名称:Cable-buenaventura,代码行数:25,代码来源:onlinemovies_mv.py


示例11: resolve

    def resolve(self, url):
        try:
            url = urlparse.urlparse(url).path

            result = ""
            links = [self.link_1, self.link_2, self.link_3]
            for base_link in links:
                result = client.request(urlparse.urljoin(base_link, url), headers=self.headers)
                if "showvideo" in str(result):
                    break

            result = result.decode("iso-8859-1").encode("utf-8")

            url = client.parseDOM(result, "div", attrs={"id": "showvideo"})[0]
            url = url.replace("<IFRAME", "<iframe").replace(" SRC=", " src=")
            url = client.parseDOM(url, "iframe", ret="src")[0]
            url = client.replaceHTMLCodes(url)
            try:
                url = urlparse.parse_qs(urlparse.urlparse(url).query)["u"][0]
            except:
                pass
            try:
                url = urlparse.parse_qs(urlparse.urlparse(url).query)["url"][0]
            except:
                pass

            url = resolvers.request(url)
            return url
        except:
            return
开发者ID:marnnie,项目名称:Cable-buenaventura,代码行数:30,代码来源:movie25_mv.py


示例12: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = urlparse.urljoin(self.base_link, self.moviesearch_link + urllib.quote_plus(title))

            result = cloudflare.source(query)

            r = client.parseDOM(result, "li", attrs = { "class": "first element.+?" })
            r += client.parseDOM(result, "li", attrs = { "class": "element.+?" })
            r += client.parseDOM(result, "header", attrs = { "class": "entry-header" })

            title = cleantitle.movie(title)
            years = ['(%s)' % str(year), '(%s)' % str(int(year)+1), '(%s)' % str(int(year)-1)]

            result = [(client.parseDOM(i, "a", ret="href"), client.parseDOM(i, "a")) for i in r]
            result = [(i[0][0], i[1][0]) for i in result if len(i[0]) > 0 and len(i[1]) > 0]
            result = [(i[0], re.sub('<.+?>', '', i[1])) for i in result]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[1] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:djjohnnyb15,项目名称:BlackKodi,代码行数:26,代码来源:yifystream_mv_tv.py


示例13: get_episode

    def get_episode(self, url, imdb, tvdb, title, date, season, episode):
        try:
            if url == None: return

            query = self.tvbase_link + self.index_link
            post = urllib.urlencode({'a': 'retrieve', 'c': 'result', 'p': '{"KeyWord":"%s","Page":"1","NextToken":""}' % url})

            result = client.source(query, post=post)
            result = result.decode('iso-8859-1').encode('utf-8')
            result = client.parseDOM(result, "tr")

            show = cleantitle.tv(url)
            season = '%01d' % int(season)
            episode = '%02d' % int(episode)
            result = [client.parseDOM(i, "h1")[0] for i in result]
            result = [(client.parseDOM(i, "a", ret="href")[0], client.parseDOM(i, "a")[0]) for i in result]
            result = [(i[0], re.sub('\sSeason(|\s)\d*.+', '', i[1]), re.compile('\sSeason *(\d*) *').findall(i[1])[0]) for i in result]
            result = [i for i in result if show == cleantitle.tv(i[1])]
            result = [i[0] for i in result if season == i[2]][0]

            url = result.split('v=', 1)[-1]
            url = '%s|%s' % (url, episode)
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:27,代码来源:movietube_mv_tv.py


示例14: get_movie

    def get_movie(self, imdb, title, year):
        try:
            query = self.search_link % (urllib.quote_plus(title))
            query = urlparse.urljoin(self.base_link, query)

            result = client.source(query)
            if result == None: result = client.source(self.agent_link + urllib.quote_plus(query))

            result = result.replace('\r','').replace('\n','').replace('\t','')

            result = re.compile('(<div id="*\d*.+?</div>)').findall(result)

            title = cleantitle.movie(title)
            years = ['%s' % str(year), '%s' % str(int(year)+1), '%s' % str(int(year)-1)]

            result = [(re.compile('id="*(\d*)"*').findall(i), re.compile('<h4>(.+?)</h4>').findall(i), re.compile('Releasedatum *: *(\d{4})').findall(i)) for i in result]
            result = [(i[0][0], i[1][0], i[2][0]) for i in result if len(i[0]) > 0 and len(i[1]) > 0 and len(i[2]) > 0]
            result = [(i[0], i[1].rsplit('</span>')[0].split('>')[-1].strip(), i[2]) for i in result]
            result = [i for i in result if title == cleantitle.movie(i[1])]
            result = [i[0] for i in result if any(x in i[2] for x in years)][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:krisawatson,项目名称:plugin.video.genesis,代码行数:28,代码来源:sweflix_mv.py


示例15: get_show

    def get_show(self, imdb, tvdb, show, show_alt, year):
        try:
            query = re.sub("^THE\s+|^A\s+", "", show.strip().upper())[0]
            if not query.isalpha():
                query = "1"
            query = self.tvsearch_link % query

            result = ""
            links = [self.link_1, self.link_2, self.link_3]
            for base_link in links:
                result = client.source(urlparse.urljoin(base_link, query), headers=self.headers)
                if "Donate" in str(result):
                    break

            result = result.decode("iso-8859-1").encode("utf-8")
            result = re.compile("id=%s>.+?href=(.+?)>" % imdb).findall(result)[0]

            url = client.replaceHTMLCodes(result)
            try:
                url = urlparse.parse_qs(urlparse.urlparse(url).query)["u"][0]
            except:
                pass
            url = "%s?%s" % (urlparse.urlparse(url).path, urlparse.urlparse(url).query)
            url = url.encode("utf-8")
            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:27,代码来源:icefilms_mv_tv.py


示例16: get_episode

    def get_episode(self, url, imdb, tvdb, title, date, season, episode):
        try:
            if url == None: return

            season = '%01d' % int(season)
            episode = '%01d' % int(episode)

            query = '%s "Season %s" "Episode %s"' % (url, season, episode)
            query = urlparse.urljoin(self.base_link, self.tvsearch_link + urllib.quote_plus(query))

            result = cloudflare.source(query)

            result = client.parseDOM(result, "header", attrs = { "class": "entry-header" })

            show = cleantitle.tv(url)

            result = [(client.parseDOM(i, "a", ret="href"), client.parseDOM(i, "a")) for i in result]
            result = [(i[0][0], i[1][0]) for i in result if len(i[0]) > 0 and len(i[1]) > 0]
            result = [(i[0], re.compile('(.+?): Season (\d*).+?Episode (\d*)').findall(i[1])) for i in result]
            result = [(i[0], i[1][0][0], i[1][0][1], i[1][0][2]) for i in result if len(i[1]) > 0]
            result = [i for i in result if season == '%01d' % int(i[2]) and episode == '%01d' % int(i[3])]
            result = [i[0] for i in result if show == cleantitle.tv(i[1])][0]

            url = client.replaceHTMLCodes(result)
            try: url = urlparse.parse_qs(urlparse.urlparse(url).query)['u'][0]
            except: pass
            url = urlparse.urlparse(url).path
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:31,代码来源:yifystream_mv_tv.py


示例17: get_sources

    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None: return sources

            url = urlparse.urljoin(self.base_link, url)

            result = cloudflare.source(url)
            
            result = client.parseDOM(result, "a", ret="href")

            url = [i for i in result if '.php' in i and 'i=' in i][0]
            url = client.replaceHTMLCodes(url)
            url = urlparse.parse_qs(urlparse.urlparse(url).query)['i'][0]
            url = base64.decodestring(url)

            url = resolvers.request(url)

            if not type(url) == list: raise Exception()

            for i in url: sources.append({'source': 'GVideo', 'quality': i['quality'], 'provider': 'YIFYstream', 'url': i['url']})

            return sources
        except:
            return sources
开发者ID:MrChuco213,项目名称:team.expat,代码行数:26,代码来源:yifystream_mv_tv.py


示例18: resolve

    def resolve(self, url):
        try:
            url = url.replace('/json/', '/')
            url = urlparse.urlparse(url).path

            class NoRedirection(urllib2.HTTPErrorProcessor):
                def http_response(self, request, response):
                    return response

            result = ''
            links = [self.link_1, self.link_2, self.link_3]
            for base_link in links:
                try:
                    opener = urllib2.build_opener(NoRedirection)
                    opener.addheaders = [('User-Agent', 'Apple-iPhone')]
                    opener.addheaders = [('Referer', base_link + url)]
                    response = opener.open(base_link + url)
                    result = response.read()
                    response.close()
                except:
                    result = ''
                if 'myButton' in result: break

            url = re.compile('class=[\'|\"]*myButton.+?href=[\'|\"|\s|\<]*(.+?)[\'|\"|\s|\>]').findall(result)[0]
            url = client.replaceHTMLCodes(url)
            try: url = urlparse.parse_qs(urlparse.urlparse(url).query)['u'][0]
            except: pass
            try: url = urlparse.parse_qs(urlparse.urlparse(url).query)['url'][0]
            except: pass

            url = resolvers.request(url)
            return url
        except:
            return
开发者ID:MrChuco213,项目名称:team.expat,代码行数:34,代码来源:watchseries_tv.py


示例19: get_show

    def get_show(self, imdb, tvdb, show, show_alt, year):
        try:
            result = client.source(self.base_link)
            if not "'index show'" in result:
                cookie = client.source(self.sign_link, post=self.key_link, output="cookie")
                result = client.source(self.base_link, cookie=cookie)

            result = client.parseDOM(result, "div", attrs={"class": "index show"})
            result = [
                (
                    client.parseDOM(i, "a", attrs={"class": "name"})[0],
                    client.parseDOM(i, "span", attrs={"class": "value"})[0],
                    client.parseDOM(i, "a", ret="href")[0],
                )
                for i in result
            ]

            shows = [cleantitle.tv(show), cleantitle.tv(show_alt)]
            years = [str(year), str(int(year) + 1), str(int(year) - 1)]
            result = [i for i in result if any(x in i[1] for x in years)]
            result = [i[2] for i in result if any(x == cleantitle.tv(i[0]) for x in shows)][0]

            try:
                url = re.compile("//.+?(/.+)").findall(result)[0]
            except:
                url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode("utf-8")
            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:31,代码来源:ororo_tv.py


示例20: get_episode

    def get_episode(self, url, imdb, tvdb, title, date, season, episode):
        try:
            if url == None: return

            season = '%01d' % int(season)
            episode = '%01d' % int(episode)

            query = '%s "Season %s" "Episode %s"' % (url, season, episode)
            query = urlparse.urljoin(self.base_link, self.tvsearch_link + urllib.quote_plus(query))

            result = cloudflare.source(query)

            r = client.parseDOM(result, "li", attrs = { "class": "first element.+?" })
            r += client.parseDOM(result, "li", attrs = { "class": "element.+?" })

            show = cleantitle.tv(url)
            result = [(client.parseDOM(i, "a", ret="href"), re.compile('>(.+?): Season (\d*), Episode (\d*)<').findall(i)) for i in r]
            result = [(i[0][0], i[1][0][0], i[1][0][1], i[1][0][2]) for i in result if len(i[0]) > 0 and len(i[1]) > 0]
            result = [i for i in result if season == '%01d' % int(i[2]) and episode == '%01d' % int(i[3])]
            result = [i[0] for i in result if show == cleantitle.tv(i[1])][0]

            try: url = re.compile('//.+?(/.+)').findall(result)[0]
            except: url = result
            url = client.replaceHTMLCodes(url)
            url = url.encode('utf-8')
            return url
        except:
            return
开发者ID:Mendim,项目名称:tdbaddon,代码行数:28,代码来源:yifystream_mv_tv.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python client.request函数代码示例发布时间:2022-05-27
下一篇:
Python client.parseDOM函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap