Exemplo n.º 1
0
def search_cb(content, data):
    # movies, TV series and details
    movies = list_links(content, "http://www.youku.com/show_page/id_")
    details = list_links(content, "/detail/show/")
    n = (len(movies) + len(details)) >> 1
    # videos
    links = movies + details + list_links(content, "http://v.youku.com/v_show/")
    moonplayer.show_list(links)
    for i in xrange(n):
        moonplayer.set_list_item_color(i, "#0000ff")
Exemplo n.º 2
0
def search_cb(content, data):
    #movies, TV series and details
    movies = list_links(content, 'http://www.youku.com/show_page/id_')
    details = list_links(content, '/detail/show/')
    n = (len(movies) + len(details)) >> 1
    #videos
    links = movies + details + list_links(content,
                                          'http://v.youku.com/v_show/')
    moonplayer.show_list(links)
    for i in xrange(n):
        moonplayer.set_list_item_color(i, '#0000ff')
Exemplo n.º 3
0
def search_cb(content, keyword):
    #movies and tv series
    result = list_links(content, 'http://www.iqiyi.com/lib/m_')
    n = len(result) / 2
    #album
    result += list_links(content, 'http://www.iqiyi.com/a_')
    n2 = len(result) / 2
    #single video
    result += list_links(content, 'http://www.iqiyi.com/w_', keyword)
    result += list_links(content, 'http://www.iqiyi.com/v_', keyword)
    moonplayer.show_list(result)
    for i in xrange(n):
        moonplayer.set_list_item_color(i, '#0000ff')
    for i in xrange(n, n2):
        moonplayer.set_list_item_color(i, '#ff00ff')
Exemplo n.º 4
0
def load_item_cb(page, url):
    result = {}
    match = name_re.search(page)
    if match:
        result["name"] = match.group(1)
    match = img_re.search(page)
    if match:
        result["image"] = match.group(1)
    match = date_re.search(page)
    if match:
        result["dates"] = [match.group(1)]
    match = alt_re.search(page)
    if match:
        result["alt_names"] = [match.group(1)]

    detail_div = page.split('<div class="detail">', 1)[-1].split("</div>")[0]
    match = summ_re.search(detail_div)
    if match:
        result["summary"] = match.group(1)
    else:
        match = summ2_re.search(detail_div)
        if match:
            result["summary"] = match.group(1)

    match = rating_re.search(page)
    if match:
        result["rating"] = float(match.group(1))

    result["source"] = list_links(page, "http://v.youku.com/v_show/id_")
    new_url = url.replace("/show_page/", "/show_episode/")
    moonplayer.get_url(new_url, load_item_cb2, result)
Exemplo n.º 5
0
def search_cb(content, data):
    result = list_links(content, 'http://www.soku.com/u?url=')
    for i in xrange(1, len(result), 2):
        result[i] = result[i].replace('http://www.soku.com/u?url=', '')
        provider = result[i].split('.')[1]
        result[i-1] += ' (' + provider + ')'
    moonplayer.show_list(result)
Exemplo n.º 6
0
def search_cb(content, data):
    result = list_links(content, 'http://www.soku.com/u?url=')
    for i in xrange(1, len(result), 2):
        result[i] = result[i].replace('http://www.soku.com/u?url=', '')
        provider = result[i].split('.')[1]
        result[i - 1] += ' (' + provider + ')'
    moonplayer.show_list(result)
Exemplo n.º 7
0
def parse_album_cb(content, data):
    prefix = data[0]
    now_page = data[1]
    items = data[2]
    new_items = list_links(content, "http://v.youku.com/v_show/id_")
    items += new_items
    if len(new_items) > 0:
        url = prefix + "_ascending_1_mode_pic_page_" + str(now_page + 1) + ".html"
        moonplayer.get_url(url, parse_album_cb, (prefix, now_page + 1, items))
    else:
        moonplayer.show_album(items)
Exemplo n.º 8
0
def search_by_key_cb(content, data):
    content = content.replace('\n', '')
    result = []
    pics = []
    items = list_links(content, '/detail/show')
    match = pic_re.search(content)
    while match:
        pics.append(match.group(1))
        match = pic_re.search(content, match.end(0))
    for i in xrange(0, len(items), 2):
        result.append({'name': items[i], 'url': items[i+1], 'pic_url': pics[i/2]})
    moonplayer.res_show(result)
Exemplo n.º 9
0
def parse_album2_cb(content, data):
    prefix = data[0]
    now_page = data[1]
    items = data[2]
    new_items = list_links(content, "http://v.youku.com/v_show/id_")
    items += new_items
    if len(new_items) > 0:
        url = prefix + "&cp=" + str(now_page + 1)
        print len(new_items), url
        moonplayer.get_url(url, parse_album2_cb, (prefix, now_page + 1, items))
    else:
        moonplayer.show_album(items)
Exemplo n.º 10
0
def parse_album_cb(content, data):
    prefix = data[0]
    now_page = data[1]
    items = data[2]
    new_items = list_links(content, 'http://v.youku.com/v_show/id_')
    items += new_items
    if len(new_items) > 0:
        url = prefix + '_ascending_1_mode_pic_page_' + str(now_page +
                                                           1) + '.html'
        moonplayer.get_url(url, parse_album_cb, (prefix, now_page + 1, items))
    else:
        moonplayer.show_album(items)
Exemplo n.º 11
0
def explore_cb(page, data):
    # page = page.replace('\n', '')
    dict_url_img = {}
    match = img_re.search(page)
    while match:
        url, img = match.group(1, 2)
        dict_url_img[url] = img
        match = img_re.search(page, match.end(0))
    result = list_links(page, "http://tv.sohu.com/item/")
    items = []
    for i in xrange(0, len(result), 2):
        name = result[i]
        url = result[i + 1]
        pic_url = dict_url_img[url]
        item = {"name": name, "url": url, "pic_url": pic_url}
        items.append(item)
    moonplayer.res_show(items)
Exemplo n.º 12
0
def search_cb(page, data):
    name2pic = {}
    result = []
    # Read all pic urls
    match = pic_re.search(page)
    while match:
        (url, name) = match.group(1, 2)
        name2pic[name] = url
        match = pic_re.search(page, match.end(0))
    # Read links, bind them with relative pic urls
    links = list_links(page, "http://www.youku.com/show_page/")
    for i in xrange(0, len(links), 2):
        name = links[i]
        url = links[i + 1]
        try:
            result.append({"name": name, "flag": url, "pic_url": name2pic[name]})
        except KeyError:
            pass
    moonplayer.res_show(result)
Exemplo n.º 13
0
def search_by_key_cb(content, data):
    result = []
    items = content.split('<div class="detail">')
    for item in items:
        item = item.split('</div><!--detail end-->')[0].replace('\n', '')
        name_url = list_links(item, '/detail/show/')
        if len(name_url):
            name = name_url[0]
            url = name_url[1]
            match = pic_re.search(item)
            if match:
                pic = match.group(1)
                result.append({'name': name, 'url': url, 'pic_url': pic})
    rest = items[-1].split('</div><!--item end-->', 1)[1].replace('\n', '')
    match = rest_re.search(rest)
    while match:
        (url, name, pic) = match.group(1, 2, 3)
        result.append({'name': name, 'url': url, 'pic_url': pic})
        match = rest_re.search(rest, match.end(0))
    moonplayer.res_show(result)
Exemplo n.º 14
0
def search_cb(page, data):
    name2pic = {}
    result = []
    # Read all pic urls
    match = pic2_re.search(page)
    while match:
        (url, name) = match.group(1, 2)
        name2pic[name] = url
        match = pic2_re.search(page, match.end(0))
    # Read links, bind them with relative pic urls
    links = list_links(page, '/detail/show/')
    for i in xrange(0, len(links), 2):
        name = links[i]
        url = links[i+1]
        try:
            result.append({'name': name,
                           'url': url,
                           'pic_url': name2pic[name]})
        except KeyError:
            pass
    moonplayer.res_show(result)
Exemplo n.º 15
0
def search_cb(page, data):
    name2pic = {}
    result = []
    # Read all pic urls
    match = pic_re.search(page)
    while match:
        (url, name) = match.group(1, 2)
        name2pic[name] = url
        match = pic_re.search(page, match.end(0))
    # Read links, bind them with relative pic urls
    links = list_links(page, 'http://www.youku.com/show_page/')
    for i in xrange(0, len(links), 2):
        name = links[i]
        url = links[i+1]
        try:
            result.append({'name': name,
                           'flag': url,
                           'pic_url': name2pic[name]})
        except KeyError:
            pass
    moonplayer.res_show(result)
Exemplo n.º 16
0
def load_item_cb(page, data):
    result = {}
    # Picture
    try:
        match = pic_re.search(page.split("drama-pic")[1])
    except IndexError:
        match = pic_re.search(page.split("movie-pic")[1])
    if match:
        result["image"] = match.group(1)
    # Name
    match = name_re.search(page)
    if match:
        result["name"] = match.group(1)
    # Rating
    match = rating_re.search(page)
    if match:
        result["rating"] = float(match.group(1))
    # Nation / Region
    match = nation_re.search(page)
    if match:
        result["nations"] = [match.group(1)]
    # Date
    match = date_re.search(page)
    if match:
        result["dates"] = match.group(1).split("/")
    # Director
    match = director_re.search(page)
    if match:
        result["directors"] = match.group(1).split("/")
    # Alternative names
    match = alt_name_re.search(page)
    if match:
        result["alt_names"] = match.group(1).split("/")
    # Summary
    match = summary_re.search(page)
    if match:
        result["summary"] = match.group(1).replace("&nbsp;", " ")
    # Videos' urls
    result["source"] = list_links(page, "http://tv.sohu.com/2")
    moonplayer.show_detail(result)
Exemplo n.º 17
0
def explore_cb(page, data):
    page = page.split('大家都在看')[0]
    name2pic = {}
    result = []
    # Read all pic urls
    match = pic_re.search(page)
    while match:
        url, name = match.group(1, 2)
        name2pic[name] = url
        match = pic_re.search(page, match.end(0))
    # Read links, bind them with relative pic urls
    links = list_links(page, '//v.youku.com/v_show')
    for i in xrange(0, len(links), 2):
        name = links[i]
        url = 'http:' + links[i+1]
        try:
            result.append({'name': name,
                           'url': url,
                           'pic_url': name2pic[name]})
        except KeyError:
            pass
    moonplayer.res_show(result)
Exemplo n.º 18
0
def load_item_cb(page, url):
    result = {}
    match = name_re.search(page)
    if match:
        result['name'] = match.group(1)
    match = img_re.search(page)
    if match:
        result['image'] = match.group(1)
    match = date_re.search(page)
    if match:
        result['dates'] = [match.group(1)]
    match = alt_re.search(page)
    if match:
        result['alt_names'] = [match.group(1)]
    match = summ_re.search(page.split('Detail', 1)[-1])
    if match:
        result['summary'] = match.group(1)
    match = rating_re.search(page)
    if match:
        result['rating'] = float(match.group(1))
    result['source'] = list_links(page, 'http://v.youku.com/v_show/id_')
    new_url = url.replace('/show_page/', '/show_episode/')
    moonplayer.get_url(new_url, load_item_cb2, result)
Exemplo n.º 19
0
def search_album_cb(content, data):
    links = list_links(content, 'http://www.youku.com/playlist_show/')
    moonplayer.show_list(links)
Exemplo n.º 20
0
def search_album_cb(page, keyword):
    page = convert_to_utf8(page)
    links = list_links(page, 'http://www.tudou.com/playlist/id/', keyword)
    moonplayer.show_list(links)
Exemplo n.º 21
0
def search_cb(content, data):
    links = list_links(content, 'http://www.tudou.com/programs/view/')
    moonplayer.show_list(links)
Exemplo n.º 22
0
def search_album_cb(page, data):
    result = list_links(page, 'http://www.56.com/w')
    moonplayer.show_list(result)
Exemplo n.º 23
0
def search_cb(content, data):
    result = list_links(content, '//v.youku.com/v_show')
    result = [
        'http:' + item if item.startswith('//') else item for item in result
    ]
    moonplayer.show_list(result)
Exemplo n.º 24
0
def library_cb(content, data):
    links = list_links(content, 'http://www.youku.com/show_page/id_')
    moonplayer.show_list(links)
Exemplo n.º 25
0
def library_cb(content, data):
    links = list_links(content, 'http://www.youku.com/show_page/id_')
    moonplayer.show_list(links)
Exemplo n.º 26
0
def parse_movie_cb(content, data):
    links = list_links(content, 'http://v.youku.com/v_show/')
    moonplayer.show_album(links)
Exemplo n.º 27
0
def parse_movie_cb(content, data):
    links = list_links(content, 'http://v.youku.com/v_show/')
    moonplayer.show_album(links)
Exemplo n.º 28
0
def search_album_cb(page, data):
    result = list_links(page, 'http://www.56.com/w')
    moonplayer.show_list(result)
Exemplo n.º 29
0
def search_album_cb(content, data):
    links = list_links(content, 'http://www.youku.com/playlist_show/')
    moonplayer.show_list(links)
Exemplo n.º 30
0
def parse_tv_cb(content, data):
    result = list_links(content, 'http://www.iqiyi.com/dian')
    result += list_links(content, 'http://www.iqiyi.com/v_')
    moonplayer.show_album(result)
Exemplo n.º 31
0
def search_album_cb(content, data):
    links = list_links(content, "/search_playlistdetail?")
    links += list_links(content, "http://www.youku.com/playlist_show/")
    moonplayer.show_list(links)
Exemplo n.º 32
0
def search_cb(content, data):
    links = list_links(content, 'http://www.tudou.com/programs/view/')
    moonplayer.show_list(links)
Exemplo n.º 33
0
def load_item_cb2(page, result):
    srcs = list_links(page, 'http://v.youku.com/v_show/id_')
    if len(srcs):
        result['source'] = srcs
    moonplayer.show_detail(result)
Exemplo n.º 34
0
def search_album_cb(page, keyword):
    page = convert_to_utf8(page)
    links = list_links(page, 'http://www.tudou.com/playlist/id/', keyword)
    moonplayer.show_list(links)