Exemplo n.º 1
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:
            try:
                packed = helpers.get_packed_data(html)
                i = 0  #just incase of infinite loop
                while jsunpack.detect(packed) and i < 5:
                    i += 1
                    try:
                        packed = jsunpack.unpack(packed)
                    except:
                        break

                location_href = re.search(
                    """document\.location\.href\s*=\s*["']([^"']+)""",
                    packed).groups()[0]
                location_href = 'http:%s' % location_href if location_href.startswith(
                    "//") else location_href

                return helpers.get_media_url(
                    location_href,
                    patterns=['''file:["'](?P<url>(?!http://s13)[^"']+)'''
                              ]).replace(' ', '%20')

            except Exception as e:
                raise ResolverError(e)

        raise ResolverError('File not found')
Exemplo n.º 2
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             '''\[(?P<label>[0-9p]+)\](?P<url>https://www.getvi.tv/(?:[^'",]+).mp4/)'''
         ],
         generic_patterns=False).replace(' ', '%20')
def get_media_url(url):
    return helpers.get_media_url(
        url,
        patterns=[
            '''var [a-z0-9]file[a-z0-9]=\s*["'](?P<url>//[^"']+\.(?:mp4|m3u8)\?[^"']+)'''
        ],
        generic_patterns=False).replace(' ', '%20')
Exemplo n.º 4
0
def get_media_url(url):
    return helpers.get_media_url(
        url,
        patterns=[
            '''var sfile.+?=\s*["'](?P<url>http[^"']+\.(?:mp4|m3u8)\?[^"']+)'''
        ],
        generic_patterns=False).replace(' ', '%20')
Exemplo n.º 5
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:
            try:
                json_data = re.search("""__AS_INITIAL_DATA__\s*=\s*({.*?});""",
                                      html).groups()[0]
                json_data = json_data.replace("\/", "/")
                a = json.loads(json_data)
                ep_id = a["show"]["sluggedVideo"]["id"]
                api_url = 'http://www.adultswim.com/videos/api/v0/assets?platform=desktop&id=%s&phds=true' % ep_id

                return helpers.get_media_url(
                    api_url,
                    patterns=[
                        """<file .*?type="(?P<label>[^"]+).+?>(?P<url>[^<\s]+)"""
                    ],
                    result_blacklist=[".f4m"]).replace(' ', '%20')

            except Exception as e:
                raise ResolverError(e)

        raise ResolverError('Video not found')
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             '''<a\s+id=\"downloadLink(?:[0-9]+)\"\s+href=\"(?P<url>https://[^\.\"']+\.gofile\.io/download/(?:[^\"']+))\"\s+download'''
         ],
         generic_patterns=False).replace(' ', '%20')
Exemplo n.º 7
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             '''dimension":\s*"(?P<label>[\d]{3,4}p?)".+?"url":\s*"(?P<url>[^"]+)'''
         ],
         generic_patterns=False).replace(' ', '%20')
Exemplo n.º 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:
            try:
                packed = helpers.get_packed_data(html)
                packed = re.search(
                    """(eval\s*\(function.*?\|location\|.*?\)\))""",
                    packed).groups()[0]
                packed = jsunpack.unpack(packed)
                location_href = re.search(
                    """document\.location\.href\s*=\s*["']([^"']+)""",
                    packed).groups()[0]
                location_href = 'http:%s' % location_href if location_href.startswith(
                    "//") else location_href

                return helpers.get_media_url(
                    location_href,
                    patterns=['''file:["'](?P<url>(?!http://s13)[^"']+)'''
                              ]).replace(' ', '%20')

            except:
                raise ResolverError('File not found')

        raise ResolverError('File not found')
 def get_media_url(self, host, media_id):
     """
     source scraping to get resolved uri goes here
     return |str| : resolved/playable uri or raise ResolverError
     ___
     helpers.get_media_url result_blacklist: |list of str| : list of strings to blacklist in source results
     """
     return helpers.get_media_url(self.get_url(host, media_id), result_blacklist=None)
Exemplo n.º 10
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             '''"media_urls":\s*{"(?P<label>[^"]+)":\s*"(?P<url>.+?/%s\?[^"]+)'''
             % media_id
         ],
         generic_patterns=False).replace(' ', '%20')
Exemplo n.º 11
0
def get_media_url(url):
    return helpers.get_media_url(
        url,
        patterns=[
            '''=["'](?P<url>http://[^'".]+.thevid.net/v/[^'".]+.mp4?[^'".]+)[^'"]'''
        ],
        result_blacklist=['logger', 'iframe', 'c.mp4', 'z.mp4', 'abc.mp4'],
        generic_patterns=False).replace(' ', '%20')
Exemplo n.º 12
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             r'''file:\s*"(?P<url>[^"]+)",\s*label:\s*"(?P<label>[^"]+)'''
         ],
         generic_patterns=False,
         result_blacklist=['.m3u8'])
Exemplo n.º 13
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url('exashare.com', media_id)
        html = self.net.http_GET(web_url).content

        try: web_url = re.search('src="([^"]+)', html).group(1)
        except: raise ResolverError('Unable to locate link')

        return helpers.get_media_url(web_url)
Exemplo n.º 14
0
 def get_media_url(self, host, media_id):
     """
     source scraping to get resolved uri goes here
     return |str| : resolved/playable uri or raise ResolverError
     ___
     helpers.get_media_url result_blacklist: |list of str| : list of strings to blacklist in source results
     """
     return helpers.get_media_url(self.get_url(host, media_id)).replace(' ', '%20')
Exemplo n.º 15
0
    def get_media_url(self, host, media_id):
        result = self.__check_auth(media_id)
        if not result:
            result = self.__auth_ip(media_id)

        if result:
            return helpers.get_media_url(result, patterns=['''src:\s*["'](?P<url>[^"']+).+?res:\s*(?P<label>\d+)'''], result_blacklist=["trailer"], generic_patterns=False).replace(' ', '%20')

        raise ResolverError(i18n('no_ip_authorization'))
Exemplo n.º 16
0
    def get_media_url(self, host, media_id):
        result = self.__check_auth(media_id)
        if not result:
            result = self.__auth_ip(media_id)

        if result:
            return helpers.get_media_url(result, patterns=['''src:\s*["'](?P<url>[^"']+).+?res:\s*(?P<label>\d+)'''], result_blacklist=["trailer"], generic_patterns=False).replace(' ', '%20')

        raise ResolverError(i18n('no_ip_authorization'))
    def get_media_url(self, host, media_id):
        web_url = self.get_url('exashare.com', media_id)
        html = self.net.http_GET(web_url).content

        try:
            web_url = re.search('src="([^"]+)', html).group(1)
        except:
            raise ResolverError('Unable to locate link')

        return helpers.get_media_url(web_url)
Exemplo n.º 18
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:
            return helpers.get_media_url(iframe, result_blacklist=['dl', 'm3u8'])
        
        else:
            raise ResolverError('File Not Found or removed')
Exemplo n.º 19
0
 def get_media_url(self, host, media_id):
     try:
         web_url = self.get_stream_url(host, media_id)
         stream_url = helpers.get_media_url(web_url)
     except:
         stream_url = None
         
     if not stream_url:
         stream_url = self.__box_url(host, media_id)
         
     if stream_url:
         return stream_url
     else:
         raise ResolverError('File not found')
    def get_media_url(self, host, media_id):
        url = helpers.get_media_url(self.get_url(host, media_id), result_blacklist=['intro_black']).replace(' ', '%20')
        net = common.Net()
        headers = {}

        if '|' in url:
            qs_header_split = url.split('|')
            url = qs_header_split[0]

            headers = urlparse.parse_qs(qs_header_split[1])
            headers = dict((k, v[0]) for k, v in headers.iteritems())

        response = net.http_HEAD(url, headers=headers)
        if(response.get_url()):
            return response.get_url() + helpers.append_headers(headers)
        else:
            raise ResolverError(common.i18n('no_video_link'))
Exemplo n.º 21
0
def get_media_url(url, media_id):
    headers = {'User-Agent': common.RAND_UA}
    html = net.http_GET(url, headers=headers).content

    if html:
        packed = re.search(
            """\|href\|(\d+)\|html\|location\|(\d+)\|%s\|window\|sp""" %
            media_id, html)
        if packed:
            location_href = "http://www.speedvid.net/sp-%s-%s-%s.html" % (
                media_id, packed.group(1), packed.group(2))

            return helpers.get_media_url(
                location_href,
                patterns=['''file:["'](?P<url>(?!http://s(?:13|57))[^"']+)'''
                          ]).replace(' ', '%20')

    raise ResolverError('File not found')
Exemplo n.º 22
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:
         try:
             json_data = re.search("""__AS_INITIAL_DATA__\s*=\s*({.*?});""", html).groups()[0]
             json_data = json_data.replace("\/", "/")
             a = json.loads(json_data)
             ep_id = a["show"]["sluggedVideo"]["id"]
             api_url = 'http://www.adultswim.com/videos/api/v0/assets?platform=desktop&id=%s&phds=true' % ep_id
             
             return helpers.get_media_url(api_url, patterns=["""<file .*?type="(?P<label>[^"]+).+?>(?P<url>[^<\s]+)"""], result_blacklist=[".f4m"]).replace(' ', '%20')
             
         except Exception as e:
             raise ResolverError(e)
             
     raise ResolverError('Video not found')
Exemplo n.º 23
0
    def get_media_url(self, host, media_id):
        url = helpers.get_media_url(self.get_url(host, media_id),
                                    result_blacklist=['intro_black'
                                                      ]).replace(' ', '%20')
        net = common.Net()
        headers = {}

        if '|' in url:
            qs_header_split = url.split('|')
            url = qs_header_split[0]

            headers = urlparse.parse_qs(qs_header_split[1])
            headers = dict((k, v[0]) for k, v in headers.iteritems())

        response = net.http_HEAD(url, headers=headers)
        if (response.get_url()):
            return response.get_url() + helpers.append_headers(headers)
        else:
            raise ResolverError(common.i18n('no_video_link'))
Exemplo n.º 24
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        response = self.net.http_GET(web_url)
        html = response.content
        file_id = re.findall("'file_id', '(\d+)',", html)[0]
        headers = {'X-Requested-With': "XMLHttpRequest", 'Referer': web_url}

        if html:
            video_url = None
            js = html

            packed = re.search('(eval\(function.*?)\s*</script>', html, re.DOTALL)
            if packed:
                js1 = jsunpack.unpack(packed.group(1))
            else:
                js1 = html

            video_url = None

            link = re.search("(/dl\?op=view&file_code=[^']+)", js1)
            if link:
                #$.cookie('file_id', '1675923', {expires: 10});

                headers['Cookie'] = {'file_id':file_id}
                response = self.net.http_GET('https://%s%s'% (host,link.group(1)) , headers=headers).content

                common.log_utils.log_debug('to Link Found: %s' % video_url)
            headers = {'Referer': web_url}

            if video_url == None:
                link = re.search('(http[^"]*.mp4)', js)
                if link:
                    video_url = link.group(1)
                    common.log_utils.log_debug('watchers.to Link Found: %s' % video_url)

            if video_url != None:
                return video_url+ helpers.append_headers(headers)
            else:
                raise ResolverError('No playable video found.')


        return helpers.get_media_url(self.get_url(host, media_id)) + helpers.append_headers(headers)
Exemplo n.º 25
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''"media_urls":\s*{"(?P<label>[^"]+)":\s*"(?P<url>.+?/%s\?[^"]+)''' % media_id], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 26
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''["']?\s*(?:file|src)\s*["']?\s*[:=,]?\s*["'](?P<url>[^"']+)(?:[^}>\]]+)["']?\s*res\s*["']?\s*[:=]\s*["']?(?P<label>[^"',]+)'''], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 27
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=['''file:["'](?P<url>(?!http://s13)[^"']+)'''
                   ]).replace(' ', '%20')
Exemplo n.º 28
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id),
                                  patterns=[r'''src:\s*"(?P<url>[^"]+)'''],
                                  generic_patterns=False)
Exemplo n.º 29
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id)).replace(' ', '%20')
Exemplo n.º 30
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=[
             '''["']?(?:file|url)["']?\s*[:=]\s*["'](?P<url>[^"']+)'''
         ]).replace(' ', '%20')
Exemplo n.º 31
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id))
Exemplo n.º 32
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id),
                                  result_blacklist=['dl'])
Exemplo n.º 33
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=['''(?:hls|mp4)\s*:\s*\[?['"](?P<url>[^'"]+)'''
                   ]).replace(' ', '%20')
Exemplo n.º 34
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(
         self.get_url(host, media_id),
         patterns=['''file\s*:\s*["'](?P<url>[^"']+)'''],
         generic_patterns=False,
         result_blacklist=['dl']).replace(' ', '%20')
Exemplo n.º 35
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id)).replace(" ", "%20")
Exemplo n.º 36
0
 def get_media_url(self, host, media_id):
     web_url = self.net.http_HEAD(self.get_url(host, media_id)).get_url()
     return helpers.get_media_url(web_url, result_blacklist=None)
Exemplo n.º 37
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''<a\s+id=\"downloadLink(?:[0-9]+)\"\s+href=\"(?P<url>https://[^\.\"']+\.gofile\.io/download/(?:[^\"']+))\"\s+download'''], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 38
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id),
                                  patterns=['''dimension":\s*"(?P<label>[\d]{3,4}p?)".+?"url":\s*"(?P<url>[^"]+)'''],
                                  generic_patterns=False).replace(' ', '%20')
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id),patterns=['''\[(?P<label>[0-9p]+)\](?P<url>https://www.getvi.tv/(?:[^'",]+).mp4/)'''], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 40
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['src:"(?P<url>[^"]+)"[^}]+height:(?P<label>\d+)'])
Exemplo n.º 41
0
def get_media_url(url):
    return helpers.get_media_url(url, patterns=['''var l[a-zA-Z0-9]+=\s*["'](?P<url>//[^"']+\.(?:mp4|m3u8)\?[^"']+)'''], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 42
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''["']?(?:file|url)["']?\s*[:=]\s*["'](?P<url>[^"']+)''']).replace(' ', '%20')
Exemplo n.º 43
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''(?:hls|mp4)\s*:\s*\[?['"](?P<url>[^'"]+)''']).replace(' ', '%20')
Exemplo n.º 44
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), result_blacklist=['intro_black']).replace(' ', '%20')
Exemplo n.º 45
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), result_blacklist=['dl']).replace('\/', '/')
Exemplo n.º 46
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id),
                                  result_blacklist=['.m3u8'
                                                    ]).replace(' ', '%20')
Exemplo n.º 47
0
 def get_media_url(self, host, media_id):
     direct_url = 'http://%s/%s' % (host, media_id)
     for web_url in [self.get_url(host, media_id), direct_url]:
         return helpers.get_media_url(web_url)
Exemplo n.º 48
0
def get_media_url(url):
    return helpers.get_media_url(url, patterns=['''var sfile.+?=\s*["'](?P<url>http[^"']+\.(?:mp4|m3u8)\?[^"']+)'''], generic_patterns=False).replace(' ', '%20')
Exemplo n.º 49
0
 def get_media_url(self, host, media_id):
     print helpers.get_media_url(self.get_url(host, media_id))
Exemplo n.º 50
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id))
Exemplo n.º 51
0
def get_media_url(url):
    return helpers.get_media_url(url, patterns=['''v?ur?l\w+\s*=\s*["'](?P<url>[^"']+)'''], result_blacklist=['rick', 'logger', 'iframe', 'r.mp4', 'a.mp4']).replace(' ', '%20')
Exemplo n.º 52
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=['''file:\s*['"](?P<url>[^'"]+)''']).replace(' ', '%20')
Exemplo n.º 53
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), patterns=[r'''sources:\s*[['"]+(?P<url>[^'"]+)'''])
Exemplo n.º 54
0
 def get_media_url(self, host, media_id):
     web_url = self.net.http_HEAD(self.get_url(host, media_id)).get_url()
     return helpers.get_media_url(web_url)
Exemplo n.º 55
0
 def get_media_url(self, host, media_id):
     return helpers.get_media_url(self.get_url(host, media_id), result_blacklist=['error.'])