caolvchong-top / twitter_download

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

运行错误:IndexError: list index out of range #13

Closed Sheng-Charles closed 10 months ago

Sheng-Charles commented 10 months ago

Exception has occurred: IndexError list index out of range File "I:\huanjingbianliang\123123123\main.py", line 249, in main _headers['x-csrf-token'] = re.findall(re_token,_headers['cookie'])[0]


  File "I:\huanjingbianliang\123123123\main.py", line 272, in <module>
    main(User_info(i))
IndexError: list index out of range

旧版本一直闪退,刚更新后提示这个,但是cookie是刚刷新出来的,也加了转译。请问这个怎么解决?我发给GPT试着自己解决但实在是看不懂::(
caolvchong-top commented 10 months ago

这个是cookie格式错误 或是 cookie中缺少 ct0 字段

程序所需的cookie中必须要有 auth_tokenct0 两个字段,部分网页请求的cookie可能没有 ct0 字段,可以检查一下你复制的cookie内容

格式可以参见这里 #10

Sheng-Charles commented 10 months ago

检查了一下,两个字段都有,格式试过完整cookie,也试过只保留 auth_token 和 ct0 ,都是那个提示 image image

caolvchong-top commented 10 months ago

看一下ct0的末尾有加分号吗? ct0=xxxxxxxxxx;

Sheng-Charles commented 10 months ago

牛比!可以了!!谢谢谢谢