Open wz520 opened 12 years ago
简单看了下,他们搞的有点复杂,一时看不明白。只能有空再说了。
做了个丑丑的patch,貌似给暂时解决了。。。返回的data['videosize']不是视频真实大小,不懂为嘛。。。实在搞不定这评论系统的markdown格式,丢pastebin上算了。。http://pastebin.com/BkQugSVH
呃上面那正则太丑了,换这个吧>_< https://github.com/radaiming/youku-lixian/blob/master/ku6.py
谢谢~,终于能下载了~^^ 不过进度条指示好像有点问题。明明还没下载完就显示 100% 了,要过一会儿才真正下载完。 看了一下新的 ku6.py ,有这样的代码: if len(urls) == 1: size = int(re.search(r'\d+$',str(data['videosize'])).group(0))_0.38 else: size = int(re.search(r'\d+$',str(data['videosize'])).group(0))_0.22 不知道为什么这里要乘个小数。改成 size = float(re.search(r'\d+$',str(data['videosize'])).group(0)) 进度条就正常了
E:\youku-lixian\iambus-youku-lixian-8058707>ku6 http://v.ku6.com/show/KSYMbPaXn-BMuzFZuYLd1g...html Traceback (most recent call last): File "E:\youku-lixian\iambus-youku-lixian-8058707\ku6.py", line 33, in
main()
File "E:\youku-lixian\iambus-youku-lixian-8058707\ku6.py", line 30, in main
script_main('ku6', ku6_download)
File "E:\youku-lixian\iambus-youku-lixian-8058707\common.py", line 291, in script_main
download(url, merge=merge)
File "E:\youku-lixian\iambus-youku-lixian-8058707\ku6.py", line 24, in ku6_download
ku6_download_by_id(id, merge=merge)
File "E:\youku-lixian\iambus-youku-lixian-8058707\ku6.py", line 10, in ku6_download_by_id
data = json.loads(get_html('http://v.ku6.com/fetchVideo4Player/%s...html'%id))['data']
File "E:\youku-lixian\iambus-youku-lixian-8058707\common.py", line 56, in get_html
content = get_response(url).data
File "E:\youku-lixian\iambus-youku-lixian-8058707\common.py", line 46, in get_response
response = urllib2.urlopen(url)
File "D:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "D:\Python27\lib\urllib2.py", line 400, in open
response = meth(req, response)
File "D:\Python27\lib\urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "D:\Python27\lib\urllib2.py", line 438, in error
return self._call_chain(_args)
File "D:\Python27\lib\urllib2.py", line 372, in _call_chain
result = func(_args)
File "D:\Python27\lib\urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found