本文整理汇总了Python中moonplayer.get_url函数的典型用法代码示例。如果您正苦于以下问题:Python get_url函数的具体用法?Python get_url怎么用?Python get_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: parse_cb
def parse_cb(page, options):
#page = content.decode('GBK').encode('UTF-8')
page = convert_to_utf8(page)
name_match = name_re.search(page)
if not name_match:
moonplayer.warn('Cannot get video name.')
return
name = name_match.group(1)
if options & moonplayer.OPT_QL_SUPER:
i = 5
elif options & moonplayer.OPT_QL_HIGH:
i = 3
else:
i = 2
vlist = [None] * 6
iid_match = iid_re.search(page)
while iid_match:
(pt, k) = iid_match.group(1, 2)
pt = int(pt)
if pt < 6:
vlist[pt] = k
iid_match = iid_re.search(page, iid_match.end(0))
while i >= 0:
if vlist[i]:
url = 'http://v2.tudou.com/f?id=' + vlist[i]
moonplayer.get_url(url, parse_cb2, (name, options))
return
i -= 1
moonplayer.warn('Fail!')
开发者ID:RunCross,项目名称:moonplayer,代码行数:30,代码来源:plugin_tudou.py
示例2: load_item_cb
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)
开发者ID:jinagko,项目名称:moonplayer,代码行数:31,代码来源:res_youku_tv.py
示例3: parse_vurl
def parse_vurl(self, content, options):
# Read urls of all qualities
root = json.loads(content)
vs = root[u'tkl'][0][u'vs']
bids = [None] * 5
for v in vs:
bid = int(v[u'bid']) - 1
if bid < 5:
bids[bid] = ['http://data.video.qiyi.com/videos' + item[u'l'] for item in v[u'fs']]
# Select quality
if options & moonplayer.OPT_QL_SUPER:
q = 3
elif options & moonplayer.OPT_QL_HIGH:
q = 1
else:
q = 0
for i in xrange(q, -1, -1):
if bids[i]:
self.urls = bids[i]
break
if options & moonplayer.OPT_DOWNLOAD and bids[4]:
if moonplayer.question('是否下载1080P版本?'):
self.urls = bids[4]
# Get video's key
first_uid = self.urls[0].split('/')[-1].split('.')[0]
self.suffix = str(self.urls[0].split('.')[-1])
url = 'http://data.video.qiyi.com/' + first_uid + '.ts'
moonplayer.get_url(url, self.parse_key, options)
开发者ID:kissthink,项目名称:repo,代码行数:29,代码来源:plugin_iqiyi.py
示例4: parse_cb
def parse_cb(self, page, options):
#page = content.decode('GBK').encode('UTF-8')
page = convert_to_utf8(page)
name_match = name_re.search(page)
if not name_match:
moonplayer.warn('Cannot get video name.')
return
self.name = name_match.group(1)
if options & moonplayer.OPT_QL_SUPER:
i = 5
elif options & moonplayer.OPT_QL_HIGH:
i = 3
else:
i = 2
vlist = [None] * 6
iid_match = iid_re.search(page)
while iid_match:
(pt, k) = iid_match.group(1, 2)
pt = int(pt)
if pt < 6:
if vlist[pt] == None:
vlist[pt] = []
vlist[pt].append(k)
iid_match = iid_re.search(page, iid_match.end(0))
while i >= 0:
if vlist[i]:
self.keys = vlist[i]
self.result = []
url = 'http://v2.tudou.com/f?id=' + self.keys[0]
moonplayer.get_url(url, self.parse_keys, options)
return
i -= 1
moonplayer.warn('Fail!')
开发者ID:jinagko,项目名称:moonplayer,代码行数:34,代码来源:plugin_tudou.py
示例5: __init__
def __init__(self, wid, aid):
self.wid = wid
self.aid = aid
self.page = 1
self.result = []
url = album_url_fmt % (wid, aid, 1)
moonplayer.get_url(url, self.parse_album_cb, None)
开发者ID:1dot75cm,项目名称:repo,代码行数:7,代码来源:plugin_56.py
示例6: parse_cb2
def parse_cb2(page, msg):
page = json_pre_process(page)
page = json.loads(page)
data = page[u'data']
#try other quality
try:
if not data:
moonplayer.warn('解析失败!换个清晰度试试?')
return
elif msg[2] & moonplayer.OPT_QL_SUPER and u'superVid' in data:
newvid = str(data[u'superVid'])
elif msg[2] & (moonplayer.OPT_QL_HIGH | moonplayer.OPT_QL_SUPER):
newvid = str(data[u'highVid'])
else:
newvid = str(data[u'norVid'])
if len(newvid) > 0 and newvid != msg[0] and newvid != '0':
msg[0] = newvid
url = 'http://hot.vrs.sohu.com/vrs_flash.action?out=0&g=8&r=1&vid=%s&plid=%s' % (msg[0],msg[1])
moonplayer.get_url(url, parse_cb2, msg)
return
except KeyError:
pass
#parse
vid = msg[0]
su = data[u'su']
ip = page[u'allot']
name = data[u'tvName'].encode('UTF-8')
result = []
i = 0
#make cdnlist
cdnlist = ['http://%s/cdnList?new=%s&vid=%s' % (ip, new, vid) for new in su]
data = {'result': [], 'cdnlist': cdnlist, 'name': name, 'options': msg[2]}
moonplayer.get_url(cdnlist[0], parse_cdnlist, data)
开发者ID:kissthink,项目名称:repo,代码行数:33,代码来源:plugin_sohu.py
示例7: search
def search(keyword, page):
keyword = keyword.replace(" ", "%20")
url = "http://s.video.qq.com/search?comment=0&plat=2&otype=xml&query=%s&cur=%d&num=20&start=0&end=0" % (
keyword,
page - 1,
)
moonplayer.get_url(url, search_cb, None)
开发者ID:jinagko,项目名称:moonplayer,代码行数:7,代码来源:plugin_qq.py
示例8: parse
def parse(url, options):
origin_url = url
url = 'http://www.flvcd.com/parse.php?go=1&kw=' + origin_url
if options & moonplayer.OPT_QL_SUPER:
url += '&format=super'
elif options & moonplayer.OPT_QL_HIGH:
url += '&format=high'
moonplayer.get_url(url, parse_cb, (options, origin_url))
开发者ID:lipq525,项目名称:moonplayer,代码行数:8,代码来源:plugin_bilibili.py
示例9: search
def search(args):
start = (args['page'] - 1) * 20
if 'key' in args:
key = args['key']
url = 'http://api.douban.com/v2/movie/search?q=%s&start=%i&count=20' % (key, start)
else:
tag = args['tag']
url = 'http://api.douban.com/v2/movie/search?tag=%s&start=%i&count=20' % (tag, start)
moonplayer.get_url(url, search_cb, None)
开发者ID:jinagko,项目名称:moonplayer,代码行数:9,代码来源:res_douban.py
示例10: parse_cb
def parse_cb(page, data):
(options, url) = data
result = parse_flvcd_page(page, None)
if len(result) == 0:
moonplayer.warn("Cannot parse bilibili's video!")
elif options & moonplayer.OPT_DOWNLOAD and len(result) > 2:
moonplayer.download(result, result[0])
else:
moonplayer.get_url(url, parse_danmaku_cb, (options, result))
开发者ID:singit,项目名称:moonplayer,代码行数:9,代码来源:plugin_bilibili.py
示例11: parse
def parse(url, options):
if url.startswith('http://www.tudou.com/playlist/id/'): #album
url = 'http://www.tudou.com/plcover/coverPage/getIndexItems.html?page=1&pageSize=512&lid=' + url.split('/')[-2]
moonplayer.get_url(url, parse_album_cb, None)
elif url.startswith('http://www.tudou.com/listplay/') or url.startswith('http://www.tudou.com/programs/view/'): #single video
parser.feed(url, options)
else: #wrong url
moonplayer.warn('Please input a valid tudou url.')
开发者ID:jinagko,项目名称:moonplayer,代码行数:10,代码来源:plugin_tudou.py
示例12: parse_cb
def parse_cb(page, options):
vid_match = vid_re.search(page)
plid_match = plid_re.search(page)
if vid_match and plid_match:
vid = vid_match.group(1)
plid = plid_match.group(1)
msg = [vid, plid, options]
url = 'http://hot.vrs.sohu.com/vrs_flash.action?out=0&g=8&r=1&vid=%s&plid=%s' % (msg[0], msg[1])
moonplayer.get_url(url, parse_cb2, msg)
else:
moonplayer.warn('Fail')
开发者ID:1dot75cm,项目名称:repo,代码行数:11,代码来源:plugin_sohu.py
示例13: parse_album_cb
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)
开发者ID:stamhe,项目名称:moonplayer,代码行数:11,代码来源:plugin_youku.py
示例14: parse
def parse(url, options):
if url.startswith('http://www.iqiyi.com/a_'):
moonplayer.get_url(url, parse_a_cb, None)
elif url.startswith('http://www.iqiyi.com/lib/m_'):
moonplayer.get_url(url, parse_tv_cb, None)
elif url.startswith('http://www.iqiyi.com/v_') or \
url.startswith('http://www.iqiyi.com/w_') or \
url.startswith('http://www.iqiyi.com/dianshiju/') or \
url.startswith('http://www.iqiyi.com/dianying/'):
parser.feed(url, options)
else:
moonplayer.warn('Wrong URL!')
开发者ID:kissthink,项目名称:repo,代码行数:12,代码来源:plugin_iqiyi.py
示例15: search
def search(args):
if "key" in args:
moonplayer.warn("Not supported.")
return
tag = args["tag"]
country = args["country"]
if tag == "全部":
tag = ""
if country == "全部":
country = ""
url = "http://www.youku.com/v_olist/c_97_g_%s_a_%s_s_1_d_2_pt_1_p_%i.html" % (tag, country, args["page"])
moonplayer.get_url(url, search_cb, None)
开发者ID:jinagko,项目名称:moonplayer,代码行数:12,代码来源:res_youku_tv.py
示例16: search
def search(args):
if 'key' in args:
url = 'http://www.soku.com/v?keyword=' + args['key']
moonplayer.get_url(url, search_by_key_cb, None)
return
tag = args['tag']
tag_id = tags_table[tag]
country = args['country']
country_id = countries_table[country]
url = 'http://www.soku.com/channel/movielist_0_%i_%i_1_%i.html' % \
(tag_id, country_id, args['page'])
moonplayer.get_url(url, search_cb, None)
开发者ID:lipq525,项目名称:moonplayer,代码行数:12,代码来源:res_soku_movie.py
示例17: parse_v_vid
def parse_v_vid(page, options):
data = json.loads(page)[u'data']
name = data[u'name_cn'].encode('UTF-8') + '.mp4'
hashid = str(data[u'hashid'])
if options & moonplayer.OPT_QL_SUPER:
p = 737280 # 720p
elif options & moonplayer.OPT_QL_HIGH:
p = 491520 # 480p
else:
p = 327680 # 320p
url = 'http://jobsfe.funshion.com/query/v1/mp4/%s.json?bits=%i' % (hashid, p)
moonplayer.get_url(url, parse_m_cb, (options, name))
开发者ID:1dot75cm,项目名称:repo,代码行数:12,代码来源:plugin_funshion.py
示例18: parse_series_cb
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)
开发者ID:stamhe,项目名称:moonplayer,代码行数:12,代码来源:plugin_youku.py
示例19: parse_album2_cb
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)
开发者ID:jinagko,项目名称:moonplayer,代码行数:12,代码来源:plugin_youku.py
示例20: parse_cdnlist
def parse_cdnlist(page, data):
result = data['result']
cdnlist = data['cdnlist']
url = str(json.loads(page)[u'url'])
i = len(result) / 2
result.append(data['name'] + '_' + str(i) + '.mp4')
result.append(url)
if i < len(cdnlist):
moonplayer.get_url(cdnlist[i], parse_cdnlist, data)
elif data['options'] & moonplayer.OPT_DOWNLOAD:
moonplayer.download(result, data['name'] + '.mp4')
else:
moonplayer.play(result)
开发者ID:kissthink,项目名称:repo,代码行数:13,代码来源:plugin_sohu.py
注:本文中的moonplayer.get_url函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论