FLEXGET RSS 中文文件名报错求助
FLEXGET 抓取其它站RSS种子都没问题 在CCF至今只能下下来2个没有中文的种子以下是出错信息从6行开始2013-03-20 23:31 VERBOSEtask CCF HAND ACCEPTED: `1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】` by accept_all plugin
2013-03-20 23:31 INFO download CCF HAND Downloading: 1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】
2013-03-20 23:31 VERBOSEdetails CCF HAND Summary - Accepted: 1 (Rejected: 0 Undecided: 0 Failed: 0)
2013-03-20 23:31 ERROR entry CCF HAND Failed 1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】 (None)
2013-03-20 23:31 VERBOSEtask CCF HAND FAILED: `1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】` by download plugin
2013-03-20 23:31 ERROR download CCF HAND Exception while writing: 'ascii' codec can't encode characters in position 90-95: ordinal not in range(128)
Traceback (most recent call last):
File "/opt/local/lib/python2.7/site-packages/flexget/plugins/output/download.py", line 339, in on_task_output
self.output(task, entry, config)
File "/opt/local/lib/python2.7/site-packages/flexget/plugins/output/download.py", line 426, in output
if os.path.exists(destfile):
File "/opt/lib/python2.7/genericpath.py", line 18, in exists
os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 90-95: ordinal not in range(128)
2013-03-20 23:31 INFO remember_rejCCF HAND Remembering rejection of `1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】` for 60 minutes
2013-03-20 23:31 VERBOSEtask CCF HAND REJECTED: `1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】` by retry_failed plugin because waiting before trying failed entry again. (failure reason: Unknown)
2013-03-20 23:31 INFO task CCF HAND Plugin retry_failed has requested task to be ran again after execution has completed.
2013-03-20 23:31 VERBOSEemail CCF HAND No content generated from template, not sending email.
2013-03-20 23:31 INFO task CCF HAND Rerunning the task in case better resolution can be achieved.
2013-03-20 23:31 VERBOSEinput_cache CCF HAND Restored 1 entries from cache
2013-03-20 23:31 VERBOSEdetails CCF HAND Produced 1 entries.
2013-03-20 23:31 VERBOSEtask CCF HAND REJECTED: `1900(Novecento).35th.Anniversary.1976.Blu-ray.720p.x264.DTS-MySiLU【【一九〇〇 PART I】 因大胆的尺度 被长期禁映】` by remember_rejected plugin because rejected on behalf of retry_failed plugin: Waiting before trying failed entry again. (failure reason: Unknown)
貌似跟python及中文文件名有关请达人指点一二 拜谢 我的也是出现这种情况,hdroad站中文的也都不行。 本帖最后由 宿醉冇醒 于 2013-3-21 23:10 编辑
现在找到了一个解决办法,你不烦试一下:
修改/opt/lib/python2.7/site.py文件(改前先备份下):
把setencoding函数改成这样:def setencoding():
"""Set the string encoding used by the Unicode implementation.The
default is 'ascii', but if you're willing to experiment, you can
change this."""
encoding = "utf-8" # Default value set by _PyUnicode_Init()
sys.setdefaultencoding(encoding) # Needs Python Unicode build !说明一点:我只在我机器上测试成功,试了后请回复结果如何。我机器已设置支持中文交互。
宿醉冇醒 发表于 2013-3-21 23:06 static/image/common/back.gif
现在找到了一个解决办法,你不烦试一下:
修改/opt/lib/python2.7/site.py文件(改前先备份下):
把setencod ...
哈哈 又麻烦到你了不好意思
用你的说的方法修改了site.py --test成功 实测失败,reboot,仍然失败,囧
另外可否告知解决思路 参考资料网站什么的
本帖最后由 宿醉冇醒 于 2013-3-23 00:36 编辑
coolseetee 发表于 2013-3-22 22:48 static/image/common/back.gif
哈哈 又麻烦到你了不好意思
用你的说的方法修改了site.py --test成功 实测失败,reboot,仍然失败,囧
还有一办法:
建一文件:/opt/lib/python2.7/sitecustomize.py# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')参考资料:
http://wangye.org/blog/archives/629/
http://shirley-ren.iteye.com/blog/1018750
这样就应该可以了::~# python2.7
Python 2.7.3 (default, Apr 12 2012, 13:08:47)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'实在不行,试着改下py文件,把encode强制为utf8
/opt/local/lib/python2.7/site-packages/flexget/plugins/output/download.py 宿醉冇醒 发表于 2013-3-23 00:15 static/image/common/back.gif
还有一办法:
建一文件:/opt/lib/python2.7/sitecustomize.py参考资料:
http://wangye.org/blog/archiv ...
还是没能解决 不过有进展了root@bOsOn-NAS:~# top
Mem: 245688K used, 2844K free, 0K shrd, 2584K buff, 80344K cached
CPU:15% usr 8% sys 0% nice 0% idle68% io 0% irq 8% softirq
Load average: 1.40 1.40 1.33
PIDPPID USER STAT VSZ %MEM %CPU COMMAND
4133 1 root S 149M61%21% /opt/bin/transmission-daemon -g /root/.config/transmission-daemon
2302 1 root S 2724011% 0% /usr/bin/python /usr/local/sbin/BuffaloXMLRPCServer.pyc --skip-auth
在使用top查看进程的时候发现 系统运行的python不是安装opt目录的root@bOsOn-NAS:~# python
Python 2.6.2 (r262:71600, Sep3 2009, 11:18:18)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
运行python命令 返回的版本是2.6root@bOsOn-NAS:~# find / -name python2.6
/usr/include/python2.6
/usr/bin/python2.6
/usr/lib/python2.6
root@bOsOn-NAS:~# find / -name python2.7
/mnt/disk1/.optware/lib/python2.7
/mnt/disk1/.optware/bin/python2.7
/mnt/disk1/.optware/include/python2.7
/mnt/disk1/.optware/local/lib/python2.7
/opt/lib/python2.7
/opt/bin/python2.7
/opt/include/python2.7
/opt/local/lib/python2.7
使用find查找python2.6 python2.7 可以看到两个版本同时存在 FLEXGET运行的时候可能调用的是2.6版本
具体这两个版本是怎么发挥作用的我还不懂
按上面提到的方法尝试在/usr/lib/python2.6、site-packages文件夹下新建一个sitecustomize.py,内容如下# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8') 因为牵扯到系统本身,现在还没有reboot,怕reboot了之后就不亮了,{:7_185:}
看资料说重启python解释器即可 没有找到相应的命令 请大神先帮我看看这样改靠谱不
coolseetee 发表于 2013-3-23 18:00 static/image/common/back.gif
还是没能解决 不过有进展了在使用top查看进程的时候发现 系统运行的python不是安装opt目录的运行python命 ...
两个地方都改一下吧,我运行python也是2.6版本的,是固件里带的。~# python
Python 2.6.2 (r262:71600, Sep3 2009, 11:18:18)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'看到是utf-8了就可以了。python就是运行解释器。
sitecustomize.py有可能是放/usr/lib/python2.6目录,也可能放/usr/lib/python2.6/site-packages目录,你自己试试。 >>> sys.getdefaultencoding()
已经返回utf-8了
还是报错 可能跟没重启有关
刚发了个种子 出种以后再试 不行准备重装FLEXGET试试了
页:
[1]