iambus / youku-lixian

优酷下载脚本,顺便支持其他……
Other
849 stars 265 forks source link

土豆下载出错 #14

Closed liukangxu closed 12 years ago

liukangxu commented 12 years ago

root@Route:/opt# python /opt/bin/video_lixian.py --playlist http://www.tudou.com/playlist/p/a67146i91771627.html Downloading 1 of 24 videos... Traceback (most recent call last): File "/opt/bin/video_lixian.py", line 48, in main() File "/opt/bin/video_lixian.py", line 45, in main script_main('video_lixian', any_download, any_download_playlist) File "/opt/bin/common.py", line 244, in script_main download_playlist(url) File "/opt/bin/video_lixian.py", line 42, in any_download_playlist m.download_playlist(url) File "/opt/bin/tudou.py", line 64, in tudou_download_playlist tudou_download_by_iid(id, title) File "/opt/bin/tudou.py", line 18, in tudou_download_by_iid download_urls([url], title, 'flv', total_size=None) File "/opt/bin/common.py", line 175, in download_urls if os.path.exists(filepath) and os.path.getsize(filepath) >= total_size * 0.9: File "/opt/lib/python2.7/genericpath.py", line 18, in exists os.stat(path) UnicodeEncodeError: 'ascii' codec can't encode characters in position 2-7: ordinal not in range(128)

liukangxu commented 12 years ago

似乎是编码问题?

iambus commented 12 years ago

可能是因为路由器的默认编码是ascii。我改了点代码,对ascii强制使用utf-8。你可以试试管不管用。

liukangxu commented 12 years ago

测试可用,另外请教一下,如何将DD-WRT的默认编码修改为utf-8?

iambus commented 12 years ago

不清楚……我也没改这个。