예제 #1
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content.encode("utf-8")
     sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*'(?P<url>[^']+)'''])
     if not sources:
         data = helpers.get_hidden(html)
         headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
         html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
         sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*'(?P<url>[^']+)'''])
     return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #2
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     sources = helpers.scrape_sources(html)
     if not sources:
         data = helpers.get_hidden(html)
         headers['Cookie'] = response.get_headers(as_dict=True).get(
             'Set-Cookie', '')
         html = self.net.http_POST(response.get_url(),
                                   headers=headers,
                                   form_data=data).content
         sources = helpers.scrape_sources(html)
     return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #3
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        r = self.net.http_GET(web_url, headers=self.desktopHeaders)

        sources = helpers.scrape_sources(
            r.content,
            generic_patterns=False,
            patterns=[
                '''sources.*?\[['"](?P<url>.*?)['"]''',
                '''sources.*?file:.*?['"](?P<url>.*?)['"](?:.*?label.*?['"](?P<label>.*?)['"])?''',
                '''updateSrc.*?src:.*?['"](?P<url>.*?)['"](?:.*?label.*?['"](?P<label>.*?)['"])?'''
            ])
        if sources:
            # Headers for requesting media (copied from Firefox).
            parsedUrl = urlparse(r.get_url())
            kodiHeaders = {
                'User-Agent':
                self.userAgent,
                'Accept':
                'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
                'Referer':
                '%s://%s/' % (parsedUrl.scheme, parsedUrl.netloc),
                'Cookie':
                '; '.join(cookie.name + '=' + cookie.value
                          for cookie in self.net._cj)
            }
            return helpers.pick_source(sources) + helpers.append_headers(
                kodiHeaders)

        raise ResolverError('Unable to locate video')
예제 #4
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get(
            'Set-Cookie', '')
        sleep_time = 10  # in seconds
        wait_ms = sleep_time * 1000
        common.kodi.notify(header=None,
                           msg='XvidStage requires %s second wait' %
                           sleep_time,
                           duration=wait_ms)
        common.kodi.sleep(wait_ms)
        html = self.net.http_POST(web_url, headers=headers,
                                  form_data=data).content

        if html:
            packed = helpers.get_packed_data(html)

            sources = helpers.scrape_sources(packed, result_blacklist=['tmp'])
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError('Unable to locate video')
예제 #5
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        r = self.net.http_GET(web_url, headers=self.desktopHeaders)

        if r._response.code == 200:
            sources = helpers.scrape_sources(
                r.content,
                generic_patterns=False,
                patterns=['''sources.*?\[['"](?P<url>.*?)['"]'''])
            if sources:
                # Headers for requesting media (copied from Firefox).
                parsedUrl = urlparse(r.get_url())
                kodiHeaders = {
                    'User-Agent':
                    self.net.get_user_agent(),
                    'Accept':
                    'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
                    'Referer':
                    '%s://%s/' % (parsedUrl.scheme, parsedUrl.netloc),
                    'Cookie':
                    '; '.join(
                        header.replace('Set-Cookie: ', '').split(';', 1)[0]
                        for header in r.get_headers()
                        if header.startswith('Set-Cookie'))
                }
                return helpers.pick_source(sources) + helpers.append_headers(
                    kodiHeaders)
        raise ResolverError('Unable to locate video')
예제 #6
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            data = helpers.get_hidden(html)
            headers.update({'Referer': web_url})
            common.kodi.sleep(2000)
            _html = self.net.http_POST(web_url,
                                       headers=headers,
                                       form_data=data).content
            if _html:
                sources = helpers.scrape_sources(
                    _html,
                    patterns=[
                        '''(?:file:|xpro\()\s*["'](?P<url>[^"']+)["']\)?,\s*label\s*:\s*["'](?P<label>[^"',]{3,4})["']'''
                    ],
                    generic_patterns=False)
                if sources:
                    sources = [(source[0], source[1].decode("rot-13")) if
                               (source[1].startswith("uggc")) else
                               (source[0], source[1]) for source in sources]

                    return helpers.pick_source(
                        sources) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate video')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': web_url.replace("iframe-", "preview-")}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*["'](?P<url>[^"']+)'''])
         data = re.findall("""_[^=]+=\[([^\]]+)\];""", html, re.DOTALL)
         if sources and data:
             data = data[3].replace('\\x', '').split(",")
             data = [x.replace('"', '').replace(' ', '').decode("hex") for x in data]
             key = "".join(data[7:9])
             if key.startswith("embed"):
                 key = key[6:]+key[:6]
             i = 0
             headers.update({'Referer': web_url})
             for source in sources:
                 try:
                     src = urlparse.urlparse(source[1])
                     l = list(src)
                     b = l[2].split("/")[1:]
                     b[0] = self.decrypt(b[0], key)
                     l[2] = "/".join(b)
                     sources[i] = (source[0], urlparse.urlunparse(l))
                     i += 1
                 except:
                     i += 1
                 
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('File not found')
예제 #8
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            file_id = re.search("file_id',\s*'([^']+)", html)
            if file_id:
                headers.update(
                    {'cookie': 'lang=1; file_id={}'.format(file_id.group(1))})
                html = self.net.http_GET(web_url, headers=headers).content
            else:
                html = None

        if html:
            html = html.encode('utf-8')
            aa_text = re.search("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?;)\svar""", html,
                                re.I)
            if aa_text:
                try:
                    aa_decoded = str(aadecode.decode(aa_text.group(1)))
                except:
                    raise ResolverError('Error decoding')

                sources = helpers.scrape_sources(aa_decoded)
                if sources:
                    headers.update({'Referer': web_url})
                    return helpers.pick_source(
                        sources) + helpers.append_headers(headers)

        raise ResolverError('Video not found')
예제 #9
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {
            'User-Agent': common.RAND_UA,
            'Referer': web_url.replace("iframe-", "preview-")
        }
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            splice = re.search(
                "\['splice'\]\(0x([0-9a-fA-F]*),0x([0-9a-fA-F]*)\);", html)
            sources = helpers.scrape_sources(
                html,
                patterns=['''src\s*:\s*["'](?P<url>http[^"']+\.mp4)["']'''])
            if sources and splice:
                headers.update({'Referer': web_url})
                sources = [(source[0],
                            self.decode_video_url(source[1],
                                                  int(splice.group(1), 16),
                                                  int(splice.group(2), 16)))
                           for source in sources]

                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError('File not found')
def get_media_url(url, media_id):
    headers = {'User-Agent': common.RAND_UA}
    html = net.http_GET(url, headers=headers).content
    
    if html:
        html = html.encode('utf-8')
        aa_text = re.findall("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?)</SCRIPT>""", html, re.I)
        if aa_text:
            try:
                aa_decoded = ''
                for i in aa_text:
                    try: aa_decoded += str(aadecode.decode(re.sub('\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i)))
                    except: pass
                href = re.search("""\.location\s*=\s*['"]\/([^"']+)""", aa_decoded)
                if href:
                    href = href.group(1)
                    if href.startswith("http"): location = href
                    elif href.startswith("//"): location = "http:%s" % href
                    else: location = "http://www.speedvid.net/%s" % href
                    headers.update({'Referer': url, 'Cookie': str((int(math.floor((900-100)*random())+100))*(int(time.time()))*(128/8))})
                    _html = net.http_GET(location, headers=headers).content
                    sources = helpers.scrape_sources(_html, patterns=['''file\s*:\s*.["'](?P<url>(?=http://s(?:02|06))[^"']+)'''])
                    if sources:
                        del headers['Cookie']
                        headers.update({'Referer': location})
                        return helpers.pick_source(sources) + helpers.append_headers(headers)
            except Exception as e:
                raise ResolverError(e)
        
    raise ResolverError('File not found')
예제 #11
0
def get_media_url(url, media_id):
    headers = {'User-Agent': common.RAND_UA}
    html = net.http_GET(url, headers=headers).content
    
    if html:
        html = html.encode('utf-8')
        aa_text = re.findall("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?)</SCRIPT>""", html, re.I)
        if aa_text:
            try:
                aa_decoded = ''
                for i in aa_text:
                    try: aa_decoded += str(aadecode.decode(re.sub('\(+゚Д゚\)+\s*\[゚o゚\]\)*\s*\+(.+?)\(+゚Д゚\s*\)+\[゚o゚\]\)+', r'(゚Д゚)[゚o゚]+\1(゚Д゚)[゚o゚])', i)))
                    except: pass
                href = re.search("""\.location\s*=\s*['"]\/([^"']+)""", aa_decoded)
                if href:
                    href = href.group(1)
                    if href.startswith("http"): location = href
                    elif href.startswith("//"): location = "http:%s" % href
                    else: location = "http://www.speedvid.net/%s" % href
                    headers.update({'Referer': url, 'Cookie': str((int(math.floor((900-100)*random())+100))*(int(time.time()))*(128/8))})
                    _html = net.http_GET(location, headers=headers).content
                    sources = helpers.scrape_sources(_html, patterns=['''file\s*:\s*.["'](?P<url>(?=http://s(?:02|06))[^"']+)'''])
                    if sources:
                        del headers['Cookie']
                        headers.update({'Referer': location})
                        return helpers.pick_source(sources) + helpers.append_headers(headers)
            except Exception as e:
                raise ResolverError(e)
        
    raise ResolverError('File not found')
예제 #12
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': self.UA}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            url = re.search('''url:\s*["']([^"']+)''', html)
            token = re.search(
                '''<meta name=["']csrf-token["'] content=["']([^"']+)''', html)
            if url and token:
                url = web_url + url.group(1)
                token = token.group(1)
                headers.update({
                    'Referer': web_url,
                    'x-csrf-token': token,
                    'x-requested-with': 'XMLHttpRequest',
                    'authority': host
                })
                _html = self.net.http_POST(url,
                                           form_data={
                                               'type': 'directLink'
                                           },
                                           headers=headers).content
                if _html:
                    sources = helpers.scrape_sources(_html)
                    if sources:
                        return helpers.pick_source(
                            sources) + helpers.append_headers(
                                {'User-Agent': self.UA})

        raise ResolverError('Unable to locate video')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get(
            'Set-Cookie', '')
        html = self.net.http_POST(web_url, headers=headers,
                                  form_data=data).content

        packed = re.findall('(eval\(function.*?)\s*</script>', html, re.DOTALL)
        if packed:

            js = ''
            for pack in packed:
                js += jsunpack.unpack(pack)

            sources = helpers.scrape_sources(
                js,
                patterns=['''(?P<url>[^"']+\.(?:m3u8|mp4))'''],
                result_blacklist='tmp')

            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError('Unable to locate video')
예제 #14
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content

        if 'Not Found' in html:
            raise ResolverError('File Removed')

        if 'Video is processing' in html:
            raise ResolverError('File still being processed')

        packed = re.search("JuicyCodes\.Run\((.+?)\)", html, re.I)
        if packed:
            from base64 import b64decode
            packed = packed.group(1).replace('"', '').replace('+', '')
            packed = b64decode(packed)
            html += '%s</script>' % packed.strip()

        sources = helpers.scrape_sources(html)
        if sources:
            headers.update({'Referer': web_url, 'Range': 'bytes=0-'})
            return helpers.pick_source(sources) + helpers.append_headers(
                headers)

        raise ResolverError('Video not found')
예제 #15
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     html = html.encode("utf-8")
     
     sources = helpers.scrape_sources(html, patterns=['''file:\s*["'](?P<url>(?!rtmp://)[^"']+)'''])
     if sources:
         i = 0
         headers.update({'Referer': web_url})
         for source in sources:
             try:
                 src = urlparse.urlparse(source[1])
                 l = list(src)
                 b = l[2].split("/")[1:]
                 b[0] = self.decrypt(b[0], 'streamplayembedf')
                 l[2] = "/".join(b)
                 sources[i] = (source[0], urlparse.urlunparse(l))
                 i += 1
             except:
                 i += 1
             
         return helpers.pick_source(sources) + helpers.append_headers(headers)
     
     raise ResolverError('File not found')
예제 #16
0
def get_media_url(url, media_id):
    headers = {'User-Agent': common.RAND_UA}
    html = net.http_GET(url, headers=headers).content

    if html:
        html = html.encode('utf-8')
        aa_text = re.search(
            """(゚ω゚ノ=\s*/`m´)ノ\s*~┻━┻\s*//\*´∇`\*/\s*\['_'\];\s*o=\(゚ー゚\)\s*=_=3;.+?)</SCRIPT>""",
            html, re.I)
        if aa_text:
            try:
                aa_decoded = aa_decoder.AADecoder(
                    re.sub('\(+゚Д゚\)+\[゚o゚\]\)*\+\s*', '(゚Д゚)[゚o゚]+ ',
                           aa_text.group(1))).decode()
                href = re.search("""href\s*=\s*['"]([^"']+)""", aa_decoded)
                if href:
                    href = href.group(1)
                    if href.startswith("http"): location = href
                    elif href.startswith("//"): location = "http:%s" % href
                    else: location = "http://www.speedvid.net/%s" % href
                    headers.update({'Referer': url})
                    _html = net.http_GET(location, headers=headers).content
                    sources = helpers.scrape_sources(
                        _html,
                        patterns=[
                            '''file:["'](?P<url>(?!http://s(?:13|35|51|57|58|59))[^"']+)'''
                        ])
                    if sources:
                        headers.update({'Referer': location})
                        return helpers.pick_source(
                            sources) + helpers.append_headers(headers)
            except:
                pass

    raise ResolverError('File not found')
예제 #17
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         file_id = re.search("file_id',\s*'([^']+)",html)
         if file_id:
             headers.update({'cookie': 'lang=1; file_id={}'.format(file_id.group(1))})
             html = self.net.http_GET(web_url, headers=headers).content
         else:
             html = None
     
     if html:
         html = html.encode('utf-8')
         aa_text = re.search("""(゚ω゚ノ\s*=\s*/`m´\s*)\s*ノ.+?;)\svar""", html, re.I)
         if aa_text:
             try:
                 aa_decoded = str(aadecode.decode(aa_text.group(1)))
             except:
                 raise ResolverError('Error decoding')
             
             sources = helpers.scrape_sources(aa_decoded)
             if sources:
                 headers.update({'Referer': web_url})
                 return helpers.pick_source(sources) + helpers.append_headers(headers)
     
     raise ResolverError('Video not found')
예제 #18
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content

        sources = helpers.scrape_sources(
            html, patterns=['''file:\s*["'](?P<url>(?!rtmp://)[^"']+)'''])
        data = re.findall("""_[^=]+=\[([^\]]+)\];""", html, re.DOTALL)
        if sources and data:
            data = data[2].replace('\\x', '').split(",")
            data = [
                x.replace('"', '').replace(' ', '').decode("hex") for x in data
            ]
            key = "".join(data[7:9])
            if key.startswith("embed"):
                key = key[6:] + key[:6]
            i = 0
            headers.update({'Referer': web_url})
            for source in sources:
                try:
                    src = urlparse.urlparse(source[1])
                    l = list(src)
                    b = l[2].split("/")[1:]
                    b[0] = self.decrypt(b[0], key)
                    l[2] = "/".join(b)
                    sources[i] = (source[0], urlparse.urlunparse(l))
                    i += 1
                except:
                    i += 1

            return helpers.pick_source(sources) + helpers.append_headers(
                headers)

        raise ResolverError('File not found')
예제 #19
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.scrape_sources(html)
     if sources:
         return helpers.pick_source(helpers.sort_sources_list(sources)) + helpers.append_headers(headers)
     raise ResolverError('Video not found')
예제 #20
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.scrape_sources(html, patterns=[r'''file:"(?P<url>[^"]+)",label:"(?P<label>[^"]+)'''], generic_patterns=False)
        if sources:
            return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Video cannot be located.')
예제 #21
0
    def get_media_url(self, host, media_id):

        web_url = self.get_url(host, media_id)
        response = self.net.http_GET(web_url)

        sources = helpers.scrape_sources(
            response.content, patterns=[r'''source src=['"](?P<url>https.+?\.mp4)['"] type="video/mp4''']
        )

        return helpers.pick_source(sources)
예제 #22
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.IE_USER_AGENT, 'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content
        try: sources = re.search(r'sources\s*:\s*\[(.+?)\]', html).groups()[0]
        except: print 'errormsg=Unable to locate link'

        if sources:
            sources = helpers.scrape_sources(sources, patterns=['''["'](?P<url>http[^"']+)'''])
            if sources: print helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #23
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     data = helpers.get_hidden(html)
     headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
     html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
     sources = helpers.scrape_sources(html)
     return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #24
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        if html:
            sources = helpers.scrape_sources(html, patterns=['''sources:[^"]+"(?P<url>[^"]+)'''], generic_patterns=False)
            if sources:
                source = helpers.pick_source(sources)
                return source

        raise ResolverError('File not found')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        try: html = base64.b64decode(re.search('atob\(\'(.+?)\'', html).group(1))
        except: pass

        source_list = helpers.scrape_sources(html)
        source = helpers.pick_source(source_list)
        return source
예제 #26
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content
        if 'File not found, sorry!' not in html:
            sources = helpers.scrape_sources(html)
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError("Video not found")
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content

        if 'vidError' in html:
            raise ResolverError('File Not Found or removed')

        sources = helpers.scrape_sources(html)
        return helpers.pick_source(sources)
예제 #28
0
파일: hxload.py 프로젝트: 17Q/modules4all
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA, 'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        sources = helpers.scrape_sources(html)
        if sources:
            return helpers.pick_source(sources) + helpers.append_headers(
                headers)

        raise ResolverError('Video cannot be located.')
예제 #29
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content

        if 'vidError' in html:
            raise ResolverError('File Not Found or removed')

        sources = helpers.scrape_sources(html)
        return helpers.pick_source(sources)
예제 #30
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
     sources = helpers.scrape_sources(html, result_blacklist=['dl', '.mp4'])  # mp4 fails
     source = helpers.pick_source(sources)
     if '.smil' in source:
         smil = self.net.http_GET(source, headers=headers).content
         sources = helpers.parse_smil_source_list(smil)
         return helpers.pick_source(sources) + helpers.append_headers(headers)
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.IE_USER_AGENT, 'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        iframe = re.findall('<iframe\s+src\s*=\s*"([^"]+)', html, re.DOTALL)[0]
        if iframe:
            html = self.net.http_GET(iframe, headers=headers).content

        html = helpers.add_packed_data(html)
        sources = helpers.scrape_sources(html, result_blacklist=['dl'])
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #32
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            sources = helpers.scrape_sources(html)
            if sources:
                headers.update({'Referer': web_url, 'Range': 'bytes=0-'})
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Video not found')
예제 #33
0
    def get_media_url(self, host, media_id):

        web_url = self.get_url(host, media_id)
        response = self.net.http_GET(web_url, headers=self.headers)

        sources = helpers.scrape_sources(
            response.content, patterns=[r'''source src=['"](?P<url>https.+?\.mp4)['"] type=['"]video/mp4['"]''']
        )

        self.headers.update({'Referer': web_url})

        return helpers.pick_source(sources) + helpers.append_headers(self.headers)
예제 #34
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.scrape_sources(html)
        if not sources:
            match = re.search('''href="([^"]+)[^>]+>\(download\)''', html, re.DOTALL)
            if match:
                sources = [('Download', match.group(1))]

        headers['Referer'] = web_url
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #35
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www1.putlockertv.se/'}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            sources = helpers.scrape_sources(html)
            if sources:
                headers.update({'Referer': web_url})
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError("Unable to locate video")
예제 #36
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.CHROME_USER_AGENT, 'Referer': 'https://vidcloud.co/embed/%s' % media_id}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            sources = helpers.scrape_sources(html.replace("\\n", "").replace("\\", ""), patterns=[
                '''src":\s*"(?P<url>[^"]+)(?:[^}>\]]+)label":\s*"(?P<label>[^"]+)'''], generic_patterns=False)
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError("Unable to locate video")
예제 #37
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www1.putlockertv.se/'}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            sources = helpers.scrape_sources(html)
            if sources:
                headers.update({'Referer': web_url})
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError("Unable to locate video")
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.IE_USER_AGENT, 'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content
        try: sources = re.search(r'sources\s*:\s*\[(.+?)\]', html).groups()[0]
        except: raise ResolverError('Unable to locate link')

        if sources:
            sources = helpers.scrape_sources(sources, patterns=['''["'](?P<url>http[^"']+)'''])
            if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
            
        raise ResolverError('Unable to locate link')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT}

        html = self.net.http_GET(web_url, headers=headers).content
        pages = re.findall('href="([^"]+)[^>]+class="mainPlayerQualityHref"[^>]+>(.*?)</a>', html)
        if pages:
            try: pages.sort(key=lambda x: int(x[1][:-1]), reverse=True)
            except: pass
            html = self.net.http_GET('https://www.trt.pl' + pages[0][0], headers=headers).content
        
        sources = helpers.scrape_sources(html, scheme='https')
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #40
0
파일: vidcloud.py 프로젝트: Kepler-22/_zips
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.CHROME_USER_AGENT, 'Referer': 'https://vidcloud.co/embed/%s' % media_id}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            sources = helpers.scrape_sources(html.replace("\\n", "").replace("\\", ""), patterns=[
                '''file":\s*"(?P<url>[^"]+)''', '''src":\s*"(?P<url>[^"]+)(?:[^}>\]]+)label":\s*"(?P<label>[^"]+)'''],
                                             generic_patterns=False)
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError("Unable to locate video")
예제 #41
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        if 'Not Found' in html:
            raise ResolverError('File Removed')

        if 'Video is processing' in html:
            raise ResolverError('File still being processed')

        sources = helpers.scrape_sources(html)
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #42
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        sources = re.findall('''{file:"(.*?)",label:"(.*?)"}''', html)
        if sources:
            print "S",sources[-1][0].replace('\\','')
            return sources[-1][0].replace('\\','')
        sources = helpers.scrape_sources(html)
        print sources

        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #43
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.IE_USER_AGENT,
                   'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        iframe = re.findall('<iframe\s+src\s*=\s*"([^"]+)', html, re.DOTALL)[0]
        if iframe:
            html = self.net.http_GET(iframe, headers=headers).content

        html = helpers.add_packed_data(html)
        sources = helpers.scrape_sources(html, result_blacklist=['dl'])
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #44
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        sources = re.findall('''{file:"(.*?)",label:"(.*?)"}''', html)
        if sources:
            print "S", sources[-1][0].replace('\\', '')
            return sources[-1][0].replace('\\', '')
        sources = helpers.scrape_sources(html)
        print sources

        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #45
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        try:
            html = base64.b64decode(
                re.search('atob\(\'(.+?)\'', html).group(1))
        except:
            pass

        source_list = helpers.scrape_sources(html)
        source = helpers.pick_source(source_list)
        return source
예제 #46
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     if 'Not available' not in html:
         if 'sources: [' not in html:
             data = helpers.get_hidden(html)
             headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
             html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
         sources = helpers.scrape_sources(html)
         return helpers.pick_source(sources) + helpers.append_headers({'User-Agent': common.FF_USER_AGENT})
     else:
         raise ResolverError('File Not Found or removed')
예제 #47
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            _srcs = re.search(r'sources\s*:\s*\[(.+?)\]', html)
            if _srcs:
                srcs = helpers.scrape_sources(_srcs.group(1), patterns=['''["'](?P<url>http[^"']+)'''],
                                              result_blacklist=['.m3u8'])
                if srcs:
                    return helpers.pick_source(srcs) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate link')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     data = helpers.get_hidden(html)
     headers.update({'Referer': web_url})
     html = self.net.http_POST(web_url, headers=headers, form_data=data).content
     
     if html:
         sources = helpers.scrape_sources(html, patterns=['''file:["'](?P<url>[^"']+)'''], result_blacklist=['dl', '.smil'])
     
         return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('File not found')
예제 #49
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA, 'Referer': web_url.replace("iframe-", "preview-")}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            splice = re.search("\['splice'\]\(0x([0-9a-fA-F]*),0x([0-9a-fA-F]*)\);", html)
            sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*["'](?P<url>http[^"']+\.mp4)["']'''])
            if sources and splice:
                headers.update({'Referer': web_url})
                sources = [(source[0], self.decode_video_url(source[1], int(splice.group(1), 16), int(splice.group(2), 16))) for source in sources]

                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('File not found')
예제 #50
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA, 'Referer': web_url.replace('/player-', '/preview-')}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            var = re.search('var _0x[0-f]+=\[([^;]+)\];', html)
            sources = helpers.scrape_sources(html, patterns=['''(?P<url>http[^,]+\.(?:mp4|m3u8))'''])
            if sources and var:
                headers.update({'Referer': web_url})
                sources = [(source[0], S(var.group(1)).decode(source[1])) for source in sources]

                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('File not found')
예제 #51
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        if re.search('>(File Not Found)<', html):
            raise ResolverError('File Not Found or removed')

        data = {}
        for i in re.finditer('<input.*?name="(.*?)".*?value="(.*?)">', html):
            data[i.group(1)] = i.group(2).replace("download1", "download2")
        headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
        html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
        sources = helpers.scrape_sources(html)
        return helpers.pick_source(sources) + helpers.append_headers(headers)
예제 #52
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA,
                   'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        r = re.search('JuicyCodes\.Run\("([^)]+)"\)', html)
        
        if r:
            jc = r.group(1).replace('"+"', '').decode('base64')
            jc = jsunpack.unpack(jc)
            sources = helpers.scrape_sources(jc)
            headers.update({'Range': 'bytes=0-'})
            return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Video cannot be located.')
예제 #53
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        if 'Not Found' in html:
            raise ResolverError('File Removed')

        if 'Video is processing' in html:
            raise ResolverError('File still being processed')

        sources = helpers.scrape_sources(html, patterns=[',\s*src\s*:\s*"(?P<url>[^"]+)'])
        strurl = helpers.pick_source(sources)
        if 'dailymotion.com' in strurl:
            strurl = 'plugin://plugin.video.f4mTester/?streamtype=HLS&url=' + strurl
        return strurl
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
        html = self.net.http_POST(web_url, headers=headers, form_data=data).content

        if html:
            packed = helpers.get_packed_data(html)

            sources = helpers.scrape_sources(packed, result_blacklist=['tmp'])
            if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate video')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'Referer': web_url}
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.scrape_sources(html, patterns=["""file:\s*["'](?P<url>[^"']+)"""])
     if sources:
         auth = self.__check_auth(media_id)
         if not auth:
             auth = self.__auth_ip(media_id)
             
         if auth:
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         else:
             raise ResolverError(i18n('no_ip_authorization'))
     else:
         raise ResolverError('Unable to locate links')
예제 #56
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     packed = helpers.get_packed_data(html)
     
     try:
         sources = re.search("""sources:\s*\["(.+?)"\]""", packed).group(1).split('","')
         sources = [(urlparse(sources[i]).path.split('/')[-1], sources[i]) for i in range(len(sources))]
     except:
         sources = helpers.scrape_sources(html, patterns=["""sources:\s*\[["'](?P<url>[^"']+)"""])
     
     if sources:
         headers.update({'Referer': web_url})
         return helpers.pick_source(sources) + helpers.append_headers(headers)
     
     raise ResolverError('File not found')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     cookie = response.get_headers(as_dict=True).get('Set-Cookie', '')
     if cookie:
         headers.update({'Cookie': cookie})
     html = response.content
     
     if html:
         data = helpers.get_hidden(html)
         if not "method_free" in data: data.update({'method_free': 'Submit Query'})
         _html = self.net.http_POST(web_url, headers=headers, form_data=data).content
         if _html:
             sources = helpers.scrape_sources(_html, patterns=['''file:\s*["'](?P<url>[^"']+)'''])
             if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
             
     raise ResolverError("Video not found")