Skip to content

Parameter list

Short parameterLong parameterTypeDescription
-c--configFILEProfile path, lowest priority
-u--urlTEXTLinks are provided according to the pattern
-m--musicBOOLEANWhether to save the original audio of the video
-v--coverBOOLEANWhether to save video cover
-d--descBOOLEANWhether to save the video desc
-p--pathTEXTThe location where the video is saved
-f--folderizeBOOLEANWhether to save the work in a separate folder
-M--modeENUMDownload mode
-n--namingTEXTGlobal video file naming method
-k--cookieTEXTLogged in cookie
-i--intervalTEXTDownload date range
-w--keywordTEXTSearch keywords for searching works
-e--timeoutINTEGERNetwork request timeout
-r--max_retriesINTEGERNetwork request timeout retry count
-x--max-connectionsINTEGERNetwork request concurrent connection count
-t--max-tasksINTEGERAsynchronous task count
-o--max-countsINTEGERMaximum number of downloads
-s--page-countsINTEGERNumber of works per page
-l--languagesENUMDisplay language
-P--proxiesTEXT...Proxy server
--update-configBOOLEANUpdate configuration file
--init-configTEXTInitialize configuration file
--auto-cookieENUMAutomatically obtain cookies
-hFLAGDisplay rich text help
--helpFLAGDisplay the help message and exit

Detailed Description

--config

Specify the path to the configuration file, with the lowest priority. The default path for the main configuration file is f2/conf/app.yaml, which supports absolute paths and relative paths.

--url

Links are provided according to the pattern. For example, fill in the homepage link for homepage, likes, and favorite works, fill in the link of the work for a single work, and the collection is the same as for the live broadcast.

--music

Whether to save the original audio of the video. The default is true.

--cover

Whether to save the video cover. The default is true. Only save the cover in the original size.

--desc

Whether to save the video copy. Defaults to true. Keep the original desc information.

--path

The location where the video is saved. Defaults to Download in the current directory. Supports absolute paths and relative paths.

--folderize

Whether to save the work to a separate folder. Defaults to true.

--mode

Download mode:

  • one:a single video
  • post:homepage videos
  • like:liked videos
  • collect:favorite video
  • mix:playlist
  • search:search videos
  • live:live broadcast

--naming

Global work file naming method. The default is {create}_{desc}, supported variables include: {nickname}, {create}, {aweme_id}, {desc}, {uid}. Supported separators include: _, -.

  • {nickname}: author’s nickname
  • {create}: creation time of the work
  • {aweme_id}: work ID
  • {desc}: work copywriting
  • {uid}: Author ID

Cookie after login. Most interfaces require logging in to obtain data, so a Cookie after logging in is required.

🔗 Please see the figure below for how to obtain Cookie.

Console Cookie

💡 Tips

  • Please update Cookie in time when collection or risk control cannot be performed.
  • Characters other than ascii are not allowed. Please check carefully before updating the configuration.

‼️ warning ‼️

  • Never share your Cookie in Discussions, Issues, Discord and other public places, and be careful to delete sensitive information.
  • Anyone who gets your Cookie can log in to your account directly.
  • When a leak occurs, please log out of your account immediately and log in again.

--interval

Download works published within a date range, in the format: Year-Month-Day|Year-Month-Day. For example: 2022-01-01|2023-01-01, set all to download all works.

--keyword

Search for keywords to search for works.

--timeout

Network request timeout. Default is 10 seconds.

--max_retries

Network request timeout retry count. The default is 5 times.

--max-connections

Network request concurrent connection number. Default is 10.

--max-tasks

The number of asynchronous tasks. Default is 5.

--max-counts

Maximum number of work downloads. Set to None or 0 for no limit. Default is 0.

--page-counts

The number of works that can be obtained from each page of the interface is not recommended to exceed 20. Default is 20.

--languages

Specify the display language. The default value is zh_CN, supports options: zh_CN and en_US, does not support modification through configuration files.

--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 tk -k "your_cookie" -c your_config.yaml --update-config

Released under the Apache-2.0 license.