Common Issues and Solutions
Empty Response on the nth Request
An empty response on the nth request is related to cookie
settings.
🔗 Solution
- Check the
cookie
value in theapp
configuration file for incorrect characters (e.g., newlines, spaces, non-ASCII characters). - The Douyin web
cookie
has over60
keys, while TikTok's webcookie
has fewer than30
. A shortcookie
will likely cause issues. - When using
--auto-cookie
, ensure the browser is logged in with a normal account, as guest account cookies are unstable. - If you used QR code login in the app, the cookie might expire due to device environment risk control. Re-generate the
cookie
with--auto-cookie
. - In versions before
0.0.1.2
, custom config filecookies
may not be recognized correctly.
Cookie
retrieval method: See the image below.
API Rate Limit Error
If you encounter API Rate Limit Error
, simply wait and retry. This error is caused by too frequent requests being throttled by the server.
If it continues, log in again on the web and retrieve a new cookie
. If still ineffective, switch networks or accounts.
Reference Links:
<urlopen error [Errno 11001] getaddrinfo failed>
This issue is related to local network connection problems. Check if your network and DNS
are functioning correctly. Ensure your proxy is properly configured.
f2: command not found
On non-Windows
systems, if you encounter f2: command not found
, it means the f2
command is not in your system’s PATH.
🔗 Solution
Run which f2
to find the path of f2
and add it to your environment variable.
- Edit the
~/.bashrc
file to addexport PATH="$PATH:/home/YOUR_NAME/.local/bin"
. - Run
source ~/.bashrc
to apply the changes. - Reopen the terminal and use the
f2
command.
WARNING: No matching works were found
If you see WARNING: No matching works were found
, check if you have configured the interval
parameter correctly.
🔗 Solution
- Ensure
interval: all
is set if theinterval
parameter is missing. - If
interval
is present, verify its value. - The
-i
flag also sets the content filter. Set it to-i all
. - If you use
-i
, ensure it's configured correctly.
Reference Links:
- https://github.com/Johnserf-Seed/f2/issues/42
- https://github.com/Johnserf-Seed/TikTokDownload/issues/660
EOF occurred in violation of protocol (_ssl.c:992)
This indicates an SSL handshake failure.
Non-project issue, multiple possible causes need investigation.
🔗 Solution
- Check if your proxy settings are correct and not blocking the
SSL/TLS
handshake. - Ensure a stable proxy connection.
- Use more professional proxy tools.
- Switch networks.
- Try changing
DNS
servers. - If the issue is related to the
httpx
library version, try downgradinghttpx
. - If using tools like
Postman
orcurl
can access the API but the project times out, see item6
.
_ssl.c:975 The handshake operation timed out
This indicates an SSL
handshake timeout, often caused by unstable network connections or high latency.
Non-project issue, requires investigation.
🔗 Solution
- Ensure stable network connection and low latency.
- Check server status for responsiveness.
- Verify firewall and proxy settings.
- Adjust timeout settings.
tiktok 403 Forbidden
A 403 Forbidden
error when downloading TikTok videos occurs due to the device_Id
being banned.
Device IDs are tied to cookies
, and a banned device ID results in invalid cookies.
🔗 Solution
- Regenerate the
device_Id
. - Replace the old
device_Id
in the config file with the new one. - Incrementally update the
cookie
values in the config file, rather than overwriting them. - Retry the download command.
Reference Links:
- https://f2.wiki/guide/apps/tiktok/overview#生成deviceid-🟢
- https://github.com/Johnserf-Seed/f2/issues/79
- https://github.com/Johnserf-Seed/f2/issues/154
TypeError: object of type 'NoneType' has no len()
You may see errors like this in the terminal:
Due to API updates, some fields failed:
Field weibo_read_count: object of type 'NoneType' has no len()
Field weibo_topic_title: object of type 'NoneType' has no len()
This occurs when the API field has changed and no longer exists or is different.
🔗 Please report the issue in the Issue tracker with the following information:
- Debug logs (
f2 -d DEBUG [app_name]
):- Complete error message and context.
- A description of the problematic fields:
- Clearly indicate which fields are problematic and may need updating.
- Simplified response data structure (optional):
- Provide the approximate location of the fields in the API response.
Once feedback is received, the issue will be addressed in the next version, or you can submit a PR.
twitter 403 Forbidden
A 403 Forbidden
error when downloading Twitter posts is caused by an expired cookie
or X-Csrf-Token
.
🔗 Solution
- Regenerate the
cookie
andX-Csrf-Token
. - Update the
cookie
andX-Csrf-Token
in the config files. - Retry the download command.
The X-Csrf-Token
is in the F2 config file (conf.yaml)
, while the cookie is in the app's main or custom config files.
Installing build dependencies error
When installing dependencies, you may encounter an error like this:
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
Looking in indexes: https://xxxx
ERROR: Could not find a version that satisfies the requirement hatchling (from versions: none)
ERROR: No matching distribution found for hatchling
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
This error occurs because pip
cannot find the build dependencies.
🔗 Solution
- Switch to the official PyPI source:
pip config unset global.index-url
- Reinstall the project:
pip install f2
or
pip install -e .