From b4614390f147ae7eedace092342c438747435080 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 30 Jul 2014 22:53:22 +0200 Subject: [PATCH] Nicovideo: fix URLs with parameters --- src/you_get/extractors/nicovideo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/you_get/extractors/nicovideo.py b/src/you_get/extractors/nicovideo.py index f99a54b8..1a93693d 100644 --- a/src/you_get/extractors/nicovideo.py +++ b/src/you_get/extractors/nicovideo.py @@ -30,7 +30,8 @@ context=ssl.SSLContext(ssl.PROTOCOL_TLSv1)) html = get_html(url) # necessary! title = unicodize(r1(r'([^<]+)', 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)