Nicovideo: fix URLs with parameters

This commit is contained in:
Mort Yao 2014-07-30 22:53:22 +02:00
parent c51f7b8aa0
commit b4614390f1

View File

@ -30,7 +30,8 @@ context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))
html = get_html(url) # necessary!
title = unicodize(r1(r'<span class="videoHeaderTitle">([^<]+)</span>', html))
api_html = get_html('http://www.nicovideo.jp/api/getflv?v=%s' % url.split('/')[-1])
vid = url.split('/')[-1].split('?')[0]
api_html = get_html('http://www.nicovideo.jp/api/getflv?v=%s' % vid)
real_url = parse.unquote(r1(r'url=([^&]+)&', api_html))
type, ext, size = url_info(real_url)