Example #1
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

            r = client.request(urlparse.urljoin(self.base_link, url))
            r = dom_parser.parse_dom(r, 'article')
            r = dom_parser.parse_dom(r, 'div', attrs={'class': 'entry-content'})

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''', ''.join([i.content for i in r]))
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'iframe', req='src')]
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'source', req='src')]

            for i in links:
                try:
                    valid, hoster = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    urls = []
                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                    if 'google' in i and not urls and directstream.googletag(i): host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                    elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else: host = hoster; direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'ko', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #2
0
def check_directstreams(url, hoster="", quality="SD"):
    urls = []
    host = hoster

    if "google" in url or any(x in url for x in ["youtube.", "docid="]):
        urls = directstream.google(url)
        if not urls:
            tag = directstream.googletag(url)
            if tag:
                urls = [{"quality": tag[0]["quality"], "url": url}]
        if urls:
            host = "gvideo"
    elif "ok.ru" in url:
        urls = directstream.odnoklassniki(url)
        if urls:
            host = "vk"
    elif "vk.com" in url:
        urls = directstream.vk(url)
        if urls:
            host = "vk"
    elif any(x in url for x in ["akamaized", "blogspot", "ocloud.stream"]):
        urls = [{"url": url}]
        if urls:
            host = "CDN"

    direct = True if urls else False

    if not urls:
        urls = [{"quality": quality, "url": url}]

    return urls, host, direct
Example #3
0
def check_directstreams(url, hoster='', quality='SD'):
    urls = []
    host = hoster

    if 'google' in url or any(x in url for x in ['youtube.', 'docid=']):
        urls = directstream.google(url)
        if not urls:
            tag = directstream.googletag(url)
            if tag: urls = [{'quality': tag[0]['quality'], 'url': url}]
        if urls: host = 'gvideo'
    elif 'ok.ru' in url:
        urls = directstream.odnoklassniki(url)
        if urls: host = 'vk'
    elif 'vk.com' in url:
        urls = directstream.vk(url)
        if urls: host = 'vk'
    elif any(x in url for x in ['akamaized', 'blogspot', 'ocloud.stream']):
        urls = [{'url': url}]
        if urls: host = 'CDN'
        
    direct = True if urls else False

    if not urls: urls = [{'quality': quality, 'url': url}]

    return urls, host, direct
Example #4
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

            links = self.links_found(url)

            hostdict = hostDict + hostprDict
            for url in links:
                try:
                    valid, host = source_utils.is_host_valid(url, hostdict)
                    if 'mehliz' in url:
                        host = 'MZ'; direct = True; urls = (self.mz_server(url))

                    elif 'ok.ru' in url:
                        host = 'vk'; direct = True; urls = (directstream.odnoklassniki(url))

                    else:
                        direct = False; urls = [{'quality': 'SD', 'url': url}]

                    for x in urls:
                        sources.append({'source': host, 'quality': x['quality'], 'language': 'en',
                                        'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
def check_directstreams(url, hoster='', quality='SD'):
    urls = []
    host = hoster

    if 'google' in url or any(x in url for x in ['youtube.', 'docid=']):
        urls = directstream.google(url)
        if not urls:
            tag = directstream.googletag(url)
            if tag: urls = [{'quality': tag[0]['quality'], 'url': url}]
        if urls: host = 'gvideo'
    elif 'ok.ru' in url:
        urls = directstream.odnoklassniki(url)
        if urls: host = 'vk'
    elif 'vk.com' in url:
        urls = directstream.vk(url)
        if urls: host = 'vk'
    elif any(x in url for x in ['akamaized', 'blogspot', 'ocloud.stream']):
        urls = [{'url': url}]
        if urls: host = 'CDN'

    direct = True if urls else False

    if not urls: urls = [{'quality': quality, 'url': url}]

    return urls, host, direct
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

            r = client.request(urlparse.urljoin(self.base_link, url))
            r = dom_parser.parse_dom(r, 'article')
            r = dom_parser.parse_dom(r, 'div', attrs={'class': 'entry-content'})

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''', ''.join([i.content for i in r]))
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'iframe', req='src')]
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'source', req='src')]

            for i in links:
                try:
                    valid, hoster = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    urls = []
                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                    if 'google' in i and not urls and directstream.googletag(i): host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                    elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else: host = hoster; direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'ko', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #7
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

            links = self.links_found(url)

            hostdict = hostDict + hostprDict
            for url in links:
                try:
                    valid, host = source_utils.is_host_valid(url, hostdict)
                    if 'mehliz' in url:
                        host = 'MZ'; direct = True; urls = (self.mz_server(url))

                    elif 'ok.ru' in url:
                        host = 'vk'; direct = True; urls = (directstream.odnoklassniki(url))

                    else:
                        direct = False; urls = [{'quality': 'SD', 'url': url}]

                    for x in urls:
                        sources.append({'source': host, 'quality': x['quality'], 'language': 'en',
                                        'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #8
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []
            if url == None: return sources

            r = client.request(url)
            if '<meta name="application-name" content="Unblocked">' in r: return sources
            r = client.parseDOM(r, 'div',attrs={'class':'entry-content'})[0]
            frames = []
            frames += client.parseDOM(r, 'iframe', ret='src')
            frames += client.parseDOM(r, 'a', ret='href')
            frames += client.parseDOM(r, 'source', ret='src')
            
            try:
                q = re.findall('<strong>Quality:</strong>([^<]+)', r)[0]
                if 'high' in q.lower(): quality = '720p'
                elif 'cam' in q.lower(): quality = 'CAM'
                else: quality = 'SD'
            except: quality = 'SD'
            
            for i in frames:
                try:
                    if 'facebook' in i or 'plus.google' in i: continue
                    url = i
                    if 'https://openload.co' in url and url.lower().endswith(('embed/%s')):
                        sources.append({'source': 'CDN', 'quality': quality, 'language': 'en', 'url': url,
                                    'info': '', 'direct': False, 'debridonly': False})

                    elif 'ok.ru' in url:
                        print url
                        host = 'vk'
                        url = directstream.odnoklassniki(url)
                        print url
                        sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': False})

                    elif 'vk.com' in url:
                        host = 'vk'
                        url = directstream.vk(url)
                        sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': False})

                    else:
                        valid, host = source_utils.is_host_valid(url, hostDict)
                        if valid:
                            sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': False})
                        else:
                            valid, host = source_utils.is_host_valid(url, hostprDict)
                            if not valid: continue
                            sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': True})
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []
            if url == None: return sources

            r = client.request(url)
            if '<meta name="application-name" content="Unblocked">' in r: return sources
            r = client.parseDOM(r, 'div',attrs={'class':'entry-content'})[0]
            frames = []
            frames += client.parseDOM(r, 'iframe', ret='src')
            frames += client.parseDOM(r, 'a', ret='href')
            frames += client.parseDOM(r, 'source', ret='src')
            
            try:
                q = re.findall('<strong>Quality:</strong>([^<]+)', r)[0]
                if 'high' in q.lower(): quality = '720p'
                elif 'cam' in q.lower(): quality = 'CAM'
                else: quality = 'SD'
            except: quality = 'SD'
            
            for i in frames:
                try:
                    if 'facebook' in i or 'plus.google' in i: continue
                    url = i
                    if 'http://24hd.org' in url and url.lower().endswith(('.mp4','ts')):
                        sources.append({'source': 'CDN', 'quality': quality, 'language': 'en', 'url': url,
                                    'info': '', 'direct': True, 'debridonly': False})

                    elif 'ok.ru' in url:
                        print url
                        host = 'vk'
                        url = directstream.odnoklassniki(url)
                        print url
                        sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': True})

                    elif 'vk.com' in url:
                        host = 'vk'
                        url = directstream.vk(url)
                        sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': True})

                    else:
                        valid, host = source_utils.is_host_valid(url, hostDict)
                        if valid:
                            sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': False})
                        else:
                            valid, host = source_utils.is_host_valid(url, hostprDict)
                            if not valid: continue
                            sources.append({'source': host, 'quality': quality, 'language': 'en', 'url': url,
                                        'info': '', 'direct': False, 'debridonly': True})
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'li')
            result = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a')) for i in result]
            result = [i[0] for i in result if len(i[0]) > 0 and path in i[0][0] and len(i[1]) > 0 and 'Altyaz' in i[1][0]][0][0]

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

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'div', attrs = {'class': 'video-player'})[0]
            result = client.parseDOM(result, 'iframe', ret='src')[-1]

            try:
                url = base64.b64decode(urlparse.parse_qs(urlparse.urlparse(result).query)['id'][0])
                if not url.startswith('http'): raise Exception()
            except:
                url = client.request(result)
                url = urllib.unquote_plus(url.decode('string-escape'))
                frame = client.parseDOM(url, 'iframe', ret='src')
                if not frame[-1].startswith('http'):
                    frame = 'http:'+frame[-1]
                else:
                    frame = frame[-1]
                if len(frame) > 0:
                    url = [client.request(frame, output='geturl')]
                else:
                    url = re.compile('"(.+?)"').findall(url)
                url = [i for i in url if 'ok.ru' in i or 'vk.com' in i or 'openload.io' in i or 'openload.co' in i or 'oload.tv' in i][0]
                url = url.replace('openload.io', 'openload.co').replace('oload.tv', 'openload.co')

            try:
                url = 'http://ok.ru/video/%s' % urlparse.parse_qs(urlparse.urlparse(url).query)['mid'][0]
            except:
                pass

            if 'openload.co' in url: host = 'openload.co' ; direct = False ; url = [{'url': url, 'quality': 'HD'}]
            elif 'ok.ru' in url: host = 'vk' ; direct = True ; url = directstream.odnoklassniki(url)
            elif 'vk.com' in url: host = 'vk' ; direct = True ; url = directstream.vk(url)
            else: raise Exception()

            for i in url:
                sources.append({'source': host, 'quality': i['quality'], 'language': 'en', 'url': i['url'], 'direct': direct, 'debridonly': False})

            return sources
        except:
            return sources
Example #11
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'li')
            result = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a')) for i in result]
            result = [i[0] for i in result if len(i[0]) > 0 and path in i[0][0] and len(i[1]) > 0 and 'Altyaz' in i[1][0]][0][0]

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

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'div', attrs = {'class': 'video-player'})[0]
            result = client.parseDOM(result, 'iframe', ret='wpfc-data-original-src')[-1]

            try:
                url = base64.b64decode(urlparse.parse_qs(urlparse.urlparse(result).query)['id'][0])
                if not url.startswith('http'): raise Exception()
            except:
                url = client.request(result)
                url = urllib.unquote_plus(url.decode('string-escape'))
                frame = client.parseDOM(url, 'iframe', ret='src')
                if not frame[-1].startswith('http'):
                    frame = 'http:'+frame[-1]
                else:
                    frame = frame[-1]
                if len(frame) > 0:
                    url = [client.request(frame, output='geturl')]
                else:
                    url = re.compile('"(.+?)"').findall(url)
                url = [i for i in url if 'ok.ru' in i or 'vk.com' in i or 'openload.io' in i or 'openload.co' in i or 'oload.tv' in i][0]
                url = url.replace('openload.io', 'openload.co').replace('oload.tv', 'openload.co')

            try:
                url = 'http://ok.ru/video/%s' % urlparse.parse_qs(urlparse.urlparse(url).query)['mid'][0]
            except:
                pass

            if 'openload.co' in url: host = 'openload.co' ; direct = False ; url = [{'url': url, 'quality': 'HD'}]
            elif 'ok.ru' in url: host = 'vk' ; direct = True ; url = directstream.odnoklassniki(url)
            elif 'vk.com' in url: host = 'vk' ; direct = True ; url = directstream.vk(url)
            else: raise Exception()

            for i in url:
                sources.append({'source': host, 'quality': i['quality'], 'language': 'en', 'url': i['url'], 'direct': direct, 'debridonly': False})

            return sources
        except:
            return sources
Example #12
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            r = dom_parser.parse_dom(r, 'div', attrs={'id': 'mediaplayer'})
            r = [i.attrs['src'] for i in dom_parser.parse_dom(r, 'iframe', req='src')]

            for i in r:
                try:
                    if 'vidnow.' in i:
                        i = client.request(i, referer=url)

                        gdata = [(match[1], match[0]) for match in re.findall('''["']?label\s*["']?\s*[:=]\s*["']?([^"',]+)["']?(?:[^}\]]+)["']?\s*file\s*["']?\s*[:=,]?\s*["']([^"']+)''', i, re.DOTALL)]
                        gdata += [(match[0], match[1]) for match in re.findall('''["']?\s*file\s*["']?\s*[:=,]?\s*["']([^"']+)(?:[^}>\]]+)["']?\s*label\s*["']?\s*[:=]\s*["']?([^"',]+)''', i, re.DOTALL)]
                        gdata = [(x[0].replace('\/', '/'), source_utils.label_to_quality(x[1])) for x in gdata]

                        for u, q in gdata:
                            try:
                                tag = directstream.googletag(u)

                                if tag:
                                    sources.append({'source': 'gvideo', 'quality': tag[0].get('quality', 'SD'), 'language': 'de', 'url': u, 'direct': True, 'debridonly': False})
                                else:
                                    sources.append({'source': 'CDN', 'quality': q, 'language': 'de', 'url': u, 'direct': True,'debridonly': False})
                            except:
                                pass

                        i = dom_parser.parse_dom(i, 'div', attrs={'id': 'myElement'})
                        i = dom_parser.parse_dom(i, 'iframe', req='src')[0].attrs['src']

                    valid, host = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    urls = []
                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                    if 'google' in i and not urls and directstream.googletag(i): host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                    elif 'ok.ru' in i:  host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else:  direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'ko', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            r = dom_parser.parse_dom(r, 'div', attrs={'id': 'mediaplayer'})
            r = [i.attrs['src'] for i in dom_parser.parse_dom(r, 'iframe', req='src')]

            for i in r:
                try:
                    if 'vidnow.' in i:
                        i = client.request(i, referer=url)

                        gdata = [(match[1], match[0]) for match in re.findall('''["']?label\s*["']?\s*[:=]\s*["']?([^"',]+)["']?(?:[^}\]]+)["']?\s*file\s*["']?\s*[:=,]?\s*["']([^"']+)''', i, re.DOTALL)]
                        gdata += [(match[0], match[1]) for match in re.findall('''["']?\s*file\s*["']?\s*[:=,]?\s*["']([^"']+)(?:[^}>\]]+)["']?\s*label\s*["']?\s*[:=]\s*["']?([^"',]+)''', i, re.DOTALL)]
                        gdata = [(x[0].replace('\/', '/'), source_utils.label_to_quality(x[1])) for x in gdata]

                        for u, q in gdata:
                            try:
                                tag = directstream.googletag(u)

                                if tag:
                                    sources.append({'source': 'gvideo', 'quality': tag[0].get('quality', 'SD'), 'language': 'de', 'url': u, 'direct': True, 'debridonly': False})
                                else:
                                    sources.append({'source': 'CDN', 'quality': q, 'language': 'de', 'url': u, 'direct': True,'debridonly': False})
                            except:
                                pass

                        i = dom_parser.parse_dom(i, 'div', attrs={'id': 'myElement'})
                        i = dom_parser.parse_dom(i, 'iframe', req='src')[0].attrs['src']

                    valid, host = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    urls = []
                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                    if 'google' in i and not urls and directstream.googletag(i): host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                    elif 'ok.ru' in i:  host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else:  direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'ko', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.request(base_url)
            id = re.compile('var\s*view_id\s*=\s*"(\d*)"').findall(result)[0]


            for dil in ['tr', 'or', 'en']:
                query = self.player_link % (id, dil)

                result = client.request(query, referer=base_url)

                try:
                    url = client.parseDOM(result, 'iframe', ret='src')[-1]

                    if 'openload' in url:
                        host = 'openload.co' ; direct = False ; url = [{'url': url, 'quality': 'HD'}]

                    elif 'ok.ru' in url:
                        host = 'vk' ; direct = True ; url = directstream.odnoklassniki(url)

                    elif 'vk.com' in url:
                        host = 'vk' ; direct = True ; url = directstream.vk(url)

                    else: raise Exception()

                    for i in url: sources.append({'source': host, 'quality': i['quality'], 'language': 'en', 'url': i['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

                try:
                    url = re.compile('"?file"?\s*:\s*"([^"]+)"\s*,\s*"?label"?\s*:\s*"(\d+)p?"').findall(result)

                    links = [(i[0], '1080p') for i in url if int(i[1]) >= 1080]
                    links += [(i[0], 'HD') for i in url if 720 <= int(i[1]) < 1080]
                    links += [(i[0], 'SD') for i in url if 480 <= int(i[1]) < 720]

                    for i in links: sources.append({'source': 'gvideo', 'quality': i[1], 'language': 'en', 'url': i[0], 'direct': True, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #15
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.request(base_url)
            id = re.compile('var\s*view_id\s*=\s*"(\d*)"').findall(result)[0]


            for dil in ['tr', 'or', 'en']:
                query = self.player_link % (id, dil)

                result = client.request(query, referer=base_url)

                try:
                    url = client.parseDOM(result, 'iframe', ret='src')[-1]

                    if 'openload' in url:
                        host = 'openload.co' ; direct = False ; url = [{'url': url, 'quality': 'HD'}]

                    elif 'ok.ru' in url:
                        host = 'vk' ; direct = True ; url = directstream.odnoklassniki(url)

                    elif 'vk.com' in url:
                        host = 'vk' ; direct = True ; url = directstream.vk(url)

                    else: raise Exception()

                    for i in url: sources.append({'source': host, 'quality': i['quality'], 'language': 'en', 'url': i['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

                try:
                    url = re.compile('"?file"?\s*:\s*"([^"]+)"\s*,\s*"?label"?\s*:\s*"(\d+)p?"').findall(result)

                    links = [(i[0], '1080p') for i in url if int(i[1]) >= 1080]
                    links += [(i[0], 'HD') for i in url if 720 <= int(i[1]) < 1080]
                    links += [(i[0], 'SD') for i in url if 480 <= int(i[1]) < 720]

                    for i in links: sources.append({'source': 'gvideo', 'quality': i[1], 'language': 'en', 'url': i[0], 'direct': True, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #16
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(ref)

            p = re.findall('load_player\((\d+)\)', r)
            r = client.request(urlparse.urljoin(self.base_link, self.player_link), post={'id': p[0]}, referer=ref, XHR=True)
            url = json.loads(r).get('value')
            link = client.request(url, XHR=True, output='geturl', referer=ref)

            if '1movies.' in link:
                r = client.request(link, XHR=True, referer=ref)
                r = [(match[1], match[0]) for match in re.findall('''['"]?file['"]?\s*:\s*['"]([^'"]+)['"][^}]*['"]?label['"]?\s*:\s*['"]([^'"]*)''', r, re.DOTALL)]
                r = [(re.sub('[^\d]+', '', x[0]), x[1].replace('\/', '/')) for x in r]
                r = [x for x in r if x[0]]

                links = [(x[1], '4K') for x in r if int(x[0]) >= 2160]
                links += [(x[1], '1440p') for x in r if int(x[0]) >= 1440]
                links += [(x[1], '1080p') for x in r if int(x[0]) >= 1080]
                links += [(x[1], 'HD') for x in r if 720 <= int(x[0]) < 1080]
                links += [(x[1], 'SD') for x in r if int(x[0]) < 720]

                for url, quality in links:
                    sources.append({'source': 'gvideo', 'quality': quality, 'language': 'en', 'url': url, 'direct': True, 'debridonly': False})
            else:
                valid, host = source_utils.is_host_valid(link, hostDict)
                if not valid: return

                urls = []
                if 'google' in link: host = 'gvideo'; direct = True; urls = directstream.google(link);
                if 'google' in link and not urls and directstream.googletag(link): host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(link)[0]['quality'], 'url': link}]
                elif 'ok.ru' in link: host = 'vk'; direct = True; urls = directstream.odnoklassniki(link)
                elif 'vk.com' in link:  host = 'vk'; direct = True; urls = directstream.vk(link)
                else:  direct = False; urls = [{'quality': 'HD', 'url': link}]

                for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'en', 'url': x['url'], 'direct': direct, 'debridonly': False})

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = cloudflare.source(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'li')
            result = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a')) for i in result]
            result = [i[0] for i in result if len(i[0]) > 0 and path in i[0][0] and len(i[1]) > 0 and 'Altyaz' in i[1][0]][0][0]

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

            result = cloudflare.source(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'div', attrs = {'class': 'video-player'})[0]
            result = client.parseDOM(result, 'iframe', ret='src')[-1]

            try:
                url = base64.b64decode(urlparse.parse_qs(urlparse.urlparse(result).query)['id'][0])
                if not url.startswith('http'): raise Exception()
            except:
                url = cloudflare.source(result)
                url = urllib.unquote_plus(url.decode('string-escape'))
                url = re.compile('"(.+?)"').findall(url)
                url = [i for i in url if 'ok.ru' in i or 'vk.com' in i][0]

            try: url = 'http://ok.ru/video/%s' % urlparse.parse_qs(urlparse.urlparse(url).query)['mid'][0]
            except: pass

            if 'ok.ru' in url: host = 'vk' ; url = directstream.odnoklassniki(url)
            elif 'vk.com' in url: host = 'vk' ; url = directstream.vk(url)
            else: raise Exception()

            for i in url: sources.append({'source': host, 'quality': i['quality'], 'provider': 'Onlinedizi', 'url': i['url'], 'direct': True, 'debridonly': False})

            return sources
        except:
            return sources
Example #18
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = [(dom_parser.parse_dom(i, 'a', attrs={'class': 'options'}, req='href'), dom_parser.parse_dom(i, 'img', req='src')) for i in rels]
            rels = [(i[0][0].attrs['href'][1:], re.findall('\/flags\/(\w+)\.png$', i[1][0].attrs['src'])) for i in rels if i[0] and i[1]]
            rels = [i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de']

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]
            r = [(re.findall('link"?\s*:\s*"(.+?)"', ''.join([x.content for x in i])), dom_parser.parse_dom(i, 'iframe', attrs={'class': 'metaframe'}, req='src')) for i in r]
            r = [i[0][0] if i[0] else i[1][0].attrs['src'] for i in r if i[0] or i[1]]

            for i in r:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)
                    if not i.startswith('http'): i = self.__decode_hash(i)

                    valid, host = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i)
                    elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else: direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'de', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.source(url, close=False)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'li')
            result = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a')) for i in result]
            result = [i[0] for i in result if len(i[0]) > 0 and path in i[0][0] and len(i[1]) > 0 and 'Altyaz' in i[1][0]][0][0]

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

            result = client.source(url, close=False)
            result = re.sub(r'[^\x00-\x7F]+','', result)
            result = client.parseDOM(result, 'div', attrs = {'class': 'video-player'})[0]
            result = client.parseDOM(result, 'iframe', ret='src')[-1]

            try:
                url = base64.b64decode(urlparse.parse_qs(urlparse.urlparse(result).query)['id'][0])
                if not url.startswith('http'): raise Exception()
            except:
                url = client.source(result)
                url = urllib.unquote_plus(url.decode('string-escape'))
                url = re.compile('"(.+?)"').findall(url)
                url = [i for i in url if 'ok.ru' in i or 'vk.com' in i][0]

            try: url = 'http://ok.ru/video/%s' % urlparse.parse_qs(urlparse.urlparse(url).query)['mid'][0]
            except: pass

            if 'ok.ru' in url: host = 'vk' ; url = directstream.odnoklassniki(url)
            elif 'vk.com' in url: host = 'vk' ; url = directstream.vk(url)
            else: raise Exception()

            for i in url: sources.append({'source': host, 'quality': i['quality'], 'provider': 'Onlinedizi', 'url': i['url'], 'direct': True, 'debridonly': False})

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = [(dom_parser.parse_dom(i, 'a', attrs={'class': 'options'}, req='href'), dom_parser.parse_dom(i, 'img', req='src')) for i in rels]
            rels = [(i[0][0].attrs['href'][1:], re.findall('\/flags\/(\w+)\.png$', i[1][0].attrs['src'])) for i in rels if i[0] and i[1]]
            rels = [i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de']

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]
            r = [(re.findall('link"?\s*:\s*"(.+?)"', ''.join([x.content for x in i])), dom_parser.parse_dom(i, 'iframe', attrs={'class': 'metaframe'}, req='src')) for i in r]
            r = [i[0][0] if i[0] else i[1][0].attrs['src'] for i in r if i[0] or i[1]]

            for i in r:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)
                    if not i.startswith('http'): i = self.__decode_hash(i)

                    valid, host = source_utils.is_host_valid(i, hostDict)
                    if not valid: continue

                    if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i)
                    elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                    else: direct = False; urls = [{'quality': 'SD', 'url': i}]

                    for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'de', 'url': x['url'], 'direct': direct, 'debridonly': False})
                except:
                    pass

            return sources
        except:
            return sources
Example #21
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = client.request(url)
            result = re.compile('var\s*view_id\s*=\s*"(\d*)"').findall(result)[0]

            query = self.player_link % result

            result = client.request(query, headers={'Referer': url})

            try:
                url = client.parseDOM(result, 'iframe', ret='src')[0]

                if 'ok.ru' in url: host = 'vk' ; url = directstream.odnoklassniki(url)
                elif 'vk.com' in url: host = 'vk' ; url = directstream.vk(url)
                else: raise Exception()

                for i in url: sources.append({'source': host, 'quality': i['quality'], 'provider': 'Dizigold', 'url': i['url'], 'direct': True, 'debridonly': False})
            except:
                pass

            try:
                url = re.compile('"?file"?\s*:\s*"([^"]+)"\s*,\s*"?label"?\s*:\s*"(\d+)p?"').findall(result)

                links = [(i[0], '1080p') for i in url if int(i[1]) >= 1080]
                links += [(i[0], 'HD') for i in url if 720 <= int(i[1]) < 1080]
                links += [(i[0], 'SD') for i in url if 480 <= int(i[1]) < 720]

                for i in links: sources.append({'source': 'gvideo', 'quality': i[1], 'provider': 'Dizigold', 'url': i[0], 'direct': True, 'debridonly': False})
            except:
                pass

            return sources
        except:
            return sources
Example #22
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

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

            result = cloudflare.source(url)
            result = re.compile('var\s*view_id\s*=\s*"(\d*)"').findall(result)[0]

            query = self.player_link % result

            result = cloudflare.source(query, headers={'Referer': url})

            try:
                url = client.parseDOM(result, 'iframe', ret='src')[0]

                if 'ok.ru' in url: host = 'vk' ; url = directstream.odnoklassniki(url)
                elif 'vk.com' in url: host = 'vk' ; url = directstream.vk(url)
                else: raise Exception()

                for i in url: sources.append({'source': host, 'quality': i['quality'], 'provider': 'Dizigold', 'url': i['url'], 'direct': True, 'debridonly': False})
            except:
                pass

            try:
                url = re.compile('"?file"?\s*:\s*"([^"]+)"\s*,\s*"?label"?\s*:\s*"(\d+)p?"').findall(result)

                links = [(i[0], '1080p') for i in url if int(i[1]) >= 1080]
                links += [(i[0], 'HD') for i in url if 720 <= int(i[1]) < 1080]
                links += [(i[0], 'SD') for i in url if 480 <= int(i[1]) < 720]

                for i in links: sources.append({'source': 'gvideo', 'quality': i[1], 'provider': 'Dizigold', 'url': i[0], 'direct': True, 'debridonly': False})
            except:
                pass

            return sources
        except:
            return sources
Example #23
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

            if not str(url).startswith('http'):

                data = urlparse.parse_qs(url)
                data = dict([(i, data[i][0]) if data[i] else (i, '')
                             for i in data])

                title = cleantitle.get(data['tvshowtitle'])
                season, episode = '%01d' % int(data['season']), '%01d' % int(
                    data['episode'])
                year = re.findall('(\d{4})', data['premiered'])[0]

                url = cache.get(self.dizibox_tvcache, 120)

                url = [i[0] for i in url if title == i[1]][-1]
                url = urlparse.urljoin(self.base_link, url)

                result = client.request(url)

                if not season == '1':
                    url = client.parseDOM(result,
                                          'a',
                                          ret='href',
                                          attrs={'class': 'season-.+?'})
                    url = [i for i in url if '/%s-sezon-' % season in i][0]
                    result = client.request(url)

                url = client.parseDOM(result, 'a', ret='href')
                url = [
                    i for i in url
                    if '%s-sezon-%s-bolum-' % (season, episode) in i
                ][0]

                atr = re.findall('%s.+?\s+(\d{4})' % url, result)[0]
                if not atr == year: raise Exception()

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

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+', '', result)

            url = re.compile('(<a.*?</a>)', re.DOTALL).findall(result)
            url = [(client.parseDOM(i, 'a',
                                    ret='href'), client.parseDOM(i, 'a'))
                   for i in url]
            url = [(i[0][0], i[1][0]) for i in url
                   if len(i[0]) > 0 and len(i[1]) > 0]
            url = [i[0] for i in url if i[1] == 'Altyazsz'][0]

            result = client.request(url)
            result = re.sub(r'[^\x00-\x7F]+', '', result)

            headers = {'Referer': url}

            url = client.parseDOM(result,
                                  'span',
                                  attrs={'class': 'object-wrapper'})[0]
            url = client.parseDOM(url, 'iframe', ret='src')[0]
            url = client.replaceHTMLCodes(url)

            url = client.request(url, headers=headers)
            url = client.parseDOM(url,
                                  'param',
                                  ret='value',
                                  attrs={'name': 'flashvars'})[0]
            url = urllib.unquote_plus(url)
            url = 'http://ok.ru/video/%s' % urlparse.parse_qs(
                urlparse.urlparse(url).query)['mid'][0]
            url = directstream.odnoklassniki(url)

            for i in url:
                sources.append({
                    'source': 'vk',
                    'quality': i['quality'],
                    'provider': 'Dizibox',
                    'url': i['url'],
                    'direct': True,
                    'debridonly': False
                })

            return sources
        except:
            return sources
Example #24
0
    def sources(self, url, hostDict, hostprDict):
        try:
            sources = []

            if url == None: return sources

            if not str(url).startswith('http'):

                data = urlparse.parse_qs(url)
                data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data])

                title = cleantitle.get(data['tvshowtitle'])
                season, episode = '%01d' % int(data['season']), '%01d' % int(data['episode'])
                year = re.findall('(\d{4})', data['premiered'])[0]

                url = cache.get(self.dizibox_tvcache, 120)

                url = [i[0] for i in url if title == i[1]][-1]
                url = urlparse.urljoin(self.base_link, url)

                result = cloudflare.source(url)

                if not season == '1':
                    url = client.parseDOM(result, 'a', ret='href', attrs = {'class': 'season-.+?'})
                    url = [i for i in url if '/%s-sezon-' % season in i][0]
                    result = cloudflare.source(url)

                url = client.parseDOM(result, 'a', ret='href')
                url = [i for i in url if '%s-sezon-%s-bolum-' % (season, episode) in i][0]

                atr = re.findall('%s.+?\s+(\d{4})' % url, result)[0]
                if not atr == year: raise Exception()


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

            result = cloudflare.source(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)

            url = re.compile('(<a.*?</a>)', re.DOTALL).findall(result)
            url = [(client.parseDOM(i, 'a', ret='href'), client.parseDOM(i, 'a')) for i in url]
            url = [(i[0][0], i[1][0]) for i in url if len(i[0]) > 0 and len(i[1]) > 0]
            url = [i[0] for i in url if i[1] == 'Altyazsz'][0]

            result = cloudflare.source(url)
            result = re.sub(r'[^\x00-\x7F]+','', result)
 
            headers = {'Referer': url}

            url = client.parseDOM(result, 'span', attrs = {'class': 'object-wrapper'})[0]
            url = client.parseDOM(url, 'iframe', ret='src')[0]
            url = client.replaceHTMLCodes(url)

            url = cloudflare.source(url, headers=headers)
            url = client.parseDOM(url, 'param', ret='value', attrs = {'name': 'flashvars'})[0]
            url = urllib.unquote_plus(url)
            url = 'http://ok.ru/video/%s' % urlparse.parse_qs(urlparse.urlparse(url).query)['mid'][0]
            url = directstream.odnoklassniki(url)

            for i in url: sources.append({'source': 'vk', 'quality': i['quality'], 'provider': 'Dizibox', 'url': i['url'], 'direct': True, 'debridonly': False})

            return sources
        except:
            return sources
Example #25
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = [(dom_parser.parse_dom(i, 'a', attrs={'class': 'options'}, req='href'), dom_parser.parse_dom(i, 'img', req='src')) for i in rels]
            rels = [(i[0][0].attrs['href'][1:], re.findall('\/flags\/(\w+)\.png$', i[1][0].attrs['src'])) for i in rels if i[0] and i[1]]
            rels = [i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de']

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]
            r = [(re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''', i[0].content), dom_parser.parse_dom(i, 'iframe', attrs={'class': 'metaframe'}, req='src')) for i in r]
            r = [i[0][0] if len(i[0]) > 0 else i[1][0].attrs['src'] for i in r if i[0] or i[1]]

            for i in r:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)

                    if self.base_link in i:
                        i = client.request(i, referer=url)

                        s = re.compile('(eval\(function.*?)</script>', re.DOTALL).findall(i)

                        for x in s:
                            try: i += jsunpack.unpack(x)
                            except: pass

                        i = re.findall('file"?\s*:\s*"(.+?)"', i)

                        for u in i:
                            try:
                                u = u.replace('\\/', '/').replace('\/', '/')
                                u = client.replaceHTMLCodes(u).encode('utf-8')

                                sources.append({'source': 'gvideo', 'quality': directstream.googletag(u)[0]['quality'], 'language': 'de', 'url': u, 'direct': True, 'debridonly': False})
                            except:
                                pass
                    else:
                        try:
                            valid, host = source_utils.is_host_valid(i, hostDict)
                            if not valid: continue

                            urls = []
                            if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                            if 'google' in i and not urls and directstream.googletag(i):  host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                            elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                            elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                            else: direct = False; urls = [{'quality': 'SD', 'url': i}]

                            for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'de', 'url': x['url'], 'direct': direct, 'debridonly': False})
                        except:
                            pass
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = dom_parser.parse_dom(rels, 'a', attrs={'class': 'options'}, req='href')
            rels = [i.attrs['href'][1:] for i in rels]

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''', ''.join([i[0].content for i in r]))
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'iframe', attrs={'class': 'metaframe'}, req='src')]
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'source', req='src')]

            for i in set(links):
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)

                    if 'videoapi.io' in i:
                        i = client.request(i, referer=url)

                        match = re.findall('videoApiPlayer\((.*?)\);', i)
                        if match:
                            i = client.request('https://videoapi.io/api/getlink/actionEmbed', post=json.loads(match[0]), XHR=True)
                            i = json.loads(i).get('sources', [])
                            i = [x.get('file', '').replace('\/', '/') for x in i]

                            for x in i:
                                gtag = directstream.googletag(x)
                                sources.append({'source': 'gvideo', 'quality': gtag[0]['quality'] if gtag else 'SD', 'language': 'ko', 'url': x, 'direct': True, 'debridonly': False})
                    else:
                        try:
                            valid, host = source_utils.is_host_valid(i, hostDict)
                            if not valid: continue

                            urls = []
                            if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                            if 'google' in i and not urls and directstream.googletag(i):  host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                            elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                            elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                            else: direct = False; urls = [{'quality': 'SD', 'url': i}]

                            for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'ko', 'url': x['url'], 'direct': direct, 'debridonly': False})
                        except:
                            pass
                except:
                    pass

            return sources
        except:
            return sources
Example #27
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = [(dom_parser.parse_dom(i, 'a', attrs={'class': 'options'}, req='href'), dom_parser.parse_dom(i, 'img', req='src')) for i in rels]
            rels = [(i[0][0].attrs['href'][1:], re.findall('\/flags\/(\w+)\.png$', i[1][0].attrs['src'])) for i in rels if i[0] and i[1]]
            rels = [i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de']

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''', ''.join([i[0].content for i in r]))
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'iframe', attrs={'class': 'metaframe'}, req='src')]
            links += [l.attrs['src'] for i in r for l in dom_parser.parse_dom(i, 'source', req='src')]

            for i in links:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)

                    if self.domains[0] in i:
                        i = client.request(i, referer=url)

                        for x in re.findall('''\(["']?(.*)["']?\)''', i):
                            try: i += jsunpack.unpack(base64.decodestring(re.sub('"\s*\+\s*"', '', x)))
                            except: pass

                        s = re.compile('(eval\(function.*?)</script>', re.DOTALL).findall(i)

                        for x in s:
                            try: i += jsunpack.unpack(x)
                            except: pass

                        i = [(match[0], match[1]) for match in re.findall('''['"]?file['"]?\s*:\s*['"]([^'"]+)['"][^}]*['"]?label['"]?\s*:\s*['"]([^'"]*)''', i, re.DOTALL)]
                        i = [(x[0].replace('\/', '/'), source_utils.label_to_quality(x[1])) for x in i if '/no-video.mp4' not in x[0]]

                        for url, quality in i:
                            sources.append({'source': 'gvideo', 'quality': quality, 'language': 'de', 'url': url, 'direct': True, 'debridonly': False})
                    else:
                        try:
                            valid, host = source_utils.is_host_valid(i, hostDict)
                            if not valid: continue

                            urls = []
                            if 'google' in i: host = 'gvideo'; direct = True; urls = directstream.google(i);
                            if 'google' in i and not urls and directstream.googletag(i):  host = 'gvideo'; direct = True; urls = [{'quality': directstream.googletag(i)[0]['quality'], 'url': i}]
                            elif 'ok.ru' in i: host = 'vk'; direct = True; urls = directstream.odnoklassniki(i)
                            elif 'vk.com' in i: host = 'vk'; direct = True; urls = directstream.vk(i)
                            else: direct = False; urls = [{'quality': 'SD', 'url': i}]

                            for x in urls: sources.append({'source': host, 'quality': x['quality'], 'language': 'de', 'url': x['url'], 'direct': direct, 'debridonly': False})
                        except:
                            pass
                except:
                    pass

            return sources
        except:
            return sources
Example #28
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

            url = urlparse.urljoin(self.base_link, url)
            c = client.request(url, output='cookie')
            result = client.request(url)

            result = re.sub(r'[^\x00-\x7F]+', ' ', result)

            pages = dom_parser.parse_dom(result,
                                         'div',
                                         attrs={'class': 'item'},
                                         req='data-id')
            pages = [i.attrs['data-id'] for i in pages]

            for page in pages:
                try:
                    url = urlparse.urljoin(self.base_link, self.video_link)

                    result = client.request(url, post={'id': page}, cookie=c)
                    if not result: continue

                    url = dom_parser.parse_dom(result, 'iframe',
                                               req='src')[0].attrs['src']
                    if url.startswith('//'): url = 'http:' + url
                    if url.startswith('/'):
                        url = urlparse.urljoin(self.base_link, url)

                    valid, host = source_utils.is_host_valid(url, hostDict)
                    if valid:
                        if 'ok.ru' in host:
                            okinfo = directstream.odnoklassniki(url)
                            for x in okinfo:
                                sources.append({
                                    'source': host,
                                    'quality': x['quality'],
                                    'language': 'en',
                                    'url': x['url'],
                                    'direct': True,
                                    'debridonly': False
                                })

                        else:
                            sources.append({
                                'source': host,
                                'quality': 'HD',
                                'language': 'en',
                                'url': url,
                                'direct': False,
                                'debridonly': False
                            })

                    if '.asp' not in url: continue

                    result = client.request(url, cookie=c)

                    try:
                        url = dom_parser.parse_dom(result, 'iframe',
                                                   req='src')[0].attrs['src']
                        url = url.replace('https://href.li/?', '')
                        valid, host = source_utils.is_host_valid(url, hostDict)
                        if valid:
                            if host == 'gvideo':
                                ginfo = directstream.google(url)
                                for g in ginfo:
                                    sources.append({
                                        'source': host,
                                        'quality': g['quality'],
                                        'language': 'en',
                                        'url': g['url'],
                                        'direct': True,
                                        'debridonly': False
                                    })
                            else:
                                sources.append({
                                    'source': host,
                                    'quality': 'HD',
                                    'language': 'en',
                                    'url': url,
                                    'direct': False,
                                    'debridonly': False
                                })
                    except BaseException:
                        pass

                    captions = re.search(
                        '''["']?kind["']?\s*:\s*(?:\'|\")captions(?:\'|\")''',
                        result)
                    if not captions: continue

                    matches = [(match[0], match[1]) for match in re.findall(
                        '''["']?label\s*["']?\s*[:=]\s*["']?(?P<label>[^"',]+)["']?(?:[^}\]]+)["']?\s*file\s*["']?\s*[:=,]?\s*["'](?P<url>[^"']+)''',
                        result, re.DOTALL | re.I)]
                    matches += [(match[1], match[0]) for match in re.findall(
                        '''["']?\s*file\s*["']?\s*[:=,]?\s*["'](?P<url>[^"']+)(?:[^}>\]]+)["']?\s*label\s*["']?\s*[:=]\s*["']?(?P<label>[^"',]+)''',
                        result, re.DOTALL | re.I)]

                    result = [(source_utils.label_to_quality(x[0]),
                               x[1].replace('\/', '/')) for x in matches]
                    result = [(i[0], i[1]) for i in result
                              if not i[1].endswith('.vtt')]

                    for quality, url in result:
                        sources.append({
                            'source': 'gvideo',
                            'quality': quality,
                            'language': 'en',
                            'url': url,
                            'direct': True,
                            'debridonly': False
                        })
                except BaseException:
                    pass

            return sources
        except BaseException:
            return sources
Example #29
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if url == None:
                return sources

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

            cookie = self.__get_premium_cookie()

            r = client.request(url, mobile=True, cookie=cookie)

            query = urlparse.urljoin(self.base_link, self.part_link)
            id = re.compile('var\s*video_id\s*=\s*"(\d+)"').findall(r)[0]

            p = client.parseDOM(r, 'a', attrs={'class': 'changePart', 'data-part': '\d+p'}, ret='data-part')

            for i in p:
                p = urllib.urlencode({'video_id': id, 'part_name': i, 'page': '0'})
                p = client.request(query, cookie=cookie, mobile=True, XHR=True, post=p, referer=url)

                p = json.loads(p)
                p = p.get('part_count', 0)

                for part_count in range(0, p):
                    try:
                        r = urllib.urlencode({'video_id': id, 'part_name': i, 'page': part_count})
                        r = client.request(query, cookie=cookie, mobile=True, XHR=True, post=r, referer=url)

                        r = json.loads(r)
                        r = r.get('part', {})

                        s = r.get('source', '')
                        url = r.get('code', '')

                        if s == 'url' and 'http' not in url:
                            url = self.__decode_hash(url)
                        elif s == 'other':
                            url = client.parseDOM(url, 'iframe', ret='src')
                            if len(url) < 1: continue
                            url = url[0]
                            if '/old/seframer.php' in url: url = self.__get_old_url(url)

                        host = re.findall('([\w]+[.][\w]+)$', urlparse.urlparse(url.strip().lower()).netloc)[0]
                        if not host in hostDict and not 'google' in host: continue

                        if i in ['720p', 'HD']: quali = 'HD'
                        elif i in ['1080p', '1440p']: quali = i
                        elif i in ['2160p']: quali = '4K'
                        else: quali = 'SD'

                        if 'google' in url: host = 'gvideo'; direct = True; urls = directstream.google(url)
                        elif 'ok.ru' in url: host = 'vk'; direct = True; urls = directstream.odnoklassniki(url)
                        elif 'vk.com' in url: host = 'vk'; direct = True; urls = directstream.vk(url)
                        else: direct = False; urls = [{'quality': quali, 'url': url}]

                        for i in urls: sources.append({'source': host, 'quality': i['quality'], 'language': 'de', 'url': i['url'], 'direct': direct, 'debridonly': False})
                    except:
                        pass

            return sources
        except:
            return sources
Example #30
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if url == None:
                return sources

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

            cookie = self.__get_premium_cookie()

            r = client.request(url, mobile=True, cookie=cookie)

            query = urlparse.urljoin(self.base_link, self.part_link)
            id = re.compile('var\s*video_id\s*=\s*"(\d+)"').findall(r)[0]

            p = dom_parser.parse_dom(r, 'a', attrs={'class': 'changePart', 'data-part': re.compile('\d+p')}, req='data-part')

            for i in p:
                i = i.attrs['data-part']

                p = urllib.urlencode({'video_id': id, 'part_name': i, 'page': '0'})
                p = client.request(query, cookie=cookie, mobile=True, XHR=True, post=p, referer=url)

                p = json.loads(p)
                p = p.get('part_count', 0)

                for part_count in range(0, p):
                    try:
                        r = urllib.urlencode({'video_id': id, 'part_name': i, 'page': part_count})
                        r = client.request(query, cookie=cookie, mobile=True, XHR=True, post=r, referer=url)

                        r = json.loads(r)
                        r = r.get('part', {})

                        s = r.get('source', '')
                        url = r.get('code', '')

                        if s == 'url' and 'http' not in url:
                            url = self.__decode_hash(url)
                        elif s == 'other':
                            url = dom_parser.parse_dom(url, 'iframe', req='src')
                            if len(url) < 1: continue
                            url = url[0].attrs['src']
                            if '/old/seframer.php' in url: url = self.__get_old_url(url)

                        valid, host = source_utils.is_host_valid(url, hostDict)
                        if not valid: continue

                        if i in ['720p', 'HD']: quali = 'HD'
                        elif i in ['1080p', '1440p']: quali = i
                        elif i in ['2160p']: quali = '4K'
                        else: quali = 'SD'

                        if 'google' in url: host = 'gvideo'; direct = True; urls = directstream.google(url)
                        elif 'ok.ru' in url: host = 'vk'; direct = True; urls = directstream.odnoklassniki(url)
                        elif 'vk.com' in url: host = 'vk'; direct = True; urls = directstream.vk(url)
                        else: direct = False; urls = [{'quality': quali, 'url': url}]

                        for i in urls: sources.append({'source': host, 'quality': i['quality'], 'language': 'de', 'url': i['url'], 'direct': direct, 'debridonly': False})
                    except:
                        pass

            return sources
        except:
            return sources
Example #31
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(ref)

            p = re.findall('load_player\((\d+)\)', r)
            r = client.request(urlparse.urljoin(self.base_link,
                                                self.player_link),
                               post={'id': p[0]},
                               referer=ref,
                               XHR=True)
            url = json.loads(r).get('value')
            link = client.request(url, XHR=True, output='geturl', referer=ref)

            if '1movies.' in link:
                r = client.request(link, XHR=True, referer=ref)
                js = json.loads(r)
                j = js['playlist']
                for a in j:
                    url = a['file']
                    sources.append({
                        'source': 'HLS',
                        'quality': 'HD',
                        'language': 'en',
                        'url': url,
                        'direct': True,
                        'debridonly': False
                    })
            else:
                valid, host = source_utils.is_host_valid(link, hostDict)
                if not valid: return

                urls = []
                if 'google' in link:
                    host = 'gvideo'
                    direct = True
                    urls = directstream.google(link)
                if 'google' in link and not urls and directstream.googletag(
                        link):
                    host = 'gvideo'
                    direct = True
                    urls = [{
                        'quality':
                        directstream.googletag(link)[0]['quality'],
                        'url':
                        link
                    }]
                elif 'ok.ru' in link:
                    host = 'vk'
                    direct = True
                    urls = directstream.odnoklassniki(link)
                elif 'vk.com' in link:
                    host = 'vk'
                    direct = True
                    urls = directstream.vk(link)
                else:
                    direct = False
                    urls = [{
                        'quality': 'HD',
                        'url': link
                    }]

                for x in urls:
                    sources.append({
                        'source': host,
                        'quality': x['quality'],
                        'language': 'en',
                        'url': x['url'],
                        'direct': direct,
                        'debridonly': False
                    })

            return sources
        except:
            return sources
Example #32
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = [(dom_parser.parse_dom(i,
                                          'a',
                                          attrs={'class': 'options'},
                                          req='href'),
                     dom_parser.parse_dom(i, 'img', req='src')) for i in rels]
            rels = [(i[0][0].attrs['href'][1:],
                     re.findall('\/flags\/(\w+)\.png$', i[1][0].attrs['src']))
                    for i in rels if i[0] and i[1]]
            rels = [
                i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de'
            ]

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''',
                               ''.join([i[0].content for i in r]))
            links += [
                l.attrs['src'] for l in dom_parser.parse_dom(
                    i, 'iframe', attrs={'class': 'metaframe'}, req='src')
                for i in r
            ]
            links += [
                l.attrs['src']
                for l in dom_parser.parse_dom(i, 'source', req='src')
                for i in r
            ]

            for i in links:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)

                    if self.domains[0] in i:
                        i = client.request(i, referer=url)

                        s = re.compile('(eval\(function.*?)</script>',
                                       re.DOTALL).findall(i)

                        for x in s:
                            try:
                                i += jsunpack.unpack(x)
                            except:
                                pass

                        i = re.findall('file"?\s*:\s*"(.+?)"', i)

                        for u in i:
                            try:
                                u = u.replace('\\/', '/').replace('\/', '/')
                                u = client.replaceHTMLCodes(u).encode('utf-8')

                                sources.append({
                                    'source':
                                    'gvideo',
                                    'quality':
                                    directstream.googletag(u)[0]['quality'],
                                    'language':
                                    'de',
                                    'url':
                                    u,
                                    'direct':
                                    True,
                                    'debridonly':
                                    False
                                })
                            except:
                                pass
                    else:
                        try:
                            valid, host = source_utils.is_host_valid(
                                i, hostDict)
                            if not valid: continue

                            urls = []
                            if 'google' in i:
                                host = 'gvideo'
                                direct = True
                                urls = directstream.google(i)
                            if 'google' in i and not urls and directstream.googletag(
                                    i):
                                host = 'gvideo'
                                direct = True
                                urls = [{
                                    'quality':
                                    directstream.googletag(i)[0]['quality'],
                                    'url':
                                    i
                                }]
                            elif 'ok.ru' in i:
                                host = 'vk'
                                direct = True
                                urls = directstream.odnoklassniki(i)
                            elif 'vk.com' in i:
                                host = 'vk'
                                direct = True
                                urls = directstream.vk(i)
                            else:
                                direct = False
                                urls = [{
                                    'quality': 'SD',
                                    'url': i
                                }]

                            for x in urls:
                                sources.append({
                                    'source': host,
                                    'quality': x['quality'],
                                    'language': 'de',
                                    'url': x['url'],
                                    'direct': direct,
                                    'debridonly': False
                                })
                        except:
                            pass
                except:
                    pass

            return sources
        except:
            return sources
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if not url:
                return sources

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

            r = client.request(url)

            rels = dom_parser.parse_dom(r, 'nav', attrs={'class': 'player'})
            rels = dom_parser.parse_dom(rels, 'ul', attrs={'class': 'idTabs'})
            rels = dom_parser.parse_dom(rels, 'li')
            rels = dom_parser.parse_dom(rels,
                                        'a',
                                        attrs={'class': 'options'},
                                        req='href')
            rels = [i.attrs['href'][1:] for i in rels]

            r = [dom_parser.parse_dom(r, 'div', attrs={'id': i}) for i in rels]

            links = re.findall('''(?:link|file)["']?\s*:\s*["'](.+?)["']''',
                               ''.join([i[0].content for i in r]))
            links += [
                l.attrs['src'] for i in r for l in dom_parser.parse_dom(
                    i, 'iframe', attrs={'class': 'metaframe'}, req='src')
            ]
            links += [
                l.attrs['src'] for i in r
                for l in dom_parser.parse_dom(i, 'source', req='src')
            ]

            for i in set(links):
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)

                    if 'videoapi.io' in i:
                        i = client.request(i, referer=url)

                        match = re.findall('videoApiPlayer\((.*?)\);', i)
                        if match:
                            i = client.request(
                                'https://videoapi.io/api/getlink/actionEmbed',
                                post=json.loads(match[0]),
                                XHR=True)
                            i = json.loads(i).get('sources', [])
                            i = [
                                x.get('file', '').replace('\/', '/') for x in i
                            ]

                            for x in i:
                                gtag = directstream.googletag(x)
                                sources.append({
                                    'source':
                                    'gvideo',
                                    'quality':
                                    gtag[0]['quality'] if gtag else 'SD',
                                    'language':
                                    'ko',
                                    'url':
                                    x,
                                    'direct':
                                    True,
                                    'debridonly':
                                    False
                                })
                    else:
                        try:
                            valid, host = source_utils.is_host_valid(
                                i, hostDict)
                            if not valid: continue

                            urls = []
                            if 'google' in i:
                                host = 'gvideo'
                                direct = True
                                urls = directstream.google(i)
                            if 'google' in i and not urls and directstream.googletag(
                                    i):
                                host = 'gvideo'
                                direct = True
                                urls = [{
                                    'quality':
                                    directstream.googletag(i)[0]['quality'],
                                    'url':
                                    i
                                }]
                            elif 'ok.ru' in i:
                                host = 'vk'
                                direct = True
                                urls = directstream.odnoklassniki(i)
                            elif 'vk.com' in i:
                                host = 'vk'
                                direct = True
                                urls = directstream.vk(i)
                            else:
                                direct = False
                                urls = [{
                                    'quality': 'SD',
                                    'url': i
                                }]

                            for x in urls:
                                sources.append({
                                    'source': host,
                                    'quality': x['quality'],
                                    'language': 'ko',
                                    'url': x['url'],
                                    'direct': direct,
                                    'debridonly': False
                                })
                        except:
                            pass
                except:
                    pass

            return sources
        except:
            return sources
Example #34
0
    def sources(self, url, hostDict, hostprDict):
        sources = []

        try:
            if url == None:
                return sources

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

            r = client.request(url, headers={'Accept-Encoding': 'gzip'})

            rels = client.parseDOM(r, 'nav', attrs={'class': 'player'})
            rels = client.parseDOM(rels, 'ul', attrs={'class': 'idTabs'})
            rels = client.parseDOM(rels, 'li')
            rels = [(client.parseDOM(i,
                                     'a',
                                     attrs={'class': 'options'},
                                     ret='href'),
                     client.parseDOM(i, 'img', ret='src')) for i in rels]
            rels = [(i[0][0][1:], re.findall('\/flags\/(\w+)\.png$', i[1][0]))
                    for i in rels if len(i[0]) > 0 and len(i[1]) > 0]
            rels = [
                i[0] for i in rels if len(i[1]) > 0 and i[1][0].lower() == 'de'
            ]

            r = [client.parseDOM(r, 'div', attrs={'id': i}) for i in rels]
            r = [(re.findall('link"?\s*:\s*"(.+?)"', i[0]),
                  client.parseDOM(i,
                                  'iframe',
                                  attrs={'class': '[^\'"]*metaframe[^\'"]*'},
                                  ret='src')) for i in r]
            r = [
                i[0][0] if len(i[0]) > 0 else i[1][0] for i in r
                if len(i[0]) > 0 or len(i[1]) > 0
            ]

            for i in r:
                try:
                    i = re.sub('\[.+?\]|\[/.+?\]', '', i)
                    i = client.replaceHTMLCodes(i)
                    if not i.startswith('http'): i = self.__decode_hash(i)

                    host = re.findall(
                        '([\w]+[.][\w]+)$',
                        urlparse.urlparse(i.strip().lower()).netloc)[0]
                    if not host in hostDict and not 'google' in host: continue

                    if 'google' in i:
                        host = 'gvideo'
                        direct = True
                        urls = directstream.google(i)
                    elif 'ok.ru' in i:
                        host = 'vk'
                        direct = True
                        urls = directstream.odnoklassniki(i)
                    elif 'vk.com' in i:
                        host = 'vk'
                        direct = True
                        urls = directstream.vk(i)
                    else:
                        direct = False
                        urls = [{
                            'quality': 'SD',
                            'url': i
                        }]

                    for x in urls:
                        sources.append({
                            'source': host,
                            'quality': x['quality'],
                            'language': 'de',
                            'url': x['url'],
                            'direct': direct,
                            'debridonly': False
                        })
                except:
                    pass

            return sources
        except:
            return sources