Ejemplo n.º 1
0
def parse_a_cb(content, data):
    result = []
    match = aw_re.search(content)
    while match:
        result.extend(match.group(2, 1))
        match = aw_re.search(content, match.end(0))
    moonplayer.show_album(result)
Ejemplo n.º 2
0
def parse_album_cb(content, prefix):
    items = []
    match = album_re.search(content)
    while match:
        items.append(match.group(1)) #name
        items.append('http://www.tudou.com/programs/view/' + match.group(2)) #url
        match = album_re.search(content, match.end(0))
    moonplayer.show_album(items)
Ejemplo n.º 3
0
def parse_album_cb(content, prefix):
    items = []
    match = album_re.search(content)
    while match:
        items.append(match.group(1))  #name
        items.append('http://www.tudou.com/programs/view/' +
                     match.group(2))  #url
        match = album_re.search(content, match.end(0))
    moonplayer.show_album(items)
Ejemplo n.º 4
0
def parse_details_cb(content, data):
    links = []
    match = detail_re.search(content)
    while match:
        (url, name) = match.group(1, 2)
        links.append(name)
        links.append(url)
        match = detail_re.search(content, match.end(0))
    moonplayer.show_album(links)
Ejemplo n.º 5
0
def parse_details_cb(content, data):
    links = []
    match = detail_re.search(content)
    while match:
        (url, name) = match.group(1, 2)
        links.append(name)
        links.append(url)
        match = detail_re.search(content, match.end(0))
    moonplayer.show_album(links)
Ejemplo n.º 6
0
def parse_album_cb(content, data):
    albums = []
    match = parse_album_re.search(content)
    while match:
        vid = match.group(1)
        name = match.group(2).decode('unicode-escape').encode('UTF-8')
        albums.append(name)
        albums.append(vid)
        match = parse_album_re.search(content, match.end(0))
    moonplayer.show_album(albums)
Ejemplo 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)
Ejemplo n.º 8
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)
Ejemplo n.º 9
0
def parse_series_cb(content, mov_url):
    links = []
    match = re2.search(content)
    if not match:
        moonplayer.get_url(mov_url, parse_movie_cb, None) #movie
        return
    while match:
        (name, url) = match.group(2, 1)
        links.append(name)
        links.append(url)
        match = re2.search(content, match.end(0))
    moonplayer.show_album(links)
Ejemplo n.º 10
0
def parse_series_cb(content, mov_url):
    links = []
    match = re2.search(content)
    if not match:
        moonplayer.get_url(mov_url, parse_movie_cb, None)  #movie
        return
    while match:
        (name, url) = match.group(2, 1)
        links.append(name)
        links.append(url)
        match = re2.search(content, match.end(0))
    moonplayer.show_album(links)
Ejemplo n.º 11
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)
Ejemplo n.º 12
0
def parse_subject2(page, vid):
    match = vinfo_re.search(page)
    if match:
        result = []
        data = json.loads(match.group(1))[u'dvideos'][0][u'videos']
        for item in data:
            name = item[u'title'].encode('utf-8')
            url = 'http://www.fun.tv' + str(item[u'url'])
            result.append(name)
            result.append(url)
        moonplayer.show_album(result)
    else:
        moonplayer.warn('Parse fail!')
Ejemplo n.º 13
0
    def parse_album_cb(self, content, data):
        if content[-1] == ';':
            content = content[0:-1]
        inf = json.loads(content)
        try:
            items = inf[u'data']
        except KeyError:  # last page
            moonplayer.show_album(self.result)
            return

        for item in items:
            enid = item[u'video_id'].encode('utf-8')
            name = item[u'video_title'].encode('utf-8')
            url = 'http://www.56.com/u30/v_%s.html' % (enid, )
            self.result.append(name)
            self.result.append(url)
        self.page += 1
        url = album_url_fmt % (self.wid, self.aid, self.page)
        moonplayer.get_url(url, self.parse_album_cb, None)
Ejemplo n.º 14
0
 def parse_album_cb(self, content, data):
     if content[-1] == ';':
         content = content[0:-1]
     inf = json.loads(content)
     try:
         items = inf[u'data']
     except KeyError: # last page
         moonplayer.show_album(self.result)
         return
         
     for item in items:
         enid = item[u'video_id'].encode('utf-8')
         name = item[u'video_title'].encode('utf-8')
         url = 'http://www.56.com/u30/v_%s.html' % (enid,)
         self.result.append(name)
         self.result.append(url)
     self.page += 1
     url = album_url_fmt % (self.wid, self.aid, self.page)
     moonplayer.get_url(url, self.parse_album_cb, None)
Ejemplo n.º 15
0
def parse_subject(page, vid):
    result = []
    try:
        mults = json.loads(page)[u'data'][u'fsps'][u'mult']
    except KeyError:
        url = 'http://www.fun.tv/vplay/g-' + vid
        moonplayer.get_url(url, parse_subject2, vid)
        return
    for mult in mults:
        name = 'unknown'
        try:
            name = mult[u'name'].encode('UTF-8')
            name = mult[u'full'].encode('UTF-8')
        except KeyError:
            pass
        url = 'http://www.fun.tv' + str(mult[u'url'])
        result.append(name)
        result.append(url)
    moonplayer.show_album(result)
Ejemplo n.º 16
0
def parse_tv_cb(page, options):
    links = list_links(page, 'http://tv.sohu.com/2')
    moonplayer.show_album(links)
Ejemplo n.º 17
0
def parse_movie_cb(content, data):
    links = list_links(content, 'http://v.youku.com/v_show/')
    moonplayer.show_album(links)
Ejemplo n.º 18
0
def parse_tv_cb(page, options):
    links = list_links(page, 'http://tv.sohu.com/2')
    moonplayer.show_album(links)
Ejemplo n.º 19
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)
Ejemplo n.º 20
0
def parse_movie_cb(content, data):
    links = list_links(content, 'http://v.youku.com/v_show/')
    moonplayer.show_album(links)