Пример #1
0
def more_cdapl(link, hostDict, lang, info):
    sources = []
    if "cda.pl" in link:
        try:
            response = requests.get(link).content
            test = client.parseDOM(response,
                                   'div',
                                   attrs={'class': 'wrapqualitybtn'})
            urls = client.parseDOM(test, 'a', ret='href')
            for url in urls:
                valid, host = source_utils.is_host_valid(url, hostDict)
                q = source_utils.check_sd_url(url)
                direct = re.findall("""file":"(.*)","file_cast""",
                                    requests.get(url).content)[0].replace(
                                        "\\/", "/")
                sources.append({
                    'source': host,
                    'quality': q,
                    'language': lang,
                    'url': direct,
                    'info': info,
                    'direct': True,
                    'debridonly': False
                })
            return sources
        except Exception, e:
            print e
            return []
Пример #2
0
def more_rapidvideo(link, hostDict, lang, info):
    sources = []
    if "rapidvideo.com" in link:
        try:
            response = requests.get(link).content
            test = re.findall("""(https:\/\/www.rapidvideo.com\/e\/.*)">""",
                              response)
            numGroups = len(test)
            for i in range(1, numGroups):
                url = test[i]
                valid, host = source_utils.is_host_valid(url, hostDict)
                q = source_utils.check_sd_url(url)
                sources.append({
                    'source': host,
                    'quality': q,
                    'language': lang,
                    'url': url,
                    'info': info,
                    'direct': False,
                    'debridonly': False
                })
            return sources
        except Exception, e:
            print e
            return []
Пример #3
0
    def sources(self, url, hostDict, hostprDict):

        sources = []
        try:

            if url == None: return sources
            result = client.request(urlparse.urljoin(self.base_link, url),
                                    redirect=False)

            section = client.parseDOM(result,
                                      'section',
                                      attrs={'id': 'video_player'})[0]
            link = client.parseDOM(section, 'iframe', ret='src')[0]
            valid, host = source_utils.is_host_valid(link, hostDict)
            if not valid: return sources
            spans = client.parseDOM(section, 'span')
            info = None
            for span in spans:
                if span == 'Z lektorem':
                    info = 'Lektor'

            q = source_utils.check_sd_url(link)
            sources.append({
                'source': host,
                'quality': q,
                'language': 'pl',
                'url': link,
                'info': info,
                'direct': False,
                'debridonly': False
            })

            return sources
        except:
            return sources
Пример #4
0
    def sources(self, url, hostDict, hostprDict):

        sources = []
        try:
            #import pydevd
            #pydevd.settrace(stdoutToServer=True, stderrToServer=True)
            if url == None: return sources
            r = client.request(urlparse.urljoin(self.base_link, url),
                               redirect=False)
            info = self.get_lang_by_type(client.parseDOM(r, 'title')[0])
            r = client.parseDOM(r, 'div', attrs={'class':
                                                 'tab-pane active'})[0]
            r = client.parseDOM(r, 'script')[0]
            script = r.split('"')[1]
            decoded = self.shwp(script)

            link = client.parseDOM(decoded, 'iframe', ret='src')[0]
            valid, host = source_utils.is_host_valid(link, hostDict)
            if not valid: return sources
            q = source_utils.check_sd_url(link)
            sources.append({
                'source': host,
                'quality': q,
                'language': 'pl',
                'url': link,
                'info': info,
                'direct': False,
                'debridonly': False
            })

            return sources
        except:
            return sources
Пример #5
0
 def work(self, link):
     if str(link).startswith("http://"):
         link = self.getlink(link)
         q = source_utils.check_sd_url(link)
         valid, host = source_utils.is_host_valid(link, testDict)
         if not valid: return 0
         return host, q, link
Пример #6
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

            cookies = cache.cache_get('naszekino_cookie')
            result = client.request(url, cookie=cookies)

            result = client.parseDOM(result,
                                     'table',
                                     attrs={'class': 'table table-bordered'})
            result = client.parseDOM(result, 'tr')
            for item in result:
                try:
                    link = client.parseDOM(item,
                                           'td',
                                           attrs={'class': 'link-to-video'})
                    link = str(client.parseDOM(link, 'a', ret='href')[0])
                    temp = client.parseDOM(item, 'td')
                    wersja = str(temp[1])
                    lang, info = self.get_lang_by_type(wersja)
                    valid, host = source_utils.is_host_valid(link, hostDict)
                    jakosc = str(temp[2]).lower()
                    if "wysoka" in jakosc:
                        q = "HD"
                    else:
                        q = source_utils.check_sd_url(link)
                    sources.append({
                        'source': host,
                        'quality': q,
                        'language': lang,
                        'url': link,
                        'info': info,
                        'direct': False,
                        'debridonly': False
                    })
                except:
                    continue
            return sources
        except:
            return sources
Пример #7
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

            data = urlparse.parse_qs(url)
            data = dict([(i, data[i][0]) if data[i] else (i, '')
                         for i in data])
            title = data['tvshowtitle'] if 'tvshowtitle' in data else data[
                'title']
            imdb = data['imdb']
            aliases = eval(data['aliases'])
            headers = {}

            if 'tvshowtitle' in data:
                url = self.searchShow(title, int(data['season']),
                                      int(data['episode']), aliases, headers)
            else:
                url = self.searchMovie(title, data['year'], aliases, headers)

            r = client.request(url,
                               headers=headers,
                               output='extended',
                               timeout='10')

            if not imdb in r[0]: raise Exception()

            cookie = r[4]
            headers = r[3]
            result = r[0]

            try:
                r = re.findall('(https:.*?redirector.*?)[\'\"]', result)
                for i in r:
                    try:
                        sources.append({
                            'source':
                            'gvideo',
                            'quality':
                            directstream.googletag(i)[0]['quality'],
                            'language':
                            'en',
                            'url':
                            i,
                            'direct':
                            True,
                            'debridonly':
                            False
                        })
                    except:
                        pass
            except:
                pass

            try:
                auth = re.findall('__utmx=(.+)', cookie)[0].split(';')[0]
            except:
                auth = 'false'
            auth = 'Bearer %s' % urllib.unquote_plus(auth)
            headers['Authorization'] = auth
            headers['Referer'] = url

            u = '/ajax/vsozrflxcw.php'
            self.base_link = client.request(self.base_link,
                                            headers=headers,
                                            output='geturl')
            u = urlparse.urljoin(self.base_link, u)

            action = 'getEpisodeEmb' if '/episode/' in url else 'getMovieEmb'

            elid = urllib.quote(
                base64.encodestring(str(int(time.time()))).strip())

            token = re.findall("var\s+tok\s*=\s*'([^']+)", result)[0]

            idEl = re.findall('elid\s*=\s*"([^"]+)', result)[0]

            post = {
                'action': action,
                'idEl': idEl,
                'token': token,
                'nopop': '',
                'elid': elid
            }
            post = urllib.urlencode(post)
            cookie += ';%s=%s' % (idEl, elid)
            headers['Cookie'] = cookie

            r = client.request(u,
                               post=post,
                               headers=headers,
                               cookie=cookie,
                               XHR=True)
            r = str(json.loads(r))

            r = re.findall('\'(http.+?)\'', r) + re.findall('\"(http.+?)\"', r)

            for i in r:
                try:
                    if 'google' in i:
                        quality = 'SD'

                        if 'googleapis' in i:
                            try:
                                quality = source_utils.check_sd_url(i)
                            except Exception:
                                pass

                        if 'googleusercontent' in i:
                            i = directstream.googleproxy(i)
                            try:
                                quality = directstream.googletag(
                                    i)[0]['quality']
                            except Exception:
                                pass

                        sources.append({
                            'source': 'gvideo',
                            'quality': quality,
                            'language': 'en',
                            'url': i,
                            'direct': True,
                            'debridonly': False
                        })

                    elif 'llnwi.net' in i or 'vidcdn.pro' in i:
                        try:
                            quality = source_utils.check_sd_url(i)

                            sources.append({
                                'source': 'CDN',
                                'quality': quality,
                                'language': 'en',
                                'url': i,
                                'direct': True,
                                'debridonly': False
                            })

                        except Exception:
                            pass

                    else:
                        valid, hoster = source_utils.is_host_valid(i, hostDict)

                        sources.append({
                            'source': hoster,
                            'quality': '720p',
                            'language': 'en',
                            'url': i,
                            'direct': False,
                            'debridonly': False
                        })

                except:
                    pass

            return sources
        except:
            return sources
Пример #8
0
    def sources(self, url, hostDict, hostprDict):

        sources = []
        try:
            if url == None: return sources
            typ = url[4]
            headers = {
                "User-Agent":
                "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0",
                "http.content_type":
                "application/x-www-form-urlencoded; charset=UTF-8"
            }
            data = ''
            if typ == "SERIAL":
                title = url[0]
                id = url[1]
                year = url[2]
                orgtitle = url[3]
                sezon = url[5]
                epizod = url[6]
                if orgtitle != "0":
                    data = {
                        "id": int(id),
                        "type": typ,
                        "title": title,
                        "year": int(year),
                        "sezon": str(sezon),
                        "odcinek": str(epizod),
                        "site": "filmdb",
                        "browser": "chrome"
                    }
                else:
                    data = {
                        "id": int(id),
                        "type": typ,
                        "title": title,
                        "originalTitle": str(orgtitle),
                        "year": int(year),
                        "sezon": str(sezon),
                        "odcinek": str(epizod),
                        "site": "filmdb",
                        "browser": "chrome"
                    }
            if typ == "FILM":
                title = url[0]
                id = url[1]
                year = url[2]
                orgtitle = url[3]
                if orgtitle != "0":
                    data = {
                        "id": int(id),
                        "type": typ,
                        "title": str(title),
                        "originalTitle": str(orgtitle),
                        "year": int(year),
                        "site": "filmdb",
                        "browser": "chrome"
                    }
                else:
                    data = {
                        "id": int(id),
                        "type": typ,
                        "title": str(title),
                        "year": int(year),
                        "site": "filmdb",
                        "browser": "chrome"
                    }
            data = {"json": json.dumps(data, ensure_ascii=False)}
            response = requests.post("http://fboost.pl/api/api.php",
                                     data=data,
                                     headers=headers)
            content = json.loads(response.content)
            for code in zip(content[u'link'], content[u'wersja']):
                wersja = str(code[1])
                lang, info = self.get_lang_by_type(wersja)
                test = requests.post("http://fboost.pl/api/player.php?src=%s" %
                                     code[0]).content
                link = re.search("""iframe src="(.*)" style""", test)
                link = link.group(1)
                if len(link) < 2:
                    continue
                if "cda.pl" in link:
                    try:
                        response = requests.get(link).content
                        test = client.parseDOM(
                            response, 'div', attrs={'class': 'wrapqualitybtn'})
                        urls = client.parseDOM(test, 'a', ret='href')
                        for url in urls:
                            valid, host = source_utils.is_host_valid(
                                url, hostDict)
                            q = source_utils.check_sd_url(url)
                            sources.append({
                                'source': host,
                                'quality': q,
                                'language': lang,
                                'url': url,
                                'info': info,
                                'direct': False,
                                'debridonly': False
                            })
                        continue
                    except:
                        pass
                if "rapidvideo.com" in link:
                    try:
                        response = requests.get(link).content
                        test = re.findall(
                            """(https:\/\/www.rapidvideo.com\/e\/.*)">""",
                            response)
                        numGroups = len(test)
                        for i in range(1, numGroups):
                            url = test[i]
                            valid, host = source_utils.is_host_valid(
                                url, hostDict)
                            q = source_utils.check_sd_url(url)
                            sources.append({
                                'source': host,
                                'quality': q,
                                'language': lang,
                                'url': url,
                                'info': info,
                                'direct': False,
                                'debridonly': False
                            })
                        continue
                    except Exception, e:
                        print e
                        pass
                valid, host = source_utils.is_host_valid(link, hostDict)
                q = source_utils.check_sd_url(link)
                sources.append({
                    'source': host,
                    'quality': q,
                    'language': lang,
                    'url': link,
                    'info': info,
                    'direct': False,
                    'debridonly': False
                })
            return sources