예제 #1
0
def get_playlist(url):
    manifest_links = {}
    subtitles = None
    season = None
    episode = None

    try:
        response = tools.get_response(url, HEADERS, {}, "GET")
    except:
        return manifest_links, subtitles, season, episode

    #tvshow
    tvshow = response.split("season:")[1].split(",")[0].replace(" ", "")
    if (tvshow != "null"):
        response, season, episode = select_episode(response, url)
        if response == "":
            return manifest_links, subtitles, season, episode

    part = response.split("hls_master_file_path: '")[-1].split("',")[0]
    url_ = "https://gethdhls.com" + part
    try:
        response = tools.get_response(url_, HEADERS2, {}, "GET")
    except:
        return manifest_links, subtitles, season, episode

    urls = re.compile("https:\/\/.*?\.m3u8").findall(response)
    for i, url in enumerate(urls):
        manifest_links[QUALITY_TYPES[i]] = url

    return manifest_links, subtitles, season, episode
예제 #2
0
def get_content():
    vh_title = "yohoho."
    list_li = []

    VALUES["kinopoisk"] = _kp_id_
    response = tools.get_response(URL, HEADERS, VALUES, 'POST')

#{"moonwalk":{},
#"hdgo":{},
#"trailer":{},
#"torrent":{},
#"videospider":{},
#"kodik":{},
#"videocdn":{"iframe":"//90.tvmovies.in/kLShoChnGWEE/movie/107","translate":"Полное дублирование","quality":"hddvd"},
#"hdvb":{"iframe":"https://vid1572801764.farsihd.pw/movie/db8f575a1374728dda63eb6244be9bca/iframe","translate":"многоголосый закадровый","quality":"HDRip"},
#"iframe":{"iframe":"https://videoframe.at/movie/42da420pb7p/iframe","translate":"","quality":""},
#"collaps":{"iframe":"https://api1572798262.buildplayer.com/embed/movie/334","translate":"","quality":""}}
    
    if response:
        jdata = json.loads(response)
        for host in ENABLED_HOSTS:
            host_data = jdata[host]
            if host_data:
                iframe = host_data["iframe"]
                translate = host_data["translate"]
                quality = host_data["quality"]
                title_ = "*T*"
                title = "[COLOR=orange][{0}][/COLOR] {1} {2}".format(vh_title + host, tools.encode(title_), get_add_info(translate, quality))
                uri = sys.argv[0] + "?mode=show&url={0}".format(urllib.quote_plus(prepare_url(host, iframe)))
                item = xbmcgui.ListItem(title)
                list_li.append([uri, item, True])
    return list_li
예제 #3
0
def select_translator(data, url):
    tr_arr = data.split("sounds: [")[-1].split("seasons")[0].replace(
        "\n", "").replace(" ", "").split("],[")
    translators = []
    tr_values = []
    for tr_item in tr_arr:
        translators.append(
            tr_item.split(",")[1].replace("'", "").replace("]", ""))
        tr_values.append(
            tr_item.split(",")[0].replace("'", "").replace("[", ""))

    if len(translators) > 1:
        dialog = xbmcgui.Dialog()
        index_ = dialog.select("Select translator", translators)
        if int(index_) < 0:
            index_ = 0
    else:
        index_ = 0
    tr_value = tr_values[index_]

    VALUES["snd"] = tr_value
    VALUES["s"] = "1"
    VALUES["e"] = "1"
    response = tools.get_response(url, HEADERS, VALUES, "GET")
    return response, tr_value
예제 #4
0
def prepare_url(url):
    if not url:
        return ""
    response = tools.get_response(url, HEADERS2, {}, 'GET')
    if response:
        return "http:" + common.parseDOM(response, "iframe", ret="src")[0]
    else:
        return url
예제 #5
0
def select_episode(data, url):
    sindex = None
    eindex = None
    data_, tr_value = select_translator(data, url)
    season, sindex = select_season(data_, tr_value)
    if season == "":
        return "", sindex, eindex

    VALUES["snd"] = tr_value
    VALUES["s"] = season
    VALUES["e"] = "1"
    try:
        response = tools.get_response(url, HEADERS, VALUES, "GET")
    except:
        return "", sindex, eindex

    sss = response.split("soundsList: ")[-1].split(
        "selected_options:")[0].replace(' ', '').replace("\n", '').replace(
            "],}", "]}").replace("},}", "}}").replace("'", '"')
    seriesjson = json.loads(sss[:len(sss) - 1])
    series = []

    for episode in seriesjson[tr_value][season]:
        series.append(str(episode))
    evalues = series

    if len(series) > 1:
        dialog = xbmcgui.Dialog()
        index_ = dialog.select("Select episode", series)
        if int(index_) < 0:
            index_ = -1
    else:
        index_ = 0
    episode = str(index_ + 1)
    eindex = str(index_ + 1)
    if index_ < 0:
        return "", sindex, eindex

    VALUES["snd"] = tr_value
    VALUES["s"] = season
    VALUES["e"] = episode
    try:
        response = tools.get_response(url, HEADERS, VALUES, "GET")
        return response, sindex, eindex
    except:
        return "", sindex, eindex
예제 #6
0
def prepare_url(url):
    if not url:
        return ""
    HEADERS2["Referer"] = url
    response = tools.get_response(url, HEADERS2, {}, 'GET')
    if response:
        return common.parseDOM(response, "iframe", ret="src")[0]
    else:
        return url
예제 #7
0
def get_content():
    vh_title = "czx.to"
    list_li = []

    response = tools.get_response(URL + '/' + str(_kp_id_) + '/', HEADERS,
                                  VALUES, 'GET')

    if response:
        iframe = common.parseDOM(response, "iframe", ret="src")[0]
        title_ = "*T*"
        title = "[COLOR=orange][{0}][/COLOR] {1}".format(
            vh_title, tools.encode(title_))
        uri = sys.argv[0] + "?mode=show&url={0}".format(
            urllib.quote_plus(iframe))
        item = xbmcgui.ListItem(title)
        list_li.append([uri, item, True])
    return list_li
예제 #8
0
def get_content(part):
    vh_title = "kodik.top"
    list_li = []

    VALUES["search"] = _kp_id_
    HEADERS["Referer"] = URL + part
    response = tools.get_response(URL + part, HEADERS, VALUES, 'POST')

    if response:
        try:
            table = common.parseDOM(response,
                                    "table",
                                    attrs={"class": "table table-hover"})
            tbody = common.parseDOM(table, "tbody")
            rows = common.parseDOM(tbody, "tr")
            for item in rows:
                try:
                    tds = common.parseDOM(item, "td")
                    url_ = "https:" + common.parseDOM(
                        item,
                        "a",
                        attrs={"class": "btn btn-success btn-xs copypreview"},
                        ret="data-link")[0]
                except:
                    continue
                url = prepare_url(url_)
                title_ = tools.strip(tds[0]) + " (" + tools.strip(
                    tds[1]) + ", " + tools.strip(tds[2]) + ")"
                title = "[COLOR=orange][{0}][/COLOR] {1}".format(
                    vh_title, tools.encode(title_))
                uri = sys.argv[0] + "?mode=show&url={0}&title={1}".format(
                    urllib.quote_plus(url), urllib.quote_plus(title))
                item = xbmcgui.ListItem(title)
                list_li.append([uri, item, True])
        except:
            pass
    return list_li