在我的 vpn 后面,http 代理:127.0.0.1:8118,我只是想从网站上的 ia 包的快速入门中获取示例:
https://archive.org/developers/tutorial-find-identifier-item.html https://github.com/jjjake/internetarchive/tree/master/internetarchive
Standalone,这总是工作正常,(所以我相信问题出在包而不是我的电脑上):
requests.get('http://google.com', proxies={'https'=127.0.0.1:8118'})
//ia 使用 HTTPS
我试过设置环境变量 HTTPS_PROXY:
HTTPS_PROXY='http://127.0.0.1:8118'
我只是想从网站上获取第一个工作示例(从 vpn 后面),非常简单:
from internetarchive import get_item
md = {'collection': 'test_collection', 'title': 'My New Item', 'mediatype': 'movies'}
r = item.upload('<identifier>', files=['film.txt', 'film.mov'], metadata=md, access_key='YoUrAcCEssKey', secret_key='youRSECRETKEY')
r[0].status_code
我一直在 ia 包周围挖掘在 requests.get(..., proxies={'http':127.0.0.1:8118' }) 中输入代理变量的地方,并在没有运气的情况下运行测试。 .
我在这里仍然没有运气。有什么建议吗?
session = internetarchive.ArchiveSession()
proxies = {'https': 'http://localhost:8888', 'http': 'http://localhost:8888'}
session.proxies.update(proxies)