qdf2 0.0.1.7
🚀Asynchronous based full-platform download tool
License: Apache-2.0
Requires Python: >=3.10
Keywords: async, bark, bilibili, crawler, douyin, download, downloader, f2, http, http proxy, https, internat, netease, tiktok, twitter, watermark, websockets, weibo, ws, wss, x

<p align="center">
  <img src="https://github.com/Johnserf-Seed/f2/raw/main/docs/public/f2-logo-with-shadow-svg@0.5x.svg" alt="Logo">
</p>

[![Downloads](https://pepy.tech/badge/f2/month)](https://pepy.tech/project/f2)
[![PyPI version](https://badge.fury.io/py/f2.svg)](https://badge.fury.io/py/f2)
[![Dev Branch](https://badgen.net/badge/branch/v0.0.1.7-pw2/blue)](https://github.com/Johnserf-Seed/f2/tree/v0.0.1.7-pw2)
[![Discord](https://img.shields.io/discord/1146473603450282004?label=Discord)](https://discord.gg/3PhtPmgHf8)
[![codecov](https://codecov.io/gh/Johnserf-Seed/f2/graph/badge.svg?token=T9DH4QPZSS)](https://codecov.io/gh/Johnserf-Seed/f2)
[![TikHub](https://img.shields.io/badge/%E8%B5%9E%E5%8A%A9%E5%95%86-TikHub-orange?style=flat-square&logo=tiktok)](https://beta-web.tikhub.io/users/signup?referral_code=6hLcGD94)
[![APACHE-2.0](https://img.shields.io/github/license/johnserf-seed/f2)](https://github.com/Johnserf-Seed/f2/blob/main/LICENSE)


[简体中文 readme](https://github.com/Johnserf-Seed/f2/blob/main/README.md) • [English readme](https://github.com/Johnserf-Seed/f2/blob/main/README.en.md)

`F2` 是一个 [Python](https://pypi.org/project/f2/) 库，提供多平台的作品下载与接口数据处理。支持 `DouYin`、`TikTok`、`Twitter`、`WeiBo` 等平台，且方便适配更多平台。

<img src='https://github.com/user-attachments/assets/92a70f27-c93f-422e-ba9a-040060323654'>

## 🚀 快速入门

### ⚙️ 安装

- [必备条件](https://f2.wiki/install#%E5%BF%85%E5%A4%87%E6%9D%A1%E4%BB%B6)
- [包管理器安装](https://f2.wiki/install#%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8%E5%AE%89%E8%A3%85)
- [编译安装](https://f2.wiki/install#%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85)

### ⚡ 快速使用

- [启动和运行](https://f2.wiki/quick-start#%E5%90%AF%E5%8A%A8%E5%92%8C%E8%BF%90%E8%A1%8C)
- [下一步是什么？](https://f2.wiki/quick-start#%E4%B8%8B%E4%B8%80%E6%AD%A5%E6%98%AF%E4%BB%80%E4%B9%88)

### 📋 配置文件

- [主配置文件](https://f2.wiki/site-config#%E4%B8%BB%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)
- [初始化配置文件](https://f2.wiki/site-config#%E5%88%9D%E5%A7%8B%E5%8C%96%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)
- [自定义配置文件](https://f2.wiki/site-config#%E8%87%AA%E5%AE%9A%E4%B9%89%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)
- [配置Cookie](https://f2.wiki/site-config#%E9%85%8D%E7%BD%AECookie)
- [配置文件的位置](https://f2.wiki/site-config#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E7%9A%84%E4%BD%8D%E7%BD%AE)
- [下一步是什么？](https://f2.wiki/site-config#%E4%B8%8B%E4%B8%80%E6%AD%A5%E6%98%AF%E4%BB%80%E4%B9%88)

### 💻 命令行

- [CLI临时配置](https://f2.wiki/cli#cli%E4%B8%B4%E6%97%B6%E9%85%8D%E7%BD%AE)
- [拓展](https://f2.wiki/cli#%E6%8B%93%E5%B1%95)
- [应用命令行](https://f2.wiki/cli#%E5%BA%94%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C)

### 📚 进阶用法

- [DouYin 批量采集直播流](https://f2.wiki/advance-guide#%E6%89%B9%E9%87%8F%E9%87%87%E9%9B%86%E7%9B%B4%E6%92%AD%E6%B5%81)
- [DouYin 直播弹幕转发](https://f2.wiki/advance-guide#%E7%9B%B4%E6%92%AD%E5%BC%B9%E5%B9%95%E8%BD%AC%E5%8F%91)
- 文档还在进一步更新中...

## 🧐 FAQ

- [常见问题](https://f2.wiki/faq)

## 👏 团队

- [团队介绍](https://f2.wiki/team)

### 📘 开发指南

- [开发者必看](https://f2.wiki/guide/what-is-f2)

### 📝 API示例

- [使用示例](https://f2.wiki/guide/api-examples)

### 🧩 开发者接口

- [Bark](https://f2.wiki/guide/apps/bark/)
- [DouYin](https://f2.wiki/guide/apps/douyin/)
- [TikTok](https://f2.wiki/guide/apps/tiktok/)
- [Twitter](https://f2.wiki/guide/apps/twitter/)
- [WeiBo](https://f2.wiki/guide/apps/weibo/)

### 🖥️ 命令行指引

- [Bark](https://f2.wiki/guide/apps/bark/cli)
- [DouYin](https://f2.wiki/guide/apps/douyin/cli)
- [TikTok](https://f2.wiki/guide/apps/tiktok/cli)
- [Twitter](https://f2.wiki/guide/apps/twitter/cli)
- [WeiBo](https://f2.wiki/guide/apps/weibo/cli)

## ✨ 新变化

当下载或升级到 `F2` 的不同版本时，请注意以下关键的版本更新。

<details>
  <summary>🛠️ v0.0.1.7-pw2</summary>

  - 🚀 **新增 Bark 应用支持**
    请前往 App Store 下载 [Bark](https://apps.apple.com/cn/app/id1403753865)，并在 [F2 配置文件](https://f2.wiki/site-config#%E4%B8%BB%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6) 中完成相关配置。
  - 🛡️ **开放 `ab` 算法**
    已开源满血版 `ab` 算法，支持自定义 `UA`。请确保自定义 `UA` 符合规范。
  - 📡 **新增直播弹幕转发功能**
    支持 `douyin` 与 `tiktok` 直播弹幕转发，请根据 [WSS 配置指南](https://f2.wiki/guide/what-is-f2#wss%E9%85%8D%E7%BD%AE) 完成相应参数配置。
  - 🔔 **启用通知推送**
    如需启用应用通知推送，请在 [F2 配置文件](https://f2.wiki/site-config#%E4%B8%BB%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6) 中设置 `enable_bark` 参数为 `true`。
  - 📄 **更多变更详情**
    请查看完整的 [ChangeLog](https://github.com/Johnserf-Seed/f2/blob/main/CHANGELOG.md#0017---2024-12-31)。
</details>

<details>
  <summary>📌 v0.0.1.6-pw2</summary>

  - 🛠️ **配置文件格式已更新**
    如果你使用旧版配置文件，请注意进行迁移。
  - 🌍 **时区标准化**
    所有时间戳的默认时区已设置为 `UTC/GMT+08:00`。
  - 📁 **文件格式调整**
    - `douyin` 直播流文件名调整为 `flv`。
    - 图集格式调整回 `webp`。
  - 🔄 **错误修复**
    修复了 `tiktok` 视频地址 `403` 错误。
    👉 [了解更多解决方案](https://f2.wiki/faq#tiktok-403-forbidden)
  - 🛡️ **算法优化**
    `douyin` 现在默认使用 `ab` 算法进行请求。（满血版 `ab` 算法即将开源）
  - 📄 **更多变更详情**
    👉 [查看 ChangeLog](https://github.com/Johnserf-Seed/f2/blob/main/CHANGELOG.md#0016---2024-05-04)
</details>

<details>
  <summary>📡 v0.0.1.5-pw2</summary>

  - 🛡️ **自定义 UA 支持**
    `XBogus` 参数现在支持自定义 `UA`，请确保 `UA` 符合规范。
  - 📊 **数据库重建**
    重建后的数据库包含接口的原始数据。
    👉 如需保留旧记录，请注意迁移或备份。
  - 🔄 **返回类型统一**
    所有 `fetch` 方法的返回类型已统一为过滤器类型，请注意相关变化。
  - 🛠️ **新功能**
    添加了 `_to_raw` 方法，可将过滤器转换为原始接口数据。
  - 📝 **文件名模板更新**
    如果文件名不符合新规范，将抛出异常，请检查并调整。
  - 🔗 **链接解析修复**
    修复了 `douyin` 合集页链接无法解析的问题。
    👉 [了解更多](#抖音合集作品)
  - 📄 **更多变更详情**
    👉 [查看 ChangeLog](https://github.com/Johnserf-Seed/f2/blob/main/CHANGELOG.md#0015---2024-04-04)
</details>

## 📑 文档

`F2` 的目标是提供一个简单易用的接口，让用户可以快速获取作品数据。
在 `preview` 版本中很多功能没有完善，如果你发现了问题，请在 `F2` 项目中提交 `issue`。
[项目文档](https://f2.wiki/) 还在完善中，存在滞后的情况，请保持关注。

## 🗓️ Todo

- 将在 `0.0.1.8` 版本中添加 `BiliBili` & `NetEaseMusic` 支持。
- 将在 `0.0.1.8` 版本中维护更多的 `API` 与 `CLI` 功能。
- 优化 `F2` 的 `CLI` 体验。
- 添加 `Socket` 代理支持。
- 添加 `Cookie` 池，`Proxy` 池，`User-Agent` 池等支持。
- 添加 `F2` 的 `WebAPI` 版本。
- [更多计划](https://github.com/Johnserf-Seed/f2/discussions/203)

## 🐛 更新

[ChangeLog](https://github.com/Johnserf-Seed/f2/blob/main/CHANGELOG.md)

## 💡 应用&功能

功能状态：🟢代表已经实现，🟡代表正在实现，🟤代表暂时不实现，🔵代表未来实现，🔴代表将会弃用。
账号状态：⚪代表未知，🟣代表需要登录（无视自己账号隐私设置），⚫代表不需要登录（游客状态能看到的）。

完整的功能列表请查看 [API文档](https://f2.wiki/guide/api-examples)。

<details>
  <summary> 📠 Bark </summary>

  |功能|账号状态|接口|功能状态|
  |---|---|---|---|
  |发送通知（GET）|⚪|`fetch_bark_notification`|🟢|
  |发送通知（POST）|⚪|`post_bark_notification`|🟢|
  |发送加密通知|⚪|`cipher_bark_notification`|🟢|

  |工具类|类名|接口|功能状态|
  |---|---|---|---|
  | 管理客户端配置     | `ClientConfManager` |   -    |  🟢  |
  | 生成随机数字字节   | - | `generate_numeric_bytes` |  🟢  |
</details>

<details>
  <summary> 📸 DouYin </summary>

  - 🟣 表示需要登录才可以下载仅自己可见的作品、收藏作品、收藏夹作品或点赞作品等。（登录后无视自己的私密设置、可获取个性化内容）
  - ⚫ 表示不需要登录下载公开的作品、收藏夹作品、点赞作品等。（仅下载他人公开可见作品与页面）

  |功能|账号状态|接口|功能状态|
  |---|---|---|---|
  |用户信息|🟣⚫|`fetch_user_profile`|🟢|
  |单个作品（视频、图集、日常）|🟣⚫|`fetch_one_video`|🟢|
  |live图集|🟣⚫|`fetch_one_video`|🟢|
  |主页作品|🟣⚫|`fetch_user_post_videos`|🟢|
  |点赞作品|🟣⚫|`fetch_user_like_videos`|🟢|
  |收藏夹作品|🟣⚫|`fetch_user_collects_videos`|🟢|
  |收藏作品|🟣|`fetch_user_collection_videos`|🟢|
  |收藏原声|🟣|`fetch_user_music_collection`|🟢|
  |收藏合集|🟣|`fetch_user_mix_collection`|🔵|
  |收藏短剧|🟣|`fetch_user_series_collection`|🟤|
  |合集作品|⚫|`fetch_user_mix_videos`|🟢|
  |首页推荐作品|🟣⚫|`fetch_user_feed_videos`|🟢|
  |相似推荐作品|⚫|`fetch_related_videos`|🟢|
  |直播间信息（流下载）|⚫|`fetch_user_live_videos`、`fetch_user_live_videos_by_room_id`|🟢|
  |直播间弹幕负载|⚫|`fetch_live_im`|🟢|
  |直播间弹幕|⚫|`fetch_live_danmaku`|🟢|
  |查询用户基本信息|🟣⚫|`fetch_query_user`|🟢|
  |关注用户开播|🟣⚫|`fetch_user_following_lives`|🟢|
  |关注用户信息|🟣⚫|`fetch_user_following`|🟢|
  |粉丝用户信息|🟣⚫|`fetch_user_follower`|🟢|
  |关注用户作品|🟣⚫|`fetch_user_following_videos`|🟤|
  |粉丝用户作品|🟣⚫|`fetch_user_follower_videos`|🟤|
  |朋友作品|🟣|`fetch_friend_feed_videos`|🟢|
  |增加播放量|🟣⚫|`fetch_post_stats`|🟢|
  |搜索视频|⚫|`fetch_search_videos`|🔵|
  |搜索用户|⚫|`fetch_search_users`|🔵|
  |搜索直播|⚫|`fetch_search_lives`|🔵|
  |猜你想搜（相关搜索）|⚫|`fetch_search_suggest`|🟤|
  |抖音热点|⚫|`fetch_hot_search`|🟤|
  |作品评论|🟣⚫|`fetch_video_comments`|🔵|
  |观看历史|🟣|`fetch_user_history_read`|🟤|
  |稍后再看|🟣|`fetch_user_watch_later`|🟤|
  |...|...|...|...|

  |工具类|类名|接口|功能状态|
  |---|---|---|---|
  | 管理客户端配置        | `ClientConfManager`    |                              |  🟢  |
  | 生成真实msToken      | `TokenManager`         | `gen_real_msToken`           |  🟢  |
  | 生成虚假msToken      | `TokenManager`         | `gen_false_msToken`          |  🟢  |
  | 生成ttwid           | `TokenManager`         | `gen_ttwid`                  |  🟢  |
  | 生成webid           | `TokenManager`         | `gen_webid`                  |  🟢  |
  | 生成verify_fp       | `VerifyFpManager`      | `gen_verify_fp`              |  🟢  |
  | 生成s_v_web_id      | `VerifyFpManager`      | `gen_s_v_web_id`             |  🟢  |
  | 生成直播signature    | `DouyinWebcastSignature` | `get_signature`            |  🟢  |
  | ~~使用接口模型生成wss签名参数~~ | ~~`WebcastSignatureManager`~~ | ~~`model_2_endpoint`~~      |  🔴  |
  | 使用接口地址生成Xb参数 | `XBogusManager`        | `str_2_endpoint`             |  🟢  |
  | 使用接口模型生成Xb参数 | `XBogusManager`        | `model_2_endpoint`           |  🟢  |
  | 使用接口地址生成Ab参数 | `ABogusManager`        | `str_2_endpoint`             |  🟢  |
  | 使用接口模型生成Ab参数 | `ABogusManager`        | `model_2_endpoint`           |  🟢  |
  | 提取单个用户id       | `SecUserIdFetcher`     | `get_sec_user_id`            |  🟢  |
  | 提取列表用户id       | `SecUserIdFetcher`     | `get_all_sec_user_id`        |  🟢  |
  | 提取单个作品id       | `AwemeIdFetcher`       | `get_aweme_id`               |  🟢  |
  | 提取列表作品id       | `AwemeIdFetcher`       | `get_all_aweme_id`           |  🟢  |
  | 提取单个合集id       | `MixIdFetcher`         | `get_mix_id`                 |  🟢  |
  | 提取列表合集id       | `MixIdFetcher`         | `get_all_mix_id`             |  🟢  |
  | 提取单个直播间号      | `WebCastIdFetcher`     | `get_webcast_id`             |  🟢  |
  | 提取列表直播间号      | `WebCastIdFetcher`     | `get_all_webcast_id`         |  🟢  |
  | 全局格式化文件名      | -                      | `format_file_name`           |  🟢  |
  | 创建用户目录         | -                      | `create_user_folder`         |  🟢  |
  | 重命名用户目录        | -                      | `rename_user_folder`         |  🟢  |
  | 创建或重命名用户目录   | -                      | `create_or_rename_user_folder` | 🟢  |
  | ~~显示二维码~~         | -                      | ~~`show_qrcode`~~              |  🔴  |
  | json歌词转lrc歌词    | -                      | `json_2_lrc`                 |  🟢  |
</details>

<details>
  <summary> 🎶 TikTok </summary>

  - 🟣 表示需要登录才可以下载仅自己可见的作品、收藏作品、收藏夹作品或点赞作品等。（登录后无视自己的私密设置、可获取个性化内容）
  - ⚫ 表示不需要登录下载公开的作品、收藏夹作品、点赞作品等。（仅下载他人公开可见作品与页面）

  |功能|账号状态|接口|功能状态|
  |---|---|---|---|
  |用户信息|🟣⚫|`fetch_user_profile`|🟢|
  |单个作品|🟣⚫|`fetch_one_video`|🟢|
  |主页作品|🟣⚫|`fetch_user_post_videos`|🟢|
  |点赞作品|🟣⚫|`fetch_user_like_videos`|🟢|
  |收藏作品|🟣⚫|`fetch_user_collect_videos`|🟢|
  |播放列表|🟣⚫|`fetch_play_list`|🟢|
  |播放列表作品|🟣⚫|`fetch_user_mix_videos`|🟢|
  |作品搜索|🟣⚫|`fetch_search_videos`|🟢|
  |直播间信息（流下载）|⚫|`fetch_user_live_videos`|🟢|
  |直播间弹幕负载|⚫|`fetch_live_im`|🟢|
  |直播间弹幕|⚫|`fetch_live_danmaku`|🟢|
  |检查开播|🟣⚫|`fetch_check_live_alive`|🟢|
  |...|...|...|...|

  |工具类|类名|接口|功能状态|
  |---|---|---|---|
  | 管理客户端配置     | `ClientConfManager`   |                  |  🟢  |
  | 生成真实msToken    | `TokenManager`     | `gen_real_msToken`   |  🟢  |
  | 生成虚假msToken     | `TokenManager`     | `gen_false_msToken`  |  🟢  |
  | 生成ttwid          | `TokenManager`     | `gen_ttwid`          |  🟢  |
  | 生成odin_tt        | `TokenManager`      | `gen_odin_tt`        |  🟢  |
  | 使用接口地址生成Xb参数 | `XBogusManager`    | `str_2_endpoint`    |  🟢  |
  | 使用接口模型生成Xb参数 | `XBogusManager`    | `model_2_endpoint`   |  🟢  |
  | 提取单个用户id       | `SecUserIdFetcher` | `get_secuid`         |  🟢  |
  | 提取列表用户id       | `SecUserIdFetcher` | `get_all_secuid`     |  🟢  |
  | 提取单个用户唯一id    | `SecUserIdFetcher` | `get_uniqueid`        |  🟢  |
  | 提取列表用户唯一id    | `SecUserIdFetcher` | `get_all_uniqueid`    |  🟢  |
  | 提取列表用户id       | `SecUserIdFetcher` | `get_all_secUid`   |  🟢  |
  | 提取单个作品id       | `AwemeIdFetcher`   | `get_aweme_id`          |  🟢  |
  | 提取列表作品id       | `AwemeIdFetcher`   | `get_all_aweme_id`      |  🟢  |
  | 生成deviceId       | `DeviceIdManager`  | `gen_device_id`        |  🟢  |
  | 生成devideId列表   | `DeviceIdManager`  | `gen_device_ids`   |  🟢  |
  | 全局格式化文件名      | -                | `format_file_name`      |  🟢  |
  | 创建用户目录         | -                | `create_user_folder`    |  🟢  |
  | 重命名用户目录       | -                | `rename_user_folder`     |  🟢  |
  | 创建或重命名用户目录  | -                | `create_or_rename_user_folder` |   🟢   |
</details>

<details>
  <summary> 🐦 Twitter </summary>

  |功能|账号状态|接口|功能状态|
  |---|---|---|---|
  |推文详情|🟣⚫|`fetch_tweet_detail`|🟢|
  |用户信息|🟣⚫|`fetch_user_profile`|🟢|
  |主页推文|🟣⚫|`fetch_post_tweet`|🟢|
  |喜欢推文|🟣|`fetch_like_tweet`|🟢|
  |收藏推文|🟣|`fetch_bookmark_tweet`|🟢|

  |工具类|类名|接口|功能状态|
  |---|---|---|---|
  |  管理客户端配置     | `ClientConfManager`  |                          |  🟢  |
  |  提取用户唯一ID     | `UniqueIdFetcher`   | `get_unique_id`          |  🟢  |
  |  提取列表用户唯一ID  | `UniqueIdFetcher`   | `get_all_unique_ids`    |  🟢  |
  |  提取推文ID        | `TweetIdFetcher`    | `get_tweet_id`           |  🟢  |
  |  提取列表推文ID     | `TweetIdFetcher`   | `get_all_tweet_ids`       |  🟢  |
  |  全局格式化文件名    | -                  | `format_file_name`        |  🟢  |
  |  创建用户目录       | -                  | `create_user_folder`       |  🟢  |
  |  重命名用户目录      | -                 | `rename_user_folder`       |  🟢  |
  |  创建或重命名用户目录 | -                 | `create_or_rename_user_folder` |  🟢  |
  |  提取推文文案       | -                  | `extract_desc`              |  🟢  |
</details>

<details>
  <summary> 📱 WeiBo </summary>

  |功能|账号状态|接口|功能状态|
  |---|---|---|---|
  |用户信息|🟣⚫|`fetch_user_info`|🟢|
  |用户详情|🟣⚫|`fetch_user_detail`|🟢|
  |主页微博|🟣⚫|`fetch_user_weibo`|🟢|
  |微博详情|🟣⚫|`fetch_weibo_detail`|🟢|

  |工具类|类名|接口|功能状态|
  |---|---|---|---|
  | 管理客户端配置       | `ClientConfManager`       |                               |  🟢  |
  | 生成访客 Cookie      | `VisitorManager`          | `gen_visitor`                 |  🟢  |
  | 提取微博 ID          | `WeiboIdFetcher`          | `get_weibo_id`                |  🟢  |
  | 提取列表微博 ID      | `WeiboIdFetcher`          | `get_all_weibo_id`            |  🟢  |
  | 提取微博用户 ID      | `WeiboUidFetcher`         | `get_weibo_uid`               |  🟢  |
  | 提取列表微博用户 ID  | `WeiboUidFetcher`         | `get_all_weibo_uid`           |  🟢  |
  | 提取微博用户昵称     | `WeiboScreenNameFetcher`  | `get_weibo_screen_name`       |  🟢  |
  | 提取列表微博用户昵称 | `WeiboScreenNameFetcher`  | `get_all_weibo_screen_name`   |  🟢  |
  | 全局格式化文件名     | -                         | `format_file_name`            |  🟢  |
  | 创建用户目录         | -                         | `create_user_folder`          |  🟢  |
  | 重命名用户目录       | -                         | `rename_user_folder`          |  🟢  |
  | 创建或重命名用户目录 | -                         | `create_or_rename_user_folder`|  🟢  |
  | 提取微博文案         | -                         | `extract_desc`                |  🟢  |
</details>

## 📸 截图

<details>
  <summary> 🎬 Bark </summary>

  ### 发送通知（GET）

  <img src='https://github.com/user-attachments/assets/9c977737-c172-420a-9d7f-6f05bc843957'>

  <img src='https://github.com/user-attachments/assets/9a59f9d6-cc8a-48bb-9a75-d075a9e13498'>

  ### 发送通知（POST）

  <img src='https://github.com/user-attachments/assets/7a3e9054-a156-4be7-bf93-90d0963f8390'>

  <img src='https://github.com/user-attachments/assets/9a59f9d6-cc8a-48bb-9a75-d075a9e13498'>

  ### 发送加密通知

  <img src='https://github.com/user-attachments/assets/8a3cb67d-e1b6-40d3-b4c1-543d098eb481'>

  <img src='https://github.com/user-attachments/assets/9a59f9d6-cc8a-48bb-9a75-d075a9e13498'>
</details>

<details>
  <summary> 🎬 DouYin </summary>

  ### 抖音单个作品

  <img src='https://github.com/user-attachments/assets/01b62283-322a-42f1-96d7-bc1431cc0e1b'>

  ### 抖音主页作品

  <img src='https://github.com/user-attachments/assets/6353a309-9f8d-4284-9f90-267d683ac9cd'>

  ### 抖音点赞作品

  <img src='https://github.com/user-attachments/assets/018d2b6f-d874-41f9-9c20-e1a17bdf16e0'>

  ### 抖音收藏作品

  <img src='https://github.com/user-attachments/assets/0334b1b0-1b61-4cbb-b47a-0ad0ce82e315'>

  ### 抖音收藏夹作品

  <img src='https://github.com/user-attachments/assets/ef9fc0e4-5d4f-4ad6-9fa1-e305f9b60c83'>

  ### 抖音收藏原声

  <img src='https://github.com/user-attachments/assets/414e20eb-0837-48b5-8a7b-622e4d0aafe1'>

  ### 抖音合集作品

  支持合集里任意作品链接解析
  <img src='https://github.com/user-attachments/assets/4cd85a9f-d684-4c02-8106-fce567f05f0b'>

  合集链接解析
  <img src='https://github.com/user-attachments/assets/04a3553b-93f8-4f99-a9f2-689bef881899'>

  ### 抖音直播录制

  单个直播录制
  <img src='https://github.com/user-attachments/assets/63c31ad3-3026-4ae8-8fc1-752ba2117915'>

  批量直播录制
  <img src='https://github.com/user-attachments/assets/6e8caaa7-2bfe-4542-b896-ae4f3c70877f'>

  ### 抖音相关推荐

  <img src="https://github.com/user-attachments/assets/c64731a1-5383-4810-af15-8125330856a8">

  ### 抖音好友作品

  <img src="https://github.com/user-attachments/assets/c73feec7-f158-4eb1-be3b-9a957507ef45">

  ### 抖音直播弹幕

  <video src="https://github.com/Johnserf-Seed/f2/assets/40727745/500d1eaf-59ba-44ba-849b-666c0ddf8469" width="70%" height="auto" autoplay loop style="border-radius: 8px; overflow: hidden;"></video>
</details>

<details>
  <summary> 🎬 TikTok </summary>

  ### TikTok单个作品

  <img src='https://github.com/user-attachments/assets/1ddee9ec-cd4c-4dc0-81a0-970e5d1cb831'>

  ### TikTok主页作品

  <img src='https://github.com/user-attachments/assets/a45f2186-cf0a-4c21-8502-267147936e06'>

  ### TikTok点赞作品

  <img src='https://github.com/user-attachments/assets/11e8e70f-ee32-422e-a79d-f65276b12652'>

  ### TikTok收藏作品

  <img src='https://github.com/user-attachments/assets/bcd584fa-8c8c-4846-8be0-3c7d2c85ec5d'>

  ### TikTok播放列表作品

  <img src='https://github.com/user-attachments/assets/c7ba8740-b9a0-4a8d-98cc-ae8fab2393e2'>

  ### TikTok作品搜索
  <img src='https://github.com/user-attachments/assets/c69b76e5-b168-4966-af5d-c9325af2015e'>

  ### TikTok直播弹幕

  <video src="https://github.com/Johnserf-Seed/f2/assets/40727745/500d1eaf-59ba-44ba-849b-666c0ddf8469" width="70%" height="auto" autoplay loop style="border-radius: 8px; overflow: hidden;"></video>
  ps. 懒得录了，放的douyin的弹幕，效果一样的。
</details>

<details>
  <summary> 🎬 Twitter </summary>

  ### x单个推文

  <img src='https://github.com/user-attachments/assets/5858e19f-e4e6-4279-a1a4-56ac2878afde'>

  ### x主页推文

  <img src='https://github.com/user-attachments/assets/43f9665e-3086-4078-a093-59a8081bb77c'>

  ### x喜欢推文

  <img src='https://github.com/user-attachments/assets/c8b592f6-84a5-4a7d-b8df-9a8f2e25abb0'>

  ### x收藏推文

  <img src='https://github.com/user-attachments/assets/e4aa7adf-52de-4a7c-a1f4-f61423047ac8'>
</details>

<details>
  <summary> 🎬 WeiBo </summary>

  ### WeiBo单个微博

  <img src='https://github.com/user-attachments/assets/4038766d-d601-42a9-8f35-6243b3744bd7'>

  ### WeiBo主页微博

  <img src='https://github.com/user-attachments/assets/e02c5007-4c17-4d97-a648-6aabb328a618'>
</details>

## 📦 结构

<details>
  <summary>📁 项目目录</summary>

  ```bash
  .
  |___.coverage
  |___.github
  | |___dependabot.yml
  | |___ISSUE_TEMPLATE
  | | |___ask-question.md
  | | |___bug-report.md
  | | |___feature_request.md
  | |___workflows
  | | |___Codecov.yml
  | | |___deploy.yml
  | | |___issue_similarity.yml
  |___.gitignore
  |___.vscode
  | |___launch.json
  | |___settings.json
  |___babel.cfg
  |___CHANGELOG.md
  |___CNAME
  |___CODE_OF_CONDUCT.md
  |___CONTRIBUTING.en.md
  |___CONTRIBUTING.md
  |___CONTRIBUTORS.en.md
  |___CONTRIBUTORS.md
  |___coverage.xml
  |___docs
  | |___.vitepress
  | | |___config.mts
  | | |___theme
  | | | |___index.ts
  | | | |___Layout.vue
  | | | |___styles
  | | | | |___vars.css
  | |___advance-guide.md
  | |___cli.md
  | |___en
  | | |___advance-guide.md
  | | |___api-examples.md
  | | |___cli.md
  | | |___guide
  | | | |___api-examples.md
  | | | |___apps
  | | | | |___bark
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | | |___douyin
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | | |___f2
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | | |___tiktok
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | | |___twitter
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | | |___weibo
  | | | | | |___cli.md
  | | | | | |___index.md
  | | | |___what-is-f2.md
  | | |___index.md
  | | |___install.md
  | | |___markdown-examples.md
  | | |___question-answer
  | | | |___qa.md
  | | |___quick-start.md
  | | |___site-config.md
  | | |___snippets
  | | | |___bark
  | | | | |___ciphertext.sh
  | | | | |___client-config.py
  | | | | |___generate-bytes.py
  | | | | |___notification.py
  | | | |___douyin
  | | | | |___abogus.py
  | | | | |___aweme-id.py
  | | | | |___aweme-related.py
  | | | | |___client-config.py
  | | | | |___format-file-name.py
  | | | | |___json-2-lrc.py
  | | | | |___mix-id.py
  | | | | |___one-video.py
  | | | | |___post-stats.py
  | | | | |___query-user.py
  | | | | |___sec-user-id.py
  | | | | |___show-qrcode.py
  | | | | |___sso-login.py
  | | | | |___support-link.md
  | | | | |___token-manager.py
  | | | | |___user-collection.py
  | | | | |___user-collects.py
  | | | | |___user-feed.py
  | | | | |___user-folder.py
  | | | | |___user-follow-live.py
  | | | | |___user-follower.py
  | | | | |___user-following.py
  | | | | |___user-friend.py
  | | | | |___user-get-add.py
  | | | | |___user-like.py
  | | | | |___user-live-im-fetch.py
  | | | | |___user-live-room-id.py
  | | | | |___user-live.py
  | | | | |___user-mix.py
  | | | | |___user-post.py
  | | | | |___user-profile.py
  | | | | |___video-get-add.py
  | | | | |___webcast-id.py
  | | | | |___webcast-signature.py
  | | | | |___xbogus.py
  | | | |___QA.md
  | | | |___set-debug.py
  | | | |___tiktok
  | | | | |___aweme-id.py
  | | | | |___check-live-alive.py
  | | | | |___client-config.py
  | | | | |___device-id.py
  | | | | |___format-file-name.py
  | | | | |___one-video.py
  | | | | |___sec-uid.py
  | | | | |___token-manager.py
  | | | | |___unique-id.py
  | | | | |___user-collect.py
  | | | | |___user-folder.py
  | | | | |___user-get-add.py
  | | | | |___user-like.py
  | | | | |___user-live-im-fetch.py
  | | | | |___user-mix.py
  | | | | |___user-playlist.py
  | | | | |___user-post.py
  | | | | |___user-profile.py
  | | | | |___video-get-add.py
  | | | | |___xbogus.py
  | | | |___twitter
  | | | | |___client-config.py
  | | | | |___extract-desc.py
  | | | | |___format-file-name.py
  | | | | |___one-tweet.py
  | | | | |___tweet-ids.py
  | | | | |___user-bookmark.py
  | | | | |___user-folder.py
  | | | | |___user-get-add.py
  | | | | |___user-like.py
  | | | | |___user-profile.py
  | | | | |___user-tweet.py
  | | | | |___user-unique-ids.py
  | | | |___weibo
  | | | | |___client-config.py
  | | | | |___extract-desc.py
  | | | | |___extract-uid.py
  | | | | |___format-file-name.py
  | | | | |___one-weibo.py
  | | | | |___user-detail.py
  | | | | |___user-folder.py
  | | | | |___user-get-add.py
  | | | | |___user-profile-by-name.py
  | | | | |___user-profile.py
  | | | | |___user-weibo.py
  | | | | |___visitor-cookie.py
  | | | | |___weibo-id.py
  | | | | |___weibo-screen-name.py
  | | | | |___weibo-uid.py
  | | |___team.md
  | |___faq.md
  | |___guide
  | | |___api-examples.md
  | | |___apps
  | | | |___bark
  | | | | |___cli.md
  | | | | |___index.md
  | | | |___douyin
  | | | | |___cli.md
  | | | | |___index.md
  | | | |___f2
  | | | | |___cli.md
  | | | | |___index.md
  | | | |___tiktok
  | | | | |___cli.md
  | | | | |___index.md
  | | | |___twitter
  | | | | |___cli.md
  | | | | |___index.md
  | | | |___weibo
  | | | | |___cli.md
  | | | | |___index.md
  | | |___what-is-f2.md
  | |___index.md
  | |___install.md
  | |___package.json
  | |___public
  | | |___bark
  | | | |___bark-ciphertext-setting.jpg
  | | | |___bark-ciphertext.jpg
  | | | |___bark-key.jpg
  | | | |___bark-token.jpg
  | | |___douyin
  | | | |___batch-lives.png
  | | | |___cli-start-2.png
  | | | |___cli-start.png
  | | | |___code-start-2.png
  | | | |___code-start.png
  | | | |___log-2-console.png
  | | | |___pytest-ok.png
  | | | |___set-debug.png
  | | | |___wss-connect.png
  | | |___f2-help.png
  | | |___f2-logo-with-no-shadow.png
  | | |___f2-logo-with-shadow-mini.png
  | | |___f2-logo-with-shadow-svg@0.25x.svg
  | | |___f2-logo-with-shadow-svg@0.5x.svg
  | | |___f2-logo-with-shadow-svg@0.75x.svg
  | | |___f2-logo-with-shadow-svg@1.0x.svg
  | | |___f2-logo-with-shadow-svg@1.5x.svg
  | | |___f2-logo-with-shadow-svg@2.0x.svg
  | | |___f2-logo-with-shadow.png
  | | |___f2-logo.ico
  | |___quick-start.md
  | |___site-config.md
  | |___snippets
  | | |___bark
  | | | |___ciphertext.sh
  | | | |___client-config.py
  | | | |___generate-bytes.py
  | | | |___notification.py
  | | |___douyin
  | | | |___abogus.py
  | | | |___aweme-id.py
  | | | |___aweme-related.py
  | | | |___batch-lives.py
  | | | |___client-config.py
  | | | |___format-file-name.py
  | | | |___json-2-lrc.py
  | | | |___mix-id.py
  | | | |___one-video.py
  | | | |___post-stats.py
  | | | |___query-user.py
  | | | |___sec-user-id.py
  | | | |___show-qrcode.py
  | | | |___sso-login.py
  | | | |___support-link.md
  | | | |___token-manager.py
  | | | |___user-collection.py
  | | | |___user-collects.py
  | | | |___user-feed.py
  | | | |___user-folder.py
  | | | |___user-follow-live.py
  | | | |___user-follower.py
  | | | |___user-following.py
  | | | |___user-friend.py
  | | | |___user-get-add.py
  | | | |___user-like.py
  | | | |___user-live-im-fetch.py
  | | | |___user-live-room-id.py
  | | | |___user-live.py
  | | | |___user-mix.py
  | | | |___user-post.py
  | | | |___user-profile.py
  | | | |___video-get-add.py
  | | | |___webcast-id.py
  | | | |___webcast-signature.py
  | | | |___xbogus.py
  | | |___set-debug.py
  | | |___tiktok
  | | | |___aweme-id.py
  | | | |___check-live-alive.py
  | | | |___client-config.py
  | | | |___device-id.py
  | | | |___format-file-name.py
  | | | |___one-video.py
  | | | |___sec-uid.py
  | | | |___token-manager.py
  | | | |___unique-id.py
  | | | |___user-collect.py
  | | | |___user-folder.py
  | | | |___user-get-add.py
  | | | |___user-like.py
  | | | |___user-live-im-fetch.py
  | | | |___user-mix.py
  | | | |___user-playlist.py
  | | | |___user-post.py
  | | | |___user-profile.py
  | | | |___video-get-add.py
  | | | |___xbogus.py
  | | |___twitter
  | | | |___client-config.py
  | | | |___extract-desc.py
  | | | |___format-file-name.py
  | | | |___one-tweet.py
  | | | |___tweet-ids.py
  | | | |___user-bookmark.py
  | | | |___user-folder.py
  | | | |___user-get-add.py
  | | | |___user-like.py
  | | | |___user-profile.py
  | | | |___user-tweet.py
  | | | |___user-unique-ids.py
  | | |___weibo
  | | | |___client-config.py
  | | | |___extract-desc.py
  | | | |___extract-uid.py
  | | | |___format-file-name.py
  | | | |___one-weibo.py
  | | | |___user-detail.py
  | | | |___user-folder.py
  | | | |___user-get-add.py
  | | | |___user-profile-by-name.py
  | | | |___user-profile.py
  | | | |___user-weibo.py
  | | | |___visitor-cookie.py
  | | | |___weibo-id.py
  | | | |___weibo-screen-name.py
  | | | |___weibo-uid.py
  | |___team.md
  |___f2
  | |___apps
  | | |___bark
  | | | |___api.py
  | | | |___cli.py
  | | | |___crawler.py
  | | | |___filter.py
  | | | |___handler.py
  | | | |___help.py
  | | | |___model.py
  | | | |___test
  | | | | |___test_bark_crawler.py
  | | | |___utils.py
  | | |___douyin
  | | | |___algorithm
  | | | | |___webcast_signature.js
  | | | | |___webcast_signature.py
  | | | |___api.py
  | | | |___cli.py
  | | | |___crawler.py
  | | | |___db.py
  | | | |___dl.py
  | | | |___filter.py
  | | | |___handler.py
  | | | |___help.py
  | | | |___model.py
  | | | |___proto
  | | | | |___douyin_webcast.proto
  | | | | |___douyin_webcast_pb2.py
  | | | |___test
  | | | | |___test_douyin_apps_model.py
  | | | | |___test_douyin_aweme_id.py
  | | | | |___test_douyin_crawler.py
  | | | | |___test_douyin_handler.py
  | | | | |___test_douyin_lrc.py
  | | | | |___test_douyin_room_id.py
  | | | | |___test_douyin_sec_user_id.py
  | | | | |___test_douyin_token.py
  | | | | |___test_douyin_webcast_id.py
  | | | | |___test_douyin_webcast_signature.py
  | | | |___utils.py
  | | |___tiktok
  | | | |___api.py
  | | | |___cli.py
  | | | |___crawler.py
  | | | |___db.py
  | | | |___dl.py
  | | | |___filter.py
  | | | |___handler.py
  | | | |___help.py
  | | | |___model.py
  | | | |___proto
  | | | | |___tiktok_webcast.proto
  | | | | |___tiktok_webcast_pb2.py
  | | | |___test
  | | | | |___test_tiktok_aweme_id.py
  | | | | |___test_tiktok_crawler.py
  | | | | |___test_tiktok_device_id.py
  | | | | |___test_tiktok_sec_user_id_fetcher.py
  | | | | |___test_tiktok_token.py
  | | | |___utils.py
  | | |___twitter
  | | | |___api.py
  | | | |___cli.py
  | | | |___crawler.py
  | | | |___db.py
  | | | |___dl.py
  | | | |___filter.py
  | | | |___handler.py
  | | | |___help.py
  | | | |___model.py
  | | | |___test
  | | | | |___test_model.py
  | | | | |___test_tweet_desc.py
  | | | | |___test_tweet_id.py
  | | | | |___test_unique_id.py
  | | | |___utils.py
  | | |___weibo
  | | | |___api.py
  | | | |___cli.py
  | | | |___crawler.py
  | | | |___db.py
  | | | |___dl.py
  | | | |___filter.py
  | | | |___handler.py
  | | | |___help.py
  | | | |___model.py
  | | | |___test
  | | | | |___test_gen_visitor.py
  | | | | |___test_handler.py
  | | | | |___test_weibo_desc.py
  | | | | |___test_weibo_id.py
  | | | | |___test_weibo_screen_name.py
  | | | | |___test_weibo_uid.py
  | | | |___utils.py
  | | |_____apps__.py
  | | |_____init__.py
  | |___cli
  | | |___cli_commands.py
  | | |___cli_console.py
  | | |_____init__.py
  | |___conf
  | | |___app.yaml
  | | |___conf.yaml
  | | |___defaults.yaml
  | | |___test.yaml
  | |___crawlers
  | | |___base_crawler.py
  | |___db
  | | |___base_db.py
  | |___dl
  | | |___base_downloader.py
  | |___exceptions
  | | |___api_exceptions.py
  | | |___conf_exceptions.py
  | | |___db_exceptions.py
  | | |___file_exceptions.py
  | | |_____init__.py
  | |___helps.py
  | |___i18n
  | | |___translator.py
  | |___languages
  | | |___en_US
  | | | |___LC_MESSAGES
  | | | | |___en_US.mo
  | | |___zh_CN
  | | | |___LC_MESSAGES
  | | | | |___zh_CN.mo
  | |___log
  | | |___logger.py
  | |___utils
  | | |___abogus.py
  | | |___conf_manager.py
  | | |___decorators.py
  | | |___json_filter.py
  | | |___utils.py
  | | |___xbogus.py
  | | |____dl.py
  | | |____signal.py
  | | |____singleton.py
  | | |_____init__.py
  | |_____init__.py
  | |_____main__.py
  |___LICENSE
  |___make_pot.bat
  |___make_pot.sh
  |___pnpm-lock.yaml
  |___pyproject.toml
  |___pytest.ini
  |___README.en.md
  |___README.md
  |___SECURITY.md
  |___tests
  | |___data
  | | |___douyin
  | | | |___webcast
  | | | | |___dict
  | | | | | |___WebcastGiftMessage.json
  | | | | | |___WebcastLiveShoppingMessage.json
  | | | | | |___WebcastProductChangeMessage.json
  | | | | | |___WebcastRoomUserSeqMessage.json
  | | | | | |___WebcastSocialMessage.json
  | | | | | |___WebcastStatsMessage.json
  | | | | | |___WebcastUpdateFanTicketMessage.json
  | | |___tiktok
  | | | |___webcast
  | | | | |___dict
  | | | | | |___WebcastChatMessage.json
  | | | | | |___WebcastGiftMessage.json
  | | | | | |___WebcastLikeMessage.json
  | | | | | |___WebcastLinkMicFanTicketMethod.json
  | | | | | |___WebcastMemberMessage.json
  | | | | | |___WebcastRoomStreamAdaptationMessage.json
  | | | | | |___WebcastRoomUserSeqMessage.json
  | | | | | |___WebcastSocialMessage.json
  | | | | | |___WebcastStatsMessage.json
  | | | | |___protobuf
  | | | | | |___WebcastOecLiveShoppingMessage_0.bin
  | | | | | |___WebcastOecLiveShoppingMessage_1.bin
  | | | | | |___WebcastOecLiveShoppingMessage_2.bin
  | |___package-lock.json
  | |___test_abogus.py
  | |___test_aes.py
  | |___test_cli_commands.py
  | |___test_cli_console.py
  | |___test_desc_limit.py
  | |___test_dl.py
  | |___test_excetions.py
  | |___test_gzip.py
  | |___test_i18n.py
  | |___test_json_filter.py
  | |___test_logger.py
  | |___test_py_version.py
  | |___test_rsa.py
  | |___test_signal.py
  | |___test_singleton.py
  | |___test_timestamp.py
  | |___test_utils.py
  | |___test_xbogus.py
  ```
</details>

## 💰 赞助商

<a href="https://tikhub.io/"><img style="border-radius:20px" src="https://github.com/Johnserf-Seed/f2/assets/40727745/70a67dd1-dccb-44a9-b635-c29a950f1daf"></a>

[TikHub](https://tikhub.io/) 是一家提供优质数据接口服务的供应商。通过每日签到，可以获取免费额度。可以使用我的注册邀请链接：[https://beta-web.tikhub.io/users/signup?referral_code=6hLcGD94](https://beta-web.tikhub.io/users/signup?referral_code=6hLcGD94) 或 邀请码：`6hLcGD94`，注册并充值即可获得`$2`额度。

[TikHub](https://tikhub.io/) 提供以下服务：

- 丰富的数据接口
- 每日签到免费获取额度
- 高质量的API服务
- 官网：https://tikhub.io/
- 项目地址：https://github.com/TikHubIO/

## 👨‍💻 贡献

如果你有兴趣为 `F2` 贡献代码，请查看[贡献指南](https://github.com/Johnserf-Seed/f2/blob/main/CONTRIBUTING.md)。

## 🙏 鸣谢

- [Windows Terminal](https://aka.ms/terminal)
- [Python](https://www.python.org/)
- [Nvm](https://github.com/nvm-sh/nvm)
- [Node.js](https://nodejs.org/)
- [Babel](https://babel.pocoo.org/)
- [click](https://github.com/pallets/click)
- [rich](https://github.com/Textualize/rich)
- [httpx](https://github.com/encode/httpx)
- [aiofiles](https://github.com/Tinche/aiofiles)
- [aiosqlite](https://github.com/omnilib/aiosqlite)
- [jsonpath-ng](https://github.com/h2non/jsonpath-ng)
- [importlib_resources](https://github.com/python/importlib_resources)
- [m3u8](https://github.com/globocom/m3u8)
- [pyyaml](https://github.com/yaml/pyyaml)
- [pytest](https://github.com/pytest-dev/pytest)
- [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio)
- [browser_cookie3](https://github.com/borisbabic/browser_cookie3)
- [pydantic](https://github.com/samuelcolvin/pydantic)
- [qrcode](https://github.com/lincolnloop/python-qrcode)
- [vitepress](https://github.com/vuejs/vitepress)
- [websockets](https://github.com/python-websockets/websockets)
- [websockets_proxy](https://github.com/racinette/websockets_proxy)
- [protobuf](https://github.com/protocolbuffers/protobuf)
- [PyExecJS](https://github.com/doloopwhile/PyExecJS)
- [gmssl](https://github.com/duanhongyi/gmssl)
- [cryptography](https://github.com/pyca/cryptography)

没有这些库和程序，`F2`将无法实现这些功能，对于他们的贡献和努力，表示由衷的感谢。

## ⚖️ 协议&声明

- **请严格遵守爬虫规范，不要使用此项目进行任何违法行为。**
- **不出售、共享、加密、上传、研究和传播任何个人信息。**
- **项目及其相关代码仅供学习与研究使用，不构成任何明示或暗示的保证。**
- **使用者因使用此项目及其代码可能造成的任何形