linux下goagent相关错误解决

来源:互联网 发布:mac草莓红是什么色号 编辑:程序博客网 时间:2024/04/28 00:24

firefox使用goagent:

1. fixfox+goagent+foxyproxy

错误一:

Traceback (most recent call last):
File "proxy.py", line 2681, in <module>
main()
File "proxy.py", line 2652, in main
CertUtil.check_ca()
File "proxy.py", line 348, in check_ca
if CertUtil.import_ca(capath) != 0:
File "proxy.py", line 317, in import_ca
return os.system('cp "%s" "%s" && update-ca-certificates' % (certfile, new_certfile))

解决:

根据文章 webpy 解决中文出现UnicodeDecodeError: 'ascii' codec can't decode byte 问题 在proxy.py中加入
reload(sys)
sys.setdefaultencoding('utf-8')

错误二:

Traceback (most recent call last):
File "proxy.py", line 831, in <module>
common = Common()
File "proxy.py", line 757, in __init__
self.PROXY_PORT = int(proxyport)
ValueError: invalid literal for int() with base 10: ''
Exception KeyError: KeyError(148685804,) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored

解决:

在ubuntu下要用sudo python proxy.py 启动

错误三:

chrome下, 一些网站打开一些网站呈如下的情况:
 

解决:

这种情况主要是, 该网站的CSS, 没有加到SwitchySharp的规则列表, 所以被墙. Chrome 下通过右击——查看网页源代码, 在里面查找 .css 文件就可以了 (如: youtube, *://*.ytimg.com/*). 主要参考文章  Chrome下YouTube网页排版混乱.

错误四:

出现403. That’s an error, 参考 goagent打开页面出现403错误

解决:

修改proxy.ini, 在[ipv4/hosts]下找到对应网址, 将google_cn改成google_hk
例如:
code.google.com = google_cn    改成   code.google.com = google_hk

错误五:SSL安全错误

SSL安全错误

解决:

参考 解决GoAgent打开https网站SSL证书错误 (安全证书不受信任)

错误六: linux 下上传uploader失败

urllib2.URLError: <urlopen error [Errno timed out] counld not connect to 'appengine.google.com'>

解决:

(1) cd /etc
删除hosts或mv hosts hosts.bak
(2) 同时记得使用python2 uploader.zip, 即使python链接到python2.7

原创粉丝点击