Skip to content

Latest commit

 

History

History
531 lines (423 loc) · 22.7 KB

README.en.md

File metadata and controls

531 lines (423 loc) · 22.7 KB

Logo

Downloads PyPI version codecov APACHE-2.0

🇨🇳 简体中文 readme🇬🇧 English readme

F2 is a Python library that provides multi-platform content downloading and API data processing. It supports platforms like DouYin, TikTok, Twitter, Instagram, and is easily adaptable to more platforms.

🚀 Quick Start

⚙️ Installation

⚡ Quick Use

📋 Configuration File

💻 Command Line

📘 Developer Guide

🧩 Calling Examples

✨ New Changes

When upgrading to version 0.0.1.5 of F2, please note the following key updates.

  • XBogus parameter in 0.0.1.5 version now supports custom User-Agent (UA), please pay attention to UA specification.
  • The rebuilt database contains original data of interfaces, so you need to delete the old database file. If you want to retain records, please pay attention to migration.
  • The return types of all fetch methods have been unified to filter types, so you need to pay attention to this change.
  • Filter has added the _to_raw method, which can convert the filter to original interface data.
  • The file name template has been updated, and if your file name does not meet the specifications, an exception will be thrown.
  • douyin collection page links cannot be resolved, see Douyin Collection Works.
  • For more changes, see ChangeLog.

📑 Documentation

The goal of F2 is to provide a simple and easy-to-use interface for users to quickly obtain content data. Many features are not fully developed in the preview version. If you find any issues, please submit an issue in the F2 project. The project documentation is still being improved, and there may be delays, so please stay tuned.

🛠️ Q&A

Common Questions and Solutions

🗓️ Todo

  • Support for weibo and x will be added in version 0.0.1.6.
  • More douyin and tiktok interfaces will be added in version 0.0.1.6.
  • Known issues from previous versions will be fixed in version 0.0.1.6.

🐛 Updates

ChangeLog

💡 Applications & Features

Feature status: 🟢 Represents implemented, 🟡 Represents being implemented, 🟤 Represents temporarily not implemented, 🔵 Represents future implementation, 🔴 Represents deprecation. Account status: ⚪ Represents unknown, 🟣 Represents login required (ignores own account privacy settings), ⚫ Represents not login required (visible to guests only).

🎶 DouYin
  • 🟣 Indicates that login is required to download works that are only visible to oneself, favorited works, works in collection folders, or liked works. (After login, ignores own privacy settings and obtains personalized content)
  • ⚫ Indicates that login is not required to download public works, works in collection folders, liked works, etc. (Only downloads works visible to others and pages)
Feature Account Status Interface Feature Status
User Information 🟣⚫ handler_user_profile 🟢
Single Work (Video, Album, Daily) 🟣⚫ fetch_one_video 🟢
Home Page Works 🟣⚫ fetch_user_post_videos 🟢
Liked Works 🟣⚫ fetch_user_like_videos 🟢
Favorite Works 🟣 fetch_user_collects_videos 🟢
Collection Works 🟣 fetch_user_collection_videos 🟢
Collected Original Sound 🟣 fetch_user_music_collection 🟢
Collected Collections 🟣 fetch_user_mix_collection 🔵
Collected Short Films 🟣 fetch_user_series_collection 🟤
Collection Works fetch_user_mix_videos 🟢
Home Page Recommended Works 🟣⚫ fetch_user_feed_videos 🟡
Similar Recommended Works fetch_related_videos 🔵
Live Room Information (Stream Download) fetch_user_live_videos, fetch_user_live_videos_by_room_id 🟢
Live Room Danmaku fetch_user_live_danmu 🔵
Following Users' Live Broadcasts 🟣⚫ fetch_user_following_lives 🔵
Following User Information 🟣⚫ fetch_user_following 🟢
Fan User Information 🟣⚫ fetch_user_follower 🟢
Following User Works 🟣⚫ fetch_user_following_videos 🟤
Fan User Works 🟣⚫ fetch_user_follower_videos 🟤
Friend's Works 🟣 fetch_user_friend_videos 🔵
Search Videos fetch_search_videos 🔵
Search Users fetch_search_users 🔵
Search Lives fetch_search_lives 🔵
Guess What You Want to Search (Related Search) fetch_search_suggest 🟤
DouYin Hotspot fetch_hot_search 🟤
Work Comments 🟣⚫ fetch_video_comments 🔵
Viewing History 🟣 fetch_user_history_read 🟤
Watch Later 🟣 fetch_user_watch_later 🟤
... ... ... ...
🎶 TikTok
  • 🟣 Indicates that login is required to download works that are only visible to oneself, favorited works, works in collection folders, or liked works. (After login, ignores own privacy settings and obtains personalized content)
  • ⚫ Indicates that login is not required to download public works, works in collection folders, liked works, etc. (Only downloads works visible to others and pages)
Feature Account Status Interface Feature Status
User Information 🟣⚫ handler_user_profile 🟢
Single Work 🟣⚫ fetch_one_video 🟢
Home Page Works 🟣⚫ fetch_user_post_videos 🟢
Liked Works 🟣⚫ fetch_user_like_videos 🟢
Favorite Works 🟣⚫ fetch_user_collect_videos 🟢
Playlist Works 🟣⚫ fetch_user_mix_videos 🟢
... ... ... ...

📸 Screenshots

🎬 DouYin

DouYin Single Work

DouYin Home Page Works

DouYin Liked Works

DouYin Favorite Works

DouYin Collection Works

DouYin Collected Original Sound

DouYin Collection Works

Support for parsing any work link in the collection

Collection link parsing

DouYin Hotspot

DouYin Live Room Information

DouYin Live Room Danmaku

🎬 TikTok

TikTok Single Work

TikTok Home Page Works

TikTok Liked Works

TikTok Favorite Works

TikTok Collection Works

TikTok Collected Original Sound

📦 Structures

📁 Project Catalogs
.
├── .github
│   ├── ISSUE_TEMPLATE
│   │   ├── ask-question.md
│   │   ├── bug-report.md
│   │   └── feature_request.md
│   └── workflows
│       └── Codecov.yml
│       └── deploy.yml
├── .gitignore
├── .vscode
│   └── settings.json
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── LICENSE
├── README.en.md
├── README.md
├── SECURITY.md
├── docs
│   ├── .vitepress
│   │   ├── config.mts
│   │   └── theme
│   │       ├── index.ts
│   │       └── styles
│   │           └── vars.css
│   ├── advance-guide.md
│   ├── cli.md
│   ├── en
│   │   ├── advance-guide.md
│   │   ├── api-examples.md
│   │   ├── cli.md
│   │   ├── guide
│   │   │   └── what-is-f2.md
│   │   ├── index.md
│   │   ├── install.md
│   │   ├── markdown-examples.md
│   │   ├── quick-start.md
│   │   └── site-config.md
│   ├── guide
│   │   ├── api-examples.md
│   │   ├── apps
│   │   │   ├── douyin
│   │   │   │   └── index.md
│   │   │   └── tiktok
│   │   │       └── index.md
│   │   └── what-is-f2.md
│   ├── index.md
│   ├── install.md
│   ├── package-lock.json
│   ├── package.json
│   ├── public
│   │   ├── douyin
│   │   │   ├── cli-start-2.png
│   │   │   ├── cli-start.png
│   │   │   ├── code-start-2.png
│   │   │   ├── code-start.png
│   │   │   ├── log-2-console.png
│   │   │   ├── pytest-ok.png
│   │   │   └── set-debug.png
│   │   ├── f2-help.png
│   │   ├── f2-logo-with-no-shadow.png
│   │   ├── f2-logo-with-shadow-mini.png
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── [email protected]
│   │   ├── f2-logo-with-shadow.png
│   │   └── f2-logo.ico
│   ├── question-answer
│   │   └── qa.md
│   ├── quick-start.md
│   ├── reference
│   │   └── runtime-api.md
│   ├── site-config.md
│   ├── snippets
│   │   ├── QA.md
│   │   ├── douyin
│   │   │   ├── aweme-id.py
│   │   │   ├── format-file-name.py
│   │   │   ├── mstoken-false.py
│   │   │   ├── mstoken-real.py
│   │   │   ├── one-video.py
│   │   │   ├── s_v_web_id.py
│   │   │   ├── sec-user-id.py
│   │   │   ├── show-qrcode.py
│   │   │   ├── sso-login.py
│   │   │   ├── support-link.md
│   │   │   ├── ttwid.py
│   │   │   ├── user-collection.py
│   │   │   ├── user-collects.py
│   │   │   ├── user-folder.py
│   │   │   ├── user-follower.py
│   │   │   ├── user-following.py
│   │   │   ├── user-get-add.py
│   │   │   ├── user-like.py
│   │   │   ├── user-live-room-id.py
│   │   │   ├── user-live.py
│   │   │   ├── user-mix.py
│   │   │   ├── user-nickname.py
│   │   │   ├── user-post.py
│   │   │   ├── user-profile.py
│   │   │   ├── verify_fp.py
│   │   │   ├── video-get-add.py
│   │   │   ├── webcast-id.py
│   │   │   └── xbogus.py
│   │   ├── set-debug.py
│   │   ├── tiktok
│   │   │   ├── aweme-id.py
│   │   │   ├── format-file-name.py
│   │   │   ├── one-video.py
│   │   │   ├── sec-uid.py
│   │   │   ├── support-link.md
│   │   │   ├── token-manager.py
│   │   │   ├── unique-id.py
│   │   │   ├── user-collect.py
│   │   │   ├── user-folder.py
│   │   │   ├── user-get-add.py
│   │   │   ├── user-like.py
│   │   │   ├── user-mix.py
│   │   │   ├── user-nickname.py
│   │   │   ├── user-playlist.py
│   │   │   ├── user-post.py
│   │   │   ├── user-profile.py
│   │   │   ├── video-get-add.py
│   │   │   └── xbogus.py
│   │       └── user-profile.py
├── f2
│   ├── __init__.py
│   ├── __main__.py
│   ├── apps
│   │   ├── __apps__.py
│   │   ├── __init__.py
│   │   ├── douyin
│   │   │   ├── api.py
│   │   │   ├── cli.py
│   │   │   ├── crawler.py
│   │   │   ├── db.py
│   │   │   ├── dl.py
│   │   │   ├── filter.py
│   │   │   ├── handler.py
│   │   │   ├── help.py
│   │   │   ├── model.py
│   │   │   ├── test
│   │   │   │   ├── test_apps_model.py
│   │   │   │   ├── test_aweme_id.py
│   │   │   │   ├── test_crawler.py
│   │   │   │   ├── test_handler.py
│   │   │   │   ├── test_lrc.py
│   │   │   │   ├── test_room_id.py
│   │   │   │   ├── test_sec_user_id.py
│   │   │   │   └── test_webcast_id.py
│   │   │   └── utils.py
│   │   ├── tiktok
│   │   │   ├── api.py
│   │   │   ├── cli.py
│   │   │   ├── crawler.py
│   │   │   ├── db.py
│   │   │   ├── dl.py
│   │   │   ├── filter.py
│   │   │   ├── handler.py
│   │   │   ├── help.py
│   │   │   ├── model.py
│   │   │   └── utils.py
│   │   ├── twitter
│   │   │   ├── api.py
│   │   │   ├── cli.py
│   │   │   ├── crawler.py
│   │   │   ├── db.py
│   │   │   ├── dl.py
│   │   │   ├── filter.py
│   │   │   ├── handler.py
│   │   │   ├── help.py
│   │   │   ├── model.py
│   │   │   └── utils.py
│   ├── cli
│   │   ├── __init__.py
│   │   ├── cli_commands.py
│   │   └── cli_console.py
│   ├── conf
│   │   ├── app.yaml
│   │   ├── conf.yaml
│   │   ├── defaults.yaml
│   │   └── test.yaml
│   ├── crawlers
│   │   └── base_crawler.py
│   ├── db
│   │   └── base_db.py
│   ├── dl
│   │   └── base_downloader.py
│   ├── exceptions
│   │   ├── __init__.py
│   │   ├── api_exceptions.py
│   │   ├── db_exceptions.py
│   │   └── file_exceptions.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
│       ├── __init__.py
│       ├── _dl.py
│       ├── _signal.py
│       ├── _singleton.py
│       ├── conf_manager.py
│       ├── json_filter.py
│       ├── mode_handler.py
│       ├── utils.py
│       └── xbogus.py
│   ├── app.yaml
│   ├── conf.yaml
│   └── defaults.yaml
├── package-lock.json
├── package.json
├── pyproject.toml
├── tests
│   ├── test_cli_console.py
│   ├── test_desc_limit.py
│   ├── test_dl.py
│   ├── test_excetions.py
│   ├── test_i18n.py
│   ├── test_logger.py
│   ├── test_signal.py
│   ├── test_singleton.py
│   ├── test_utils.py
│   └── test_xbogus.py

👨‍💻 Contributions

If you are interested in extending new applications for F2, please refer to the contribution guidelines.

🙏 Acknowledgements

Without these libraries and programs, F2 would not be able to achieve these functionalities. Sincere thanks for their contributions and efforts.

⚖️ License & Disclaimer

  • Please strictly comply with the web scraping standards and do not engage in any illegal activities using this project.
  • Do not sell, share, encrypt, upload, research, or disseminate any personal information.
  • The project and its related code are for learning and research purposes only and do not constitute any express or implied warranties.
  • Users should bear all risks arising from the use of this project and its code.
  • Please comply with the Apache-2.0 open-source license and do not delete or modify any copyright information in the code.
  • Users are not allowed to use this project and its code for any form of commercial purposes and commercial activities.
  • By using this project and its code, users agree to abide by the above rules.

📜 License

Apache-2.0 license

Copyright (c) 2023 JohnserfSeed

📧 Contact

I only answer questions about F2. You can contact me through the following methods. Please be patient, and I will reply to you as soon as possible.