Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【提问】{代理端口} #6

Closed
wanghaisheng opened this issue May 19, 2022 · 5 comments
Closed

【提问】{代理端口} #6

wanghaisheng opened this issue May 19, 2022 · 5 comments

Comments

@wanghaisheng
Copy link

Python 版本: 3.x

模块版本: x.x.x

运行环境: Windows / Linux


Traceback (most recent call last):
  File ".\bilisearch.py", line 175, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "D:\Program Files\anaconda3\envs\autopub\lib\asyncio\base_events.py", line 608, in run_until_complete
    return future.result()
  File ".\bilisearch.py", line 158, in main
    r = await misc.web_search_by_type(k,'video')
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\bilibili_api\misc.py", line 36, in web_search_by_type
    return await request('GET', url=api["url"], params=params)
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\bilibili_api\utils\network.py", line 111, in request
    async with session.request(**config) as resp:
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\client.py", line 520, in _request
    conn = await self._connector.connect(
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\connector.py", line 890, in _create_connection
    _, proto = await self._create_proxy_connection(req, traces, timeout)
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\connector.py", line 1073, in _create_proxy_connection
    transport, proto = await self._create_direct_connection(
  File "D:\Program Files\anaconda3\envs\autopub\lib\site-packages\aiohttp\connector.py", line 1011, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host {proxy}:80 ssl:default [getaddrinfo failed]
    proxypool='https://proxypool.scrape.center/random'

    proxy = requests.get(proxypool).text
    print(proxy,'========')
    settings.proxy = "http://{proxy}" # 里头填写你的代理地址
    r = await misc.web_search_by_type(k,'video')
@Nemo2011
Copy link
Owner

对不起,能不能发一下代理网址,还有运行时究竟是 Windows 上报错还是 Linux 报错(就是用的是 Linux 运行还是 Windows 运行),蟹蟹。

@wanghaisheng
Copy link
Author

https://proxypool.scrape.center/random 就是这个啊
windows

@Nemo2011
Copy link
Owner

Nemo2011 commented May 24, 2022

    1. 你可以访问一下你的代理网址,上面只是返回一个可以用的代理网址,那个网址只是 API,真正的代理网址需要自己爬取
    1. 我发现,aiohttp 的代理支持是真的 TM 的懒,现在正在测试代理,再稍等几天新版本会发布,问题就应该解决了,请耐心等待。
    1. 用代理时先测试一下,不要到时候没法用。

@Nemo2011
Copy link
Owner

目前代理问题已解决!可以正常使用代理(至少我这里测试的代理可以用),功能一切正常。

@Nemo2011
Copy link
Owner

可以正常使用了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants