Beispiel #1
0
    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
Beispiel #2
0
    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None: return sources

            url = urlparse.urljoin(self.base_link, url)
            result = sucuri.source(url)

            url = client.parseDOM(result, "iframe", ret="src", attrs = { "allowfullscreen": ".+?" })
            url += client.parseDOM(result, "a", ret="href", attrs = { "target": "EZWebPlayer" })

            links = [x for y,x in enumerate(url) if x not in url[:y]]
            links = [client.replaceHTMLCodes(i) for i in links][:3]

            for u in links:
                try:
                    result = sucuri.source(u)

                    try: sources.append({'source': 'GVideo', 'quality': '1080p', 'provider': 'Pubfilm', 'url': re.compile('file *: *"(.+?)"').findall([i for i in re.compile('({.+?})').findall(result) if '"1080p"' in i][0])[0]})
                    except: pass

                    try: sources.append({'source': 'GVideo', 'quality': 'HD', 'provider': 'Pubfilm', 'url': re.compile('file *: *"(.+?)"').findall([i for i in re.compile('({.+?})').findall(result) if '"720p"' in i][0])[0]})
                    except: pass

                    try: sources.append({'source': 'GVideo', 'quality': '1080p', 'provider': 'Pubfilm', 'url': client.parseDOM(result, "source", ret="src", attrs = { "data-res": "1080P" })[0]})
                    except: pass

                    try: sources.append({'source': 'GVideo', 'quality': 'HD', 'provider': 'Pubfilm', 'url': client.parseDOM(result, "source", ret="src", attrs = { "data-res": "720P" })[0]})
                    except: pass
                except:
                    pass

            return sources
        except:
            return sources
Beispiel #3
0
    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
Beispiel #4
0
    def get_sources(self, url, hosthdDict, hostDict, locDict):
        try:
            sources = []

            if url == None: return sources

            url = urlparse.urljoin(self.base_link, url)
            result = sucuri.source(url)

            url = client.parseDOM(result,
                                  "iframe",
                                  ret="src",
                                  attrs={"allowfullscreen": ".+?"})
            url += client.parseDOM(result,
                                   "a",
                                   ret="href",
                                   attrs={"target": "EZWebPlayer"})

            links = [x for y, x in enumerate(url) if x not in url[:y]]
            links = [client.replaceHTMLCodes(i) for i in links][:3]

            for u in links:
                try:
                    result = sucuri.source(u)

                    try:
                        sources.append({
                            'source':
                            'GVideo',
                            'quality':
                            '1080p',
                            'provider':
                            'Pubfilm',
                            'url':
                            re.compile('file *: *"(.+?)"').findall([
                                i
                                for i in re.compile('({.+?})').findall(result)
                                if '"1080p"' in i
                            ][0])[0]
                        })
                    except:
                        pass

                    try:
                        sources.append({
                            'source':
                            'GVideo',
                            'quality':
                            'HD',
                            'provider':
                            'Pubfilm',
                            'url':
                            re.compile('file *: *"(.+?)"').findall([
                                i
                                for i in re.compile('({.+?})').findall(result)
                                if '"720p"' in i
                            ][0])[0]
                        })
                    except:
                        pass

                    try:
                        sources.append({
                            'source':
                            'GVideo',
                            'quality':
                            '1080p',
                            'provider':
                            'Pubfilm',
                            'url':
                            client.parseDOM(result,
                                            "source",
                                            ret="src",
                                            attrs={"data-res": "1080P"})[0]
                        })
                    except:
                        pass

                    try:
                        sources.append({
                            'source':
                            'GVideo',
                            'quality':
                            'HD',
                            'provider':
                            'Pubfilm',
                            'url':
                            client.parseDOM(result,
                                            "source",
                                            ret="src",
                                            attrs={"data-res": "720P"})[0]
                        })
                    except:
                        pass
                except:
                    pass

            return sources
        except:
            return sources