Skip to content

Parameter List

ShortLongTypeDescription
-c--configFILEPath to the configuration file, lowest priority
-u--urlTEXTProvide the corresponding link based on the mode
-p--pathTEXTSave location for posts
-f--folderizeBOOLEANWhether to save posts in separate folders
-M--modeENUMDownload mode
-n--namingTEXTGlobal file naming format for posts
-k--cookieTEXTLogged-in session cookie
-e--timeoutINTEGERNetwork request timeout duration
-r--max_retriesINTEGERNumber of retries for timed-out network requests
-x--max-connectionsINTEGERNumber of concurrent network connections
-t--max-tasksINTEGERNumber of asynchronous tasks
-o--max-countsINTEGERMaximum number of posts to download
-s--page-countsINTEGERNumber of posts fetched per page
-l--languagesENUMDisplay language
-P--proxiesTEXT...Proxy servers
--update-configBOOLEANUpdate configuration file
--init-configTEXTInitialize configuration file
--auto-cookieENUMAutomatically retrieve the cookie
-hFLAGDisplay rich-text help
--helpFLAGShow help message and exit

Detailed Explanation

--config

Path to the configuration file, lowest priority. The default configuration file path is f2/conf/app.yaml. Supports both absolute and relative paths.

--url

Provide the corresponding link based on the selected mode.

--path

Save location for posts. The default is Download in the current directory. Supports absolute and relative paths.

--folderize

Whether to save posts in separate folders. Default is true.

--mode

Download modes:

  • one: Single post
  • post: Homepage posts

--naming

Global file naming format for posts. The default format is {create}_{desc}. Supported variables:

  • {nickname}: User nickname
  • {create}: Post creation time
  • {weibo_id}: Weibo post ID
  • {desc}: Post description
  • {uid}: User ID

Supported separators: _, -.

💡 Tip

Logged-in session Cookie. Most APIs require login, so a valid Cookie must be provided.

🔗 See the image below for how to retrieve your Cookie.

Console Cookie

💡 Tip

  • If data collection fails or you get restricted, update your Cookie promptly.
  • The Cookie should only contain ASCII characters; check carefully before updating.
  • Some APIs do not require login and allow guest Cookies. See: Generate Guest Cookie 🟢.

‼️ Warning ‼️

  • Never share your Cookie in Discussions, Issues, Discord, or any public forum.
  • Anyone with your Cookie can log into your account.
  • If leaked, log out immediately and sign back in to invalidate it.

--timeout

Network request timeout duration. Default is 10 seconds.

--max_retries

Number of retries for timed-out network requests. Default is 5 times.

--max-connections

Number of concurrent network connections. Default is 10.

--max-tasks

Number of asynchronous tasks. Default is 5.

--max-counts

Maximum number of posts to download. Set to None or 0 for unlimited. Default is 0.

--page-counts

Number of posts fetched per API request. It is not recommended to exceed 20. Default is 20.

--languages

Specifies the display language. Default is zh_CN. Supported options: zh_CN, en_US. This cannot be modified in the configuration file.

--proxies

Configure the proxy server, supporting up to two parameters, corresponding to the http:// and https:// protocols.

Example: --proxies http://x.x.x.x https://x.x.x.x

IMPORTANT ❗❗❗

If the proxy does not support egress HTTPS, use: --proxies http://x.x.x.x http://x.x.x.x.

--update-config

Update configuration files via CLI parameters. For details, see: Configuring Cookies

--init-config

Initialize the high-frequency configuration file. See: Initialize Config File

Automatically obtain cookie from the browser. Please make sure to close the selected browser before using this command. Supported browsers include:

  • chrome
  • firefox
  • edge
  • opera
  • opera_gx
  • safari
  • chromium
  • brave
  • vivaldi
  • librewolf

Not supported to switch browser user settings.

IMPORTANT ❗❗❗

  • Due to an update to the Chromium security policy, the Cookie encryption version has been upgraded to V20. Causes the --auto-cookie command to temporarily fail to fetch browser cookies issued after August 15, 2024.
  • Please update F2 to the latest version to get the latest fix.
  • If you do not wish to upgrade, you can refer to the PR below to manually install the dependencies of the fixed version.
  • borisbabic/browser_cookie3#215
  • As of 2024/dec/23, the fix still does not support the latest Chromium kernel version, please use a different browser or downgrade the browser version to before v128.
🔗 Example: Manually update Cookie.
shell
f2 wb -k "your_cookie" -c your_config.yaml --update-config

Released under the Apache-2.0 license.