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

WARNING 第 N 次响应内容为空 #703

Open
ZX828 opened this issue Apr 19, 2024 · 3 comments
Open

WARNING 第 N 次响应内容为空 #703

ZX828 opened this issue Apr 19, 2024 · 3 comments
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems)

Comments

@ZX828
Copy link

ZX828 commented Apr 19, 2024

我遇到了 WARNING 第 N 次响应内容为空
按照 QA文档 https://johnserf-seed.github.io/f2/question-answer/qa.html 设置了cookie
cookie: 'douyin.com; xgplayer_user_id=
但还是相应为空
WARNING 第 5 次响应内容为空, 状态码: 200,
URL:https://www.douyin.com/aweme/v1/web/aweme/favorite/?device_platfor
yaml的位置是这样的,不知道是不是我路径写错了没找到。
image

###有没有能从程序里获取到配置信息的方法啊?方便检查配置文件是不是有问题的那种?
这个labels能不能没有?我这只算问问题,不算是提交故障或者建议吧……
image

@ZX828 ZX828 added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Apr 19, 2024
@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Apr 19, 2024

代码片段里就是直接从代码获取数据的方法,配置cookie就可以。直接检查配置文件是否有问题输入命令查看f2 -d DEBUG dy -c 配置文件路径

@ZX828
Copy link
Author

ZX828 commented Apr 19, 2024

命令我不会用,所以我把配置文件里的
image
来回改了几次,貌似没什么变化。
所以应该是配置没生效。
image
我的配置文件为什么不生效啊?
我除了配置文件的路径,其他的都是从示例复制的,到底是哪的问题呢?

@ZX828 ZX828 closed this as completed Apr 21, 2024
@ZX828 ZX828 reopened this Apr 21, 2024
@Johnserf-Seed
Copy link
Owner

你可以像这样从配置文件生成kwargs

import asyncio
from f2.apps.douyin.handler import DouyinHandler
from f2.utils.conf_manager import ConfigManager

kwargs = {
    "headers": {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36",
        "Referer": "https://www.douyin.com/",
    },
    "proxies": {"http://": None, "https://": None},
    "timeout": 10,
    "cookie": "YOUR_COOKIE_HERE",
}

kwargs |= ConfigManager("你的自定义配置路径").get_config("douyin")

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems)
Projects
None yet
Development

No branches or pull requests

2 participants