コード例 #1
0
def find_link(url, html=''):
    log('Finding in : %s' % url)
    try:
        referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except:
        referer = 'http://' + urlparse.urlparse(url).netloc
    host = urlparse.urlparse(url).netloc
    headers = {
        'Referer': referer,
        'Host': host,
        'User-Agent': client.agent(),
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        'Accept-Language': 'en-US,en;q=0.5'
    }

    if html == '' or html is None:
        url = manual_url_fix(url)
        html = client.request(url, headers=headers)
        if 'livetvcdn' in url or 'shadow' in url or 'blog' in url and 'goto/' not in url:
            import requests
            s = requests.Session()
            r = s.get(url, headers=headers)
            html = r.text

    ref = url
    fs = list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval(f + "(html,ref)")
            if resolved:
                log('Resolved with %s: %s' % (f, resolved))
                return resolved
                break
    return
コード例 #2
0
def find_link(url, html=''):
    log('Finding in : %s' % url)
    try:
        referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except:
        referer = 'http://' + urlparse.urlparse(url).netloc
    host = urlparse.urlparse(url).netloc
    headers = {
        'Referer': referer,
        'Host': host,
        'User-Agent': client.agent(),
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        'Accept-Language': 'en-US,en;q=0.5'
    }

    if html == '':
        url = manual_url_fix(url)
        html = client.request(url, headers=headers)
        html = manual_html_fix(url, html, headers)
    ref = url
    fs = list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval(f + "(html,ref)")
            if resolved:
                log('Resolved with %s: %s' % (f, resolved))
                return resolved
                break

    return
コード例 #3
0
def finder4(html, url):
    ref = url
    try:
        try:
            link = re.compile('file\s*:\s*"(.+?)"').findall(html)[0]
        except:
            link = re.compile("file\s*:\s*'(.+?)'").findall(html)[0]
        if '.png' in link or link == '.flv':
            return
        if '.f4m' in link:
            link = link + '?referer=%s' % url
        if '.m3u8' in link and '|' not in link:
            link += '|%s' % urllib.urlencode(
                {
                    'User-Agent': client.agent(),
                    'Referer': ref,
                    'X-Requested-With': constants.get_shockwave(),
                    'Host': urlparse.urlparse(link).netloc,
                    'Connection': 'keep-alive',
                    'Accept': '*/*'
                })

        return link
    except:
        return
コード例 #4
0
ファイル: __init__.py プロジェクト: c0ns0le/YCBuilds
def find_link(url, html=''):
    global limit
    limit+=1
    log('Finding in : %s'%url)
    try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except: referer = 'http://' + urlparse.urlparse(url).netloc
    host  = urlparse.urlparse(url).netloc
    headers = {'Referer':referer, 'Host':host, 'User-Agent' : client.agent(), 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-US,en;q=0.5'}
    
    if html=='':
        url = manual_url_fix(url)
        html = client.request(url, headers=headers)
        html = manual_html_fix(url,html,headers)

    ref=url
    fs=list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval (f+"(html,ref)")
            if resolved:
                log('Resolved with %s: %s'%(f,resolved))
                return resolved
                break


    return
コード例 #5
0
ファイル: __init__.py プロジェクト: c0ns0le/YCBuilds
def finder1(html,url):
    global limit
    ref=url
    try:
        urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")',html)
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0])
        except: pass
        for url in urls:
            if 'c4.zedo' in url:
                continue
            if "micast" in url or 'turbocast' in url:
                return finder47(html,ref)
            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url,ref)
            if limit>=25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri) 
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({'X-Requested-With':'ShockwaveFlash/20.0.0.228', 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'})
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #6
0
def resolve_it(url):
    if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith(
            'plugin://'):
        if '.m3u8' in url and '|' not in url:
            url += '|%s' % urllib.urlencode({'User-Agent': client.agent()})
        return url

    if '.f4m' in url:
        from resolvers import f4m
        resolved = f4m.resolve(url)
        return resolved

    if url.startswith('acestream://') or url.startswith(
            'sop://') or '.acelive' in url:
        from resolvers import sop_ace
        resolved = sop_ace.resolve(url, 'Video')
        return resolved
    netloc = prepare(urlparse.urlparse(url).netloc)
    if netloc in resolver_dict.keys():
        resolver = resolver_dict[netloc]
        log("Calling resolver: " + resolver)
        exec "from resolvers import %s" % resolver
        resolved = eval(resolver + ".resolve(url)")
        return resolved

    else:
        return
コード例 #7
0
ファイル: __init__.py プロジェクト: stick141/modules4all
def resolve_it(url, title='Video',icon='x'):
    if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith('plugin://'):
        if '.m3u8' in url and '|' not in url:
            url += '|%s' % urllib.urlencode({'User-Agent': client.agent()})
        if '.ts' in url:
            url = 'plugin://plugin.video.f4mTester/?name=%s&iconImage=%s&streamtype=TSDOWNLOADER&url='%(urllib.quote(title),urllib.quote(icon)) + urllib.quote(url)
        return url

    if '.f4m' in url:
        from resolvers import f4m
        resolved = f4m.resolve(url)
        return resolved

    if url.startswith('acestream://') or url.startswith('sop://') or '.acelive' in url:
        from resolvers import sop_ace
        resolved = sop_ace.resolve(url, title)
        return resolved
    netloc = prepare(urlparse.urlparse(url).netloc)
    if netloc in resolver_dict.keys():
        resolver = resolver_dict[netloc]
        log("Calling resolver: " + resolver)
        exec "from resolvers import %s"%resolver
        resolved = eval(resolver+".resolve(url)")
        return resolved

    else:
       return 
コード例 #8
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def find_link(url, html=''):
    log('Finding in : %s'%url)
    try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except: referer = 'http://' + urlparse.urlparse(url).netloc
    host  = urlparse.urlparse(url).netloc
    headers = {'Referer':referer, 'Host':host, 'User-Agent' : client.agent(), 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-US,en;q=0.5'}
    
    if html=='' or html is None:
        url = manual_url_fix(url)
        html = client.request(url, headers=headers)
        if 'livetvcdn' in url or 'shadow' in url or 'blog' in url and 'goto/' not in url:
            import requests
            s = requests.Session()
            r = s.get(url,headers=headers)
            html = r.text


    ref=url
    fs=list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval (f+"(html,ref)")
            if resolved:
                log('Resolved with %s: %s'%(f,resolved))
                return resolved
                break
    return
コード例 #9
0
def resolve_it(url, title='Video', icon='x'):
    if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith(
            'plugin://'):
        if '.m3u8' in url and '|' not in url:
            url += '|%s' % urllib.urlencode({'User-Agent': client.agent()})
        if '.ts' in url:
            url = 'plugin://plugin.video.f4mTester/?name=%s&iconImage=%s&streamtype=TSDOWNLOADER&url=' % (
                urllib.quote(title), urllib.quote(icon)) + urllib.quote(url)
        return url

    if '.f4m' in url:
        from resolvers import f4m
        resolved = f4m.resolve(url)
        return resolved

    if url.startswith('acestream://') or url.startswith(
            'sop://') or '.acelive' in url:
        from resolvers import sop_ace
        resolved = sop_ace.resolve(url, title)
        return resolved
    netloc = prepare(urlparse.urlparse(url).netloc)
    if netloc in resolver_dict.keys():
        resolver = resolver_dict[netloc]
        log("Calling resolver: " + resolver)
        exec "from resolvers import %s" % resolver
        resolved = eval(resolver + ".resolve(url)")
        return resolved

    else:
        return
コード例 #10
0
def finder72(html,ref):
    try:
        url = re.findall('src\s*:\s*\'(.+?(?:.m3u8)?)\'',html)[0]
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref})
        return url
    except:
        pass
コード例 #11
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def resolve_it(url, title='Video'):
    if '.m3u8' in url or 'rtmp:' in url or '.flv' in url or '.mp4' in url or '.ts' in url or url.startswith('plugin://'):
        if '.m3u8' in url and '|' not in url:
            url += '|%s' % urllib.urlencode({'User-Agent': client.agent()})
        return url

    if '.f4m' in url:
        from resolvers import f4m
        resolved = f4m.resolve(url)
        return resolved

    if url.startswith('acestream://') or url.startswith('sop://') or '.acelive' in url:
        from resolvers import sop_ace
        resolved = sop_ace.resolve(url, title)
        return resolved
    netloc = prepare(urlparse.urlparse(url).netloc)
    if netloc in resolver_dict.keys():
        resolver = resolver_dict[netloc]
        log("Calling resolver: " + resolver)
        exec "from resolvers import %s"%resolver
        resolved = eval(resolver+".resolve(url)")
        return resolved

    else:
       return 
コード例 #12
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder79(html,url):
    try:
        ref = url
        url = re.findall("playStream\('hls', '(.+?)'",html)[0] 
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(url).netloc, 'Connection':'keep-alive','Accept':'*/*'})
        return url
    except:
        return
コード例 #13
0
def finder73(html,url):
    try:
        ref = url
        url = re.findall('Player\(\{\n\s*source\:\s*\'(.+?)\'\,',html)[0]
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref})
        return url
    except:
        return
コード例 #14
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder72(html,ref):
    try:
        url = re.findall('src\s*:\s*\'(.+?(?:.m3u8)?)\'',html)[0]
        if 'images/' in url:
            return
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref})
        return url
    except:
        pass
コード例 #15
0
ファイル: __init__.py プロジェクト: bialagary/mw
def finder65(html,url):
    try:
        referer = url
        url = re.findall('src=(?:\'|\")(.+?)(?:\'|\").+?type="video/mp4"',html)[0]
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': referer})

        return url
    except:
        return
コード例 #16
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder75(html,url):
    try:
        ref = url
        url = re.findall('file: window.atob\(\'(.+?)\'\),', html)[0]
        file = base64.b64decode(url)
        file += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(file).netloc, 'Connection':'keep-alive','Accept':'*/*'})
        return file
    except:
        return
コード例 #17
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder107(html,ref):
    try:
        m3u8 = re.findall('playlist_url:\s*[\"\']([^\"\']+)',html)[0]
        host = re.findall('cdn_host:\s*[\"\']([^\"\']+)',html)[0]
        url = 'http://' + host + m3u8
        url+='|%s' % urllib.urlencode({'Referer':ref, 'User-agent':client.agent()})
        return url
    except:
        return
コード例 #18
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder73(html,url):
    try:
        ref = url
        url = re.findall('Player\(\{\n\s*source\:\s*[\'\"](.+?)[\'\"]\,',html)[0]
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref})
        if 'ace/manifest' in url:
            url = finder102(html,url)
        return url
    except:
        return
コード例 #19
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder92(html,ref):
    try:
        url = re.findall('src=[\"\']([^\"\']+)[\"\'].+?mpeg',html)[0]
        if 'rtmp' in url:
            url+=' swfUrl=http://www.shadow-net.biz/javascript/videojs/flashls/video-js.swf flashver=%s live=true timeout=18 swfVfy=1 pageUrl=http://www.shadow-net.biz/'%FLASH
        elif 'm3u8' in url:

            url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(url).netloc, 'Connection':'keep-alive','Accept':'*/*', 'Origin':'http://shadow.go.ro'})
        return url
    except:
        return
コード例 #20
0
def finder92(html,ref):
    try:
        url = re.findall('source\s*src=\s*"\s*(.+?)\s*"\s*type=\s*"\s*application/x-mpegURL\s*"\s*/>',html)[0]
        if 'rtmp' in url:
            url+=' swfUrl=http://www.shadow-net.biz/javascript/videojs/flashls/video-js.swf flashver=%s live=true timeout=18 swfVfy=1 pageUrl=http://www.shadow-net.biz/'%FLASH
        elif 'm3u8' in url:

            url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':'ShockwaveFlash/20.0.0.286', 'Host':urlparse.urlparse(url).netloc, 'Connection':'keep-alive','Accept':'*/*', 'Origin':'http://shadow.go.ro'})
        return url
    except:
        return
コード例 #21
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder65(html,url):
    try:
        referer = url
        url = re.findall('src=(?:\'|\")(.+?)(?:\'|\").+?type="video/mp4"',html)[0]
        if len(url)<10:
            raise
        url += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': referer})

        return url
    except:
        return
コード例 #22
0
def finder123(html, ref):
    try:
        url = re.findall('mpegurl.+?src=[\"\']([^\"\']+)[\"\']', html)[0]
        return url + '|%s' % urllib.urlencode(
            {
                'Referer': ref,
                'X-Requested-With': constants.get_shockwave(),
                'User-agent': client.agent()
            })
    except:
        return
コード例 #23
0
def finder73(html, url):
    try:
        ref = url
        url = re.findall('Player\(\{\n\s*source\:\s*\'(.+?)\'\,', html)[0]
        url += '|%s' % urllib.urlencode({
            'User-Agent': client.agent(),
            'Referer': ref
        })
        return url
    except:
        return
コード例 #24
0
ファイル: __init__.py プロジェクト: stick141/modules4all
def finder1(html,url):
    html = html.replace('/adplus/adplus.html?id=','')
    try:html = urllib.unquote(html)
    except:pass
    global limit
    limit+=1
    ref=url
    try:
        urls = re.findall('<i?frame\s*.+?src=(?:\'|\")(.+?)(?:\'|\")',html,flags=re.IGNORECASE)
        urly = client.parseDOM(html, "iframe", ret="src")
        urlc = re.findall('top.location.href\s*=\s*[\'\"](.+?axe-tv[^\'\"]+)[\'\"]',html)
        for url in urlc:
            if 'sky-sports-1' not in url and 'fox1ushd' not in url:
                urls.append(url)
        urls += urly
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0])
        except: pass

        urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]',html)
        urls += re.findall('(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']',html)
        
        from random import shuffle
        for url in urls:
            url = url.replace('https','http')
            if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url:
                continue

            elif "micast" in url or 'turbocast' in url:
                return finder47(html,ref)
                
            elif 'lshstream' in url:
                return finder2(url,url)    

            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url,ref)
            if limit>=25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri) 
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'})
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #25
0
ファイル: __init__.py プロジェクト: bialagary/mw
def find_link(url):
    try:
        referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except:
        referer = 'http://' + urlparse.urlparse(url).netloc
    host = host = urlparse.urlparse(url).netloc
    headers = {
        'Referer': referer,
        'Host': host,
        'User-Agent': client.agent(),
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        'Accept-Language': 'en-US,en;q=0.5'
    }
    try:
        import HTMLParser
        h = HTMLParser.HTMLParser()
        url = h.unescape(url)
    except:
        pass
    html = client.request(url, headers=headers)

    try:
        html = urllib.unquote(html)
    except:
        pass

    try:
        import HTMLParser
        h = HTMLParser.HTMLParser()
        html = h.unescape(html)
    except:
        pass
    if 'livetv.sx' in url:
        import requests
        s = requests.Session()
        s.headers.update(headers)
        html = s.get(url).text
    if '@3C' in html:
        html = html.replace('@', '%')
        html = urllib.unquote(html)
    ref = url
    fs = list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval(f + "(html,ref)")
            if resolved:
                return resolved
                break
    return
コード例 #26
0
ファイル: __init__.py プロジェクト: stick141/modules4all
def finder4(html,url):
    ref = url
    try:
        links = re.compile('file\s*:\s*[\"\']([^\"\']+)[\"\']').findall(html)
        for link in links:
            if '.png' in link or link == '.flv':
                continue
            if '.f4m' in link:
                link = link+'?referer=%s'%url
            if '.m3u8' in link and '|' not in link:
                link += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(link).netloc, 'Connection':'keep-alive','Accept':'*/*'})
            
            return link
    except:
        return 
コード例 #27
0
def finder4(html,url):
    ref = url
    try:
        try:
            link = re.compile('file\s*:\s*"(.+?)"').findall(html)[0]
        except:
            link = re.compile("file\s*:\s*'(.+?)'").findall(html)[0]
        if '.png' in link or link == '.flv':
            return
        if '.f4m' in link:
            link = link+'?referer=%s'%url
        if '.m3u8' in link and '|' not in link:
            link += '|%s' % urllib.urlencode({'User-Agent': client.agent(), 'Referer': ref, 'X-Requested-With':'ShockwaveFlash/20.0.0.228', 'Host':urlparse.urlparse(link).netloc, 'Connection':'keep-alive','Accept':'*/*'})
        
        return link
    except:
        return 
コード例 #28
0
def finder1(html, url):
    global limit
    limit += 1
    ref = url
    try:
        urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")', html)
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0])
        except:
            pass

        urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html)
        urls += re.findall(
            'src=["\'](http://www.hdmyt.info/channel.php\?file=[^"\']+)["\']',
            html)
        from random import shuffle
        for url in urls:
            if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url:
                continue

            if "micast" in url or 'turbocast' in url:
                return finder47(html, ref)

            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url, ref)
            if limit >= 25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri)
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({
                'X-Requested-With': constants.get_shockwave(),
                'Host': urlparse.urlparse(resolved).netloc,
                'Connection': 'keep-alive'
            })
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #29
0
def finder117(html, ref):
    if 'zunox' in ref:
        url = 'http://zunox.hk/players/' + re.findall(
            '(proxy.php\?id=[^\"\']+)', html)[0]
        h2 = client.request(url)
        import json
        j = json.loads(h2)
        host = urlparse.urlparse(j['url']).netloc.split(':')[0].replace(
            ':80', '')
        url = j['url'].replace(':80', '') + '.flv' + '|%s' % urllib.urlencode(
            {
                'User-agent': client.agent(),
                'X-Requested-With': constants.get_shockwave(),
                'Referer': ref,
                'Host': host,
                'Connection': 'keep-alive',
                'Accept-Encodeing': 'gzip, deflate, lzma, sdch'
            })
        return url
コード例 #30
0
def finder1(html, url):
    global limit
    limit += 1
    ref = url
    try:
        urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")', html)
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0])
        except:
            pass

        urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html)

        from random import shuffle
        shuffle(urls)

        for url in urls:
            if 'c4.zedo' in url:
                continue
            if "micast" in url or 'turbocast' in url:
                return finder47(html, ref)
            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url, ref)
            if limit >= 25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri)
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({
                'X-Requested-With': 'ShockwaveFlash/20.0.0.286',
                'Host': urlparse.urlparse(resolved).netloc,
                'Connection': 'keep-alive'
            })
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #31
0
ファイル: __init__.py プロジェクト: bialagary/mw
def find_link(url):
    try: referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
    except: referer = 'http://' + urlparse.urlparse(url).netloc
    host  = host  = urlparse.urlparse(url).netloc
    headers = {'Referer':referer, 'Host':host, 'User-Agent' : client.agent(), 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language' : 'en-US,en;q=0.5'}
    try:
        import HTMLParser
        h = HTMLParser.HTMLParser()
        url = h.unescape(url)
    except:
        pass
    html = client.request(url, headers=headers)
   
    try:
        html = urllib.unquote(html)
    except:
        pass

    try:
        import HTMLParser
        h = HTMLParser.HTMLParser()
        html = h.unescape(html)
    except:
        pass
    if 'livetv.sx' in url:
        import requests
        s = requests.Session()
        s.headers.update(headers)
        html = s.get(url).text
    if '@3C' in html:
        html = html.replace('@','%')
        html = urllib.unquote(html)
    ref=url
    fs=list(globals().copy())
    for f in fs:
        if 'finder' in f:
            resolved = eval (f+"(html,ref)")
            if resolved:
                return resolved
                break
    return
コード例 #32
0
def finder92(html, ref):
    try:
        url = re.findall(
            'source\s*src=\s*"\s*(.+?)\s*"\s*type=\s*"\s*application/x-mpegURL\s*"\s*/>',
            html)[0]
        if 'rtmp' in url:
            url += ' swfUrl=http://www.shadow-net.biz/javascript/videojs/flashls/video-js.swf flashver=%s live=true timeout=18 swfVfy=1 pageUrl=http://www.shadow-net.biz/' % FLASH
        elif 'm3u8' in url:

            url += '|%s' % urllib.urlencode({
                'User-Agent': client.agent(),
                'Referer': ref,
                'X-Requested-With': 'ShockwaveFlash/20.0.0.286',
                'Host': urlparse.urlparse(url).netloc,
                'Connection': 'keep-alive',
                'Accept': '*/*',
                'Origin': 'http://shadow.go.ro'
            })
        return url
    except:
        return
コード例 #33
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder1(html,url):
    global limit
    limit+=1
    ref=url
    try:
        urls = re.findall('<i?frame.+?src=(?:\'|\")(.+?)(?:\'|\")',html,flags=re.IGNORECASE)
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)",html)[0])
        except: pass

        urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]',html)
        urls += re.findall('(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']',html) 
        from random import shuffle
        for url in urls:
            if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url:
                continue

            if "micast" in url or 'turbocast' in url:
                return finder47(html,ref)
                    
            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url,ref)
            if limit>=25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri) 
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({'X-Requested-With':constants.get_shockwave(), 'Host':urlparse.urlparse(resolved).netloc, 'Connection':'keep-alive'})
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #34
0
def finder1(html, url):
    html = html.replace('/adplus/adplus.html?id=', '')
    try:
        html = urllib.unquote(html)
    except:
        pass
    global limit
    limit += 1
    ref = url
    try:
        urls = re.findall('<i?frame\s*.+?src=(?:\'|\")(.+?)(?:\'|\")',
                          html,
                          flags=re.IGNORECASE)
        urly = client.parseDOM(html, "iframe", ret="src")
        urlc = re.findall(
            'top.location.href\s*=\s*[\'\"](.+?axe-tv[^\'\"]+)[\'\"]', html)
        for url in urlc:
            if 'sky-sports-1' not in url and 'fox1ushd' not in url:
                urls.append(url)
        urls += urly
        try:
            urls.append(re.findall("playStream\('iframe', '(.+?)'\)", html)[0])
        except:
            pass

        urls += re.findall('<a.+?href=[\'\"](/live-.+?stream.+?)[\'\"]', html)
        urls += re.findall(
            '(http://www.hdmyt.info/(?:channel|player).php\?file=[^"\']+)["\']',
            html)

        from random import shuffle
        for url in urls:
            url = url.replace('https', 'http')
            if 'c4.zedo' in url or 'ProtectFile.File' in url or 'adServe' in url or 'facebook' in url or 'banner' in url:
                continue

            elif "micast" in url or 'turbocast' in url:
                return finder47(html, ref)

            elif 'lshstream' in url:
                return finder2(url, url)

            rr = resolve_it(url)
            if rr:
                return rr
            uri = manual_fix(url, ref)
            if limit >= 25:
                log("Exiting - iframe visit limit reached")
                return
            resolved = find_link(uri)
            if resolved:
                break
        headers = {'User-Agent': client.agent(), 'Referer': ref}
        if '.m3u8' in resolved and '|' not in resolved:
            headers.update({
                'X-Requested-With': constants.get_shockwave(),
                'Host': urlparse.urlparse(resolved).netloc,
                'Connection': 'keep-alive'
            })
            resolved += '|%s' % urllib.urlencode(headers)
        return resolved
    except:
        return
コード例 #35
0
ファイル: __init__.py プロジェクト: stick141/modules4all
def finder123(html,ref):
    try:
        url = re.findall('mpegurl.+?src=[\"\']([^\"\']+)[\"\']',html)[0]
        return url + '|%s' % urllib.urlencode({'Referer':ref,'X-Requested-With':constants.get_shockwave(),'User-agent':client.agent()})
    except:
        return
コード例 #36
0
ファイル: __init__.py プロジェクト: tvspeler/SportStreams
def finder117(html,ref):
    if 'zunox' in ref:
        url = 'http://zunox.hk/players/' + re.findall('(proxy.php\?id=[^\"\']+)',html)[0]
        h2 = client.request(url)
        import json
        j = json.loads(h2)
        host  = urlparse.urlparse(j['url']).netloc.split(':')[0].replace(':80','')
        url = j['url'].replace(':80','') +'.flv' + '|%s' % urllib.urlencode({'User-agent':client.agent(),'X-Requested-With':constants.get_shockwave(),'Referer':ref, 'Host':host, 'Connection':'keep-alive','Accept-Encodeing':'gzip, deflate, lzma, sdch'})
        return url