Beispiel #1
0
def Playvid(url, name, download=None):
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")

    hdr = dict(utils.base_hdrs)
    hdr['Cookie'] = get_cookies()
    vpage = utils.getHtml(url, site.url, headers=hdr)

    sources = {}
    license = re.compile(r"license_code:\s*'([^']+)",
                         re.DOTALL | re.IGNORECASE).findall(vpage)[0]
    patterns = [
        r"video_url:\s*'([^']+)[^;]+?video_url_text:\s*'([^']+)",
        r"video_alt_url:\s*'([^']+)[^;]+?video_alt_url_text:\s*'([^']+)",
        r"video_alt_url2:\s*'([^']+)[^;]+?video_alt_url2_text:\s*'([^']+)",
        r"video_url:\s*'([^']+)',\s*postfix:\s*'\.mp4',\s*(preview)"
    ]
    for pattern in patterns:
        items = re.compile(pattern, re.DOTALL | re.IGNORECASE).findall(vpage)
        for surl, qual in items:
            qual = '00' if qual == 'preview' else qual
            surl = kvs_decode(surl, license)
            sources.update({qual: surl})
    videourl = utils.selector('Select quality',
                              sources,
                              setting_valid='qualityask',
                              sort_by=lambda x: 1081
                              if x == '4k' else int(x[:-1]),
                              reverse=True)

    if not videourl:
        vp.progress.close()
        return
    vp.play_from_direct_link(videourl)
Beispiel #2
0
def Playvid(url, name, download=None):
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")
    html = utils.getHtml(url)
    sources = re.findall(r"video(?:_alt)?_url:\s*'([^']+).+?text:\s*'([^']+)",
                         html)
    if sources:
        sources = {label: url for url, label in sources}
        surl = utils.prefquality(
            sources,
            sort_by=lambda x: int(''.join([y for y in x if y.isdigit()])),
            reverse=True)
        if surl.startswith('function/'):
            lcode = re.findall(r"license_code:\s*'([^']+)", html)[0]
            surl = '{0}|User-Agent=iPad&Referer={1}/'.format(
                kvs_decode(surl, lcode), site.url)
    if not surl:
        vp.progress.close()
        return
    vp.progress.update(75, "[CR]Video found[CR]")
    vp.progress.close()
    if download == 1:
        utils.downloadVideo(surl, name)
    else:
        vp.play_from_direct_link(surl)
Beispiel #3
0
def Playvid(url, name, download=None):
    links = {}
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")
    videopage = utils.getHtml(url)
    videopage = videopage.split('!Display player')[-1]

    srcs = re.compile(r'<a title="([^"]+)" href="([^"]+)"',
                      re.DOTALL | re.IGNORECASE).findall(videopage)
    for title, src in srcs:
        title = utils.cleantext(title)
        title = title.split(' on ')[-1]

        if 'mangovideo' in src:
            html = utils.getHtml(src)
            murl = re.compile(r"video_url:\s*'([^']+)'",
                              re.DOTALL | re.IGNORECASE).findall(html)[0]
            if murl.startswith('function/'):
                license = re.findall(r"license_code:\s*'([^']+)", html)[0]
                murl = kvs_decode(murl, license)
            links[title] = murl
        elif vp.resolveurl.HostedMediaFile(src).valid_url():
            links[title] = src
    videourl = utils.selector('Select server', links, setting_valid=False)
    if not videourl:
        vp.progress.close()
        return
    vp.progress.update(90, "[CR]Loading video page[CR]")
    if 'mango' in videourl:
        vp.play_from_direct_link(videourl)
    else:
        vp.play_from_link_to_resolve(videourl)
Beispiel #4
0
def Playvid(url, name, download=None):
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")
    html = utils.getHtml(url)
    surl = re.search(r"video_url:\s*'([^']+)'", html)
    if surl:
        surl = surl.group(1)
        if surl.startswith('function/'):
            license = re.findall(r"license_code:\s*'([^']+)", html)[0]
            surl = kvs_decode(surl, license)
    else:
        vp.progress.close()
        return
    vp.progress.update(75, "[CR]Video found[CR]")
    vp.play_from_direct_link(surl)
Beispiel #5
0
def Playvid(url, name, download=None):
    links = {}
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")
    try:
        html = utils.getHtml(url)
    except urllib_error.URLError as e:
        utils.notify(e)
        return
    # html = re.compile('<center><!-- Display player -->(.+?)<center>', re.DOTALL | re.IGNORECASE).findall(videopage)[0]
    srcs = re.compile('<a title="([^"]+)" href="([^"]+)"',
                      re.DOTALL | re.IGNORECASE).findall(html)
    for title, src in srcs:
        title = utils.cleantext(title)
        title = title.split(' on ')[-1]
        if '/goto/' in src:
            src = url_decode(src)
        if 'mangovideo' in src:
            html = utils.getHtml(src, url)
            if '=' in src:
                src = src.split('=')[-1]
            murl = re.compile(r"video_url:\s*'([^']+)'",
                              re.DOTALL | re.IGNORECASE).findall(html)
            if murl:
                if murl[0].startswith('function/'):
                    license = re.findall(r"license_code:\s*'([^']+)", html)[0]
                    murl = kvs_decode(murl[0], license)
            else:
                murl = re.compile(r'action=[^=]+=([^\?]+)/\?download',
                                  re.DOTALL | re.IGNORECASE).findall(html)
                if murl:
                    murl = murl[0]
            if murl:
                links[title] = murl
        elif vp.resolveurl.HostedMediaFile(src).valid_url():
            links[title] = src
    videourl = utils.selector('Select server', links, setting_valid=False)
    if not videourl:
        vp.progress.close()
        return
    vp.progress.update(90, "[CR]Loading video page[CR]")
    if 'mango' in videourl:
        vp.play_from_direct_link(videourl)
    else:
        vp.play_from_link_to_resolve(videourl)
Beispiel #6
0
def Playvid(url, name, download=None):
    vp = utils.VideoPlayer(name, download)
    vp.progress.update(25, "[CR]Loading video page[CR]")
    html = utils.getHtml(url, site.url)
    surl = re.search(r"video(?:_alt)?_url:\s*'([^']+)", html)
    if surl:
        surl = surl.group(1)
        if surl.startswith('function/'):
            lcode = re.findall(r"license_code:\s*'([^']+)", html)[0]
            surl = '{0}|User-Agent=iPad&Referer={1}'.format(kvs_decode(surl, lcode), site.url)
    else:
        vp.progress.close()
        return
    vp.progress.update(75, "[CR]Video found[CR]")
    vp.progress.close()
    if download == 1:
        utils.downloadVideo(surl, name)
    else:
        vp.play_from_direct_link(surl)