### Setup and Run Documentation Locally Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md Commands to set up the documentation development environment and start a local documentation server. This allows previewing documentation changes before merging. ```bash # Enable corepack to ensure pnpm is available corepack enable # Install dependencies just docs-setup # Start the documentation development server just docs-dev ``` -------------------------------- ### Yutto Configuration Example (TOML) Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/basic.md Example of how to configure Yutto's basic settings, specifically the 'download_vcodec_priority' using a TOML file. ```toml [basic] download_vcodec_priority = ["hevc", "avc", "av1"] ``` -------------------------------- ### Example: Batch download an entire series Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Example demonstrating how to batch download an entire series using the -b flag and a series URL. ```bash yutto -b https://www.bilibili.com/bangumi/play/ep395211 ``` -------------------------------- ### Example: Download a specific episode Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Example demonstrating how to download a specific episode of a series using its URL. ```bash yutto https://www.bilibili.com/bangumi/play/ep395211 ``` -------------------------------- ### Install yutto using pip Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs yutto using pip, the Python package installer. Ensure you have Python 3.10+ and FFmpeg installed and configured prior to running this command. ```bash pip install yutto ``` -------------------------------- ### Install yutto using uv Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs yutto using uv, a fast Python package installer and resolver. Like pipx, uv creates isolated environments for installed tools. ```bash uv tool install yutto ``` -------------------------------- ### Install yutto from main branch using uv Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs the latest development version of yutto from its GitHub main branch using uv. This method leverages uv's speed for installing directly from a Git repository. ```bash uv tool install git+https://github.com/yutto-dev/yutto.git@main ``` -------------------------------- ### Install yutto using Homebrew Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command shows how to install yutto using the Homebrew package manager. It involves tapping a custom repository and then installing the yutto package. ```bash brew tap siguremo/tap brew install yutto ``` -------------------------------- ### Yutto Configuration File Example (TOML) Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/introduction.md Provides an example of a `yutto.toml` configuration file, showcasing how to set basic parameters like download directories, session data, and resource requirements. This uses TOML format. ```toml #:schema https://raw.githubusercontent.com/yutto-dev/yutto/refs/heads/main/schemas/config.json [basic] # 设置下载目录 dir = "/path/to/download" # 设置临时文件目录 tmp_dir = "/path/to/tmp" # 设置 SESSDATA sessdata = "***************" # 设置大会员严格校验 vip_strict = true # 设置登录严格校验 login_strict = true [resource] # 不下载字幕 require_subtitle = false [danmaku] # 设置弹幕速度 speed = 2.0 # 设置弹幕屏蔽关键词 block_keyword_patterns = [ ".*keyword1.*", ".*keyword2.*", ] [batch] # 下载额外剧集 with_section = true ``` -------------------------------- ### Install yutto using AUR / archlinuxcn Source: https://github.com/yutto-dev/yutto/blob/main/README.md Instructions for installing yutto on Arch Linux using the Arch User Repository (AUR) with helpers like yay or paru, or from the archlinuxcn repository using pacman. ```bash # 从 AUR 安装 yay -S yutto # 适用于 yay 用户 paru -S yutto # 适用于 paru 用户 # 或者从 archlinuxcn 安装 sudo pacman -S yutto ``` -------------------------------- ### Install yutto using pipx Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs yutto using pipx, a tool for installing and running Python applications in isolated environments. This helps prevent dependency conflicts. ```bash pipx install yutto ``` -------------------------------- ### Install yutto using pip, pipx, or uv Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Install the yutto package using pip, pipx, or uv. pipx and uv are recommended for creating isolated virtual environments to avoid conflicts with other packages. uv is generally faster than pipx. ```bash pip install yutto ``` ```bash pipx install yutto # 使用 pipx uv tool install yutto # 或者使用 uv ``` -------------------------------- ### Install yutto main branch with git descriptor Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Install the latest features or bug fixes directly from the main branch of the yutto repository using pip, pipx, or uv with a git descriptor. This allows for testing unreleased changes. ```bash pip install git+https://github.com/yutto-dev/yutto@main # 通过 pip pipx install git+https://github.com/yutto-dev/yutto@main # 或者通过 pipx uv tool install git+https://github.com/yutto-dev/yutto.git@main # 或者通过 uv ``` -------------------------------- ### Install yutto from main branch using pipx Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs the latest development version of yutto from the main branch using pipx, ensuring an isolated environment for the bleeding-edge version. ```bash pipx install git+https://github.com/yutto-dev/yutto@main ``` -------------------------------- ### Install FFmpeg on macOS, Ubuntu, and Arch Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md These commands illustrate how to install FFmpeg, a crucial dependency for Yutto, on different Linux distributions and macOS using their respective package managers. ```bash brew install ffmpeg apt install ffmpeg pacman -S ffmpeg ``` -------------------------------- ### Install yutto from main branch using pip Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command installs the latest development version of yutto directly from the main branch of its GitHub repository using pip. This is useful for testing new features or bug fixes before they are officially released. ```bash pip install git+https://github.com/yutto-dev/yutto@main ``` -------------------------------- ### Select Episodes for Batch Download in Yutto CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Specifies which episodes to download in batch mode. Supports single episode selection, range selection, and comma-separated lists of episodes. Negative numbers indicate selection from the end, and special characters like '$' can be used for the last episode. Use '=' for parameters starting with '-'. ```bash # Download episode 3 yutto -b -p 3 # Download episodes 5 to 7 yutto -b -p 5~7 # Download episodes 12 and 17 yutto -b -p 12,17 # Combined selection yutto -b -p 3,5~7,12,17 # Download the 3rd to last episode yutto -b -p=-3 # Download the last episode yutto -b -p $ # Download the first 3 episodes (range from start) yutto -b -p=~3 # Download the last 4 episodes (range to end) yutto -b -p=-4~ # Complex example: first 3, 10th, 12-14, 16th, and last 4 episodes yutto -b -p "~3,10,12~14,16,-4~" ``` -------------------------------- ### Specify Time Range for Batch Downloads Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Filters batch downloads based on a specified time range (start and end time). The range is left-closed and right-open. ```APIDOC ## Specify Time Range for Batch Downloads ### Description Filters batch downloads to include only items published within a specified time range. The range is left-closed and right-open [start_time, end_time). ### Method Command-line arguments ### Parameters #### Command-line Flags - **--batch-filter-start-time** - Optional - The start of the time range (inclusive). - **--batch-filter-end-time** - Optional - The end of the time range (exclusive). - **batch.filter_start_time** - Configuration item for the start time. - **batch.filter_end_time** - Configuration item for the end time. #### Supported Time Formats: - `%Y-%m-%d` (e.g., `2020-01-01`) - `%Y-%m-%d %H:%M:%S` (e.g., `2020-01-01 10:30:00`) ### Usage Example ```bash # Download videos published in 2020 yutto -b --batch-filter-start-time=2020-01-01 --batch-filter-end-time=2021-01-01 ``` ### Notes If no time range is specified, there is no time-based restriction. ``` -------------------------------- ### Toggle Boolean Flags in CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/introduction.md Illustrates how to enable or disable features using boolean flags without specifying a value. The example shows how to enable the force overwrite option. ```bash yutto --overwrite yutto -w ``` -------------------------------- ### Load Configuration from File via CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/introduction.md Explains how to specify a configuration file using the `--config` argument. The tool also supports automatic configuration file discovery in standard locations. ```bash yutto --config /path/to/config.toml ``` -------------------------------- ### Fork and Prepare Local Repository for Contribution Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md Steps to fork the Yutto repository, clone it locally, set up upstream remote, create a new branch, and push the branch for contribution. This is the standard workflow for submitting pull requests. ```bash # First, fork on GitHub git clone git@github.com:/yutto.git # Clone your forked repo locally cd yutto/ # Change to the directory git remote add upstream git@github.com:yutto-dev/yutto.git # Bind the original repo as upstream git checkout -b # Create a new branch with a semantic name git push origin # Push the new branch to your fork ``` -------------------------------- ### Run yutto using Docker Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command demonstrates how to run yutto within a Docker container. It maps a local directory to the container's download path and specifies the Bilibili URL to download. ```bash docker run --rm -it -v /path/to/download:/app siguremo/yutto [options] ``` -------------------------------- ### Download Bilibili Video using yutto CLI Source: https://github.com/yutto-dev/yutto/blob/main/README.md This command demonstrates how to use the yutto CLI to download a Bilibili video by providing its URL. It shows the typical output, including configuration loading, login status, video stream information, subtitle generation, and download progress. ```bash ❯ yutto https://www.bilibili.com/video/BV1CTMHziEaB/ INFO 发现配置文件 yutto.toml,加载中…… 大会员 成功以大会员身份登录~ 投稿视频 《原神》动画短片——「尘间星旅」 INFO 开始处理视频 《原神》动画短片——「尘间星旅」 INFO 共包含以下 15 个视频流: INFO * 0 [AVC ] [1920x1080] <1080P 高码率> #3 INFO 1 [HEVC] [1920x1080] <1080P 高码率> #3 INFO 2 [AV1 ] [1920x1080] <1080P 高码率> #3 INFO 3 [AVC ] [1920x1080] <1080P 高清> #3 INFO 4 [HEVC] [1920x1080] <1080P 高清> #3 INFO 5 [AV1 ] [1920x1080] <1080P 高清> #3 INFO 6 [AVC ] [1280x720 ] <720P 准高清> #3 INFO 7 [HEVC] [1280x720 ] <720P 准高清> #3 INFO 8 [AV1 ] [1280x720 ] <720P 准高清> #3 INFO 9 [AVC ] [ 852x480 ] <480P 标清 > #3 INFO 10 [HEVC] [ 852x480 ] <480P 标清 > #3 INFO 11 [AV1 ] [ 852x480 ] <480P 标清 > #3 INFO 12 [AVC ] [ 640x360 ] <360P 流畅 > #3 INFO 13 [HEVC] [ 640x360 ] <360P 流畅 > #3 INFO 14 [AV1 ] [ 640x360 ] <360P 流畅 > #3 INFO 共包含以下 3 个音频流: INFO * 0 [MP4A] <320kbps > INFO 1 [MP4A] < 64kbps > INFO 2 [MP4A] <128kbps > 弹幕 ASS 弹幕已生成 INFO 开始下载…… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━ 49.25 MiB/ 54.30 MiB 32.22 MiB/⚡ ``` -------------------------------- ### Download Bilibili Video using Yutto Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md This command demonstrates how to download a Bilibili video by providing the video URL to the yutto command-line tool. It shows the typical output including loading configuration, login status, video details, and download progress. ```sh ❯ yutto https://www.bilibili.com/video/BV1CTMHziEaB/ INFO 发现配置文件 yutto.toml,加载中…… 大会员 成功以大会员身份登录~ 投稿视频 《原神》动画短片——「尘间星旅」 INFO 开始处理视频 《原神》动画短片——「尘间星旅」 INFO 共包含以下 15 个视频流: INFO * 0 [AVC ] [1920x1080] <1080P 高码率> #3 INFO 1 [HEVC] [1920x1080] <1080P 高码率> #3 INFO 2 [AV1 ] [1920x1080] <1080P 高码率> #3 INFO 3 [AVC ] [1920x1080] <1080P 高清> #3 INFO 4 [HEVC] [1920x1080] <1080P 高清> #3 INFO 5 [AV1 ] [1920x1080] <1080P 高清> #3 INFO 6 [AVC ] [1280x720 ] <720P 准高清> #3 INFO 7 [HEVC] [1280x720 ] <720P 准高清> #3 INFO 8 [AV1 ] [1280x720 ] <720P 准高清> #3 INFO 9 [AVC ] [ 852x480 ] <480P 标清 > #3 INFO 10 [HEVC] [ 852x480 ] <480P 标清 > #3 INFO 11 [AV1 ] [ 852x480 ] <480P 标清 > #3 INFO 12 [AVC ] [ 640x360 ] <360P 流畅 > #3 INFO 13 [HEVC] [ 640x360 ] <360P 流畅 > #3 INFO 14 [AV1 ] [ 640x360 ] <360P 流畅 > #3 INFO 共包含以下 3 个音频流: INFO * 0 [MP4A] <320kbps > INFO 1 [MP4A] < 64kbps > INFO 2 [MP4A] <128kbps > 弹幕 ASS 弹幕已生成 INFO 开始下载…… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━ 49.25 MiB/ 54.30 MiB 32.22 MiB/⚡ ``` -------------------------------- ### Build and Publish Docker Image Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md This command builds the Docker image for Yutto and publishes it to DockerHub. This action should be performed after a successful release to PyPI. ```bash just docker-publish ``` -------------------------------- ### Download a single video using yutto Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Use the yutto command-line tool to download a single video by providing its URL. This is the basic usage for downloading content. ```bash yutto ``` -------------------------------- ### Format Code with Ruff Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md This command formats the codebase using Ruff. It ensures code consistency across the project and adheres to specified style guidelines. Run this before committing changes. ```bash just fmt ``` -------------------------------- ### Manually Publish to PyPI Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md This command provides an alternative way to manually publish the package to PyPI. It is typically used when the automated release process needs to be bypassed or for specific deployment scenarios. ```bash just publish ``` -------------------------------- ### Trigger Release to PyPI via GitHub Actions Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md This command initiates the release process to PyPI using GitHub Actions. It typically involves creating and pushing a tag, which then triggers the automated build and deployment workflow. ```bash just release ``` -------------------------------- ### Specify Download Path using CLI Arguments Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/introduction.md Demonstrates how to specify the download directory using the `--dir` or `-d` command-line flags. Supports both space-separated and equals-sign separated key-value pairs. ```bash yutto --dir /path/to/videos yutto -d /path/to/videos yutto -d=/path/to/videos yutto --dir=/path/to/videos ``` -------------------------------- ### Batch download videos using yutto Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/quick-start.md Download multiple videos from a batch URL by using the -b or --batch flag with the yutto command. This is useful for downloading entire series or playlists. ```bash yutto --batch # 或者使用其短参数 yutto -b ``` -------------------------------- ### Enable Batch Download with Yutto CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Enables batch download mode for the Yutto CLI. This option is typically used directly on the command line for specific URL downloads and is not intended for configuration files due to its dynamic nature. ```bash yutto --batch ``` -------------------------------- ### Yutto Command Line Usage with Cookies Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/basic.md Demonstrates how to pass sensitive cookie information, such as SESSDATA, to the Yutto command-line interface, ensuring proper handling of special characters. ```bash yutto -c "d8bc7493%2C2843925707%2C08c3e*81" ``` -------------------------------- ### Combine Multiple CLI Arguments Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/introduction.md Shows how to use multiple command-line arguments simultaneously. The order of arguments, including the URL, is flexible. ```bash yutto --overwrite --dir=/path/to/videos yutto --overwrite -d /path/to/videos yutto -w --d=/path/to/videos ``` -------------------------------- ### Download Additional Episodes with Yutto CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Includes supplementary episodes when performing a batch download. This option is controlled by the `--with-section` flag or the `batch.with_section` configuration item. ```bash yutto --with-section ``` -------------------------------- ### Enable Batch Download Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Enables batch download mode for downloading multiple items from a URL. This option cannot be configured via settings. ```APIDOC ## Enable Batch Download ### Description Enables batch download mode. This is useful for downloading multiple episodes or related content from a single URL. ### Method Command-line argument ### Parameters #### Command-line Flags - **-b** or **--batch** - Required - Flag to enable batch download. ### Usage Example ```bash yutto --batch ``` ### Notes This option does not support configuration via settings files as its activation is typically link-specific. ``` -------------------------------- ### Run End-to-End Tests Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md This command executes the end-to-end tests for the Yutto project. Ensure all tests pass after making changes to verify the integrity of the codebase. ```bash just test ``` -------------------------------- ### Episode Selection Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Specifies which episodes or items to download when batch mode is enabled. Supports various selection syntaxes. ```APIDOC ## Episode Selection ### Description Allows selection of specific episodes or a range of episodes for batch download. This option is not configurable via settings. ### Method Command-line argument ### Parameters #### Command-line Flags - **-p** or **--episodes** - Optional - Specifies the episodes to download. Default is `1~-1` (all episodes). #### Episode Syntax: - ``: Select a single episode (e.g., `3`). Negative numbers select from the end (e.g., `-1` for the last episode, often represented by `$`). - `~`: Select a continuous range of episodes (e.g., `5~7`). Start `1` or end `-1` can be omitted. - `,,`: Select multiple discontinuous episodes using commas. #### Special Characters & Notes: - `-`: Use `=` to connect the flag and value when the value starts with `-` (e.g., `-p=-3`). - `$`: Represents the last episode. - `~`: When used at the start of a range (e.g., `~3`), it means from the beginning up to that episode. When used at the end (e.g., `-4~`), it means from that episode to the end. - Spaces within parameter values are not allowed. - Use quotes or `=` for values starting with special characters if issues arise. ### Usage Examples ```bash # Download episode 3 yutto -b -p 3 # Download episodes 5 through 7 yutto -b -p 5~7 # Download episodes 12 and 17 yutto -b -p 12,17 # Download episode 3, episodes 5-7, episode 12, and episode 17 yutto -b -p 3,5~7,12,17 # Download the 3rd to last episode yutto -b -p=-3 # Download the last episode yutto -b -p=$ # Download the first 3 episodes yutto -b -p=~3 # Download the last 4 episodes yutto -b -p=-4~ # Complex example: first 3, 10th, 12th-14th, 16th, and last 4 episodes yutto -b -p "~3,10,12~14,16,-4~" ``` ### Important Considerations - Episode numbers are sequential, not necessarily the displayed episode number (e.g., for special cases like 'x.5' episodes). - Batch download with episode selection is not supported for personal spaces, video lists, or favorites. ``` -------------------------------- ### Download Additional Sections Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Includes additional sections or related content when downloading in batch mode. ```APIDOC ## Download Additional Sections ### Description Includes related or additional sections of content during batch downloads. ### Method Command-line argument ### Parameters #### Command-line Flags - **-s** or **--with-section** - Optional - Flag to include additional sections. Default is `False`. - **batch.with_section** - Configuration item for this functionality. ### Usage Example ```bash yutto -b -s ``` ``` -------------------------------- ### Filter Batch Downloads by Publication Time in Yutto CLI Source: https://github.com/yutto-dev/yutto/blob/main/docs/guide/cli/batch.md Filters batch downloads based on the publication time of the content. The `--batch-filter-start-time` and `--batch-filter-end-time` parameters define a left-closed, right-open interval. Supported time formats include '%Y-%m-%d' and '%Y-%m-%d %H:%M:%S'. ```bash # Download videos published in 2020 yutto --batch-filter-start-time=2020-01-01 --batch-filter-end-time=2021-01-01 ``` -------------------------------- ### Update Local Repository After PR Merge Source: https://github.com/yutto-dev/yutto/blob/main/CONTRIBUTING.md Commands to update your local repository after your pull request has been merged. This involves switching to the main branch, fetching upstream changes, merging them, and cleaning up old local branches. ```bash git checkout main # Switch to the main branch git fetch upstream # Download the latest changes from the original repo git merge upstream/main # Merge the latest changes into your local main branch git branch -d # Delete the local branch git push origin --delete # Delete the remote branch ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.