caolvchong-top / twitter_download

推特 图片 视频 爬虫;一键下载
330 stars 38 forks source link

main.py-108行无法获取用户数据 #55

Closed brlve closed 3 months ago

brlve commented 3 months ago

cookie正确,但是无法获取数据。该url返回值为空,response=''

main.py的get_other_info函数无法获取用户信息,第108行 response = httpx.get(url, headers=_headers, proxies=proxies).text

caolvchong-top commented 3 months ago

可以看一下报错的截图吗?如果有修改代码的话请贴一下修改后的部分

brlve commented 3 months ago

发生异常: UnboundLocalError local variable 'response' referenced before assignment TimeoutError: _ssl.c:980: The handshake operation timed out

The above exception was the direct cause of the following exception:

httpcore.ConnectTimeout: _ssl.c:980: The handshake operation timed out

The above exception was the direct cause of the following exception:

File "E:\test1\twitter_download-main\main.py", line 108, in get_other_info response = httpx.get(url, headers=_headers, proxies=proxies).text httpx.ConnectTimeout: _ssl.c:980: The handshake operation timed out

During handling of the above exception, another exception occurred:

File "E:\test1\twitter_download-main\main.py", line 117, in get_other_info print(response) File "E:\test1\twitter_download-main\main.py", line 336, in main if not get_other_info(_user_info): File "E:\test1\twitter_download-main\main.py", line 378, in main(User_info(i)) UnboundLocalError: local variable 'response' referenced before assignment

caolvchong-top commented 3 months ago

httpx版本的问题,具体可以参见这里 #23

换成0.23.0就行了

caolvchong-top commented 3 months ago

可以看一下配置文件吗

caolvchong-top commented 3 months ago
PixPin_2024-06-03_01-38-39

cookie的auth_token ,多打了一个a

brlve commented 3 months ago

。。。。不好意思。。。耽搁你了。谢谢谢谢