Coder Social home page Coder Social logo

crunchy-labs / crunchy-cli Goto Github PK

View Code? Open in Web Editor NEW
570.0 10.0 55.0 1.21 MB

👇 Command-line downloader for Crunchyroll

License: MIT License

Rust 99.24% Nix 0.76%
crunchyroll crunchyroll-api crunchyroll-downloader anime anime-downloader anime-streaming downloader crunchyroll-enhancer rust rust-lang

crunchy-cli's Introduction

This project has been sunset as Crunchyroll moved to a DRM-only system. See #362.

Well there is one endpoint which still has DRM-free streams, I guess I still have a bit time until (finally) everything is DRM-only.

crunchy-cli

👇 A Command-line downloader for Crunchyroll.

Code size Download Badge License Release Discord Build

Usage 🖥️Disclaimer 📜License ⚖

We are in no way affiliated with, maintained, authorized, sponsored, or officially associated with Crunchyroll LLC or any of its subsidiaries or affiliates. The official Crunchyroll website can be found at www.crunchyroll.com.

✨ Features

  • Download single videos and entire series from Crunchyroll.
  • Archive episodes or seasons in an .mkv file with multiple subtitles and audios.
  • Specify a range of episodes to download from an anime.
  • Search through the Crunchyroll collection and return metadata (title, duration, direct stream link, ...) of all media types.

💾 Get the executable

📥 Download the latest binaries

Check out the releases tab and get the binary from the latest (pre-)release.

📦 Get it via a package manager

  • AUR

    If you're using Arch or an Arch based Linux distribution you are able to install our AUR package. You need an AUR helper like yay to install it.

    # this package builds crunchy-cli manually (recommended)
    $ yay -S crunchy-cli
    # this package installs the latest pre-compiled release binary
    $ yay -S crunchy-cli-bin
  • Scoop

    For Windows users, we support the scoop command-line installer.

    $ scoop bucket add extras
    $ scoop install extras/crunchy-cli
  • Homebrew

    For macOS/linux users, we support the brew command-line installer. Packages are compiled by the homebrew project, and will also install the openssl@3 and ffmpeg dependencies.

    $ brew install crunchy-cli

    Supported archs: x86_64_linux, arm64_monterey, sonoma, ventura

  • Nix

    This requires nix and you'll probably need --extra-experimental-features "nix-command flakes", depending on your configurations.

    $ nix <run|shell|develop> github:crunchy-labs/crunchy-cli

🛠 Build it yourself

Since we do not support every platform and architecture you may have to build the project yourself. This requires git and Cargo.

$ git clone https://github.com/crunchy-labs/crunchy-cli
$ cd crunchy-cli
# either just build it (will be available in ./target/release/crunchy-cli)...
$ cargo build --release
# ... or install it globally
$ cargo install --force --path .

🖥️ Usage

All shown commands are examples 🧑🏼‍🍳

Global Flags

crunchy-cli requires you to log in. Though you can use a non-premium account, you will not have access to premium content without a subscription. You can authenticate with your credentials (email:password) or by using a refresh token.

  • Credentials

    $ crunchy-cli --credentials "email:password" <command>
  • Stay Anonymous

    Login without an account (you won't be able to access premium content):

    $ crunchy-cli --anonymous <command>

Global settings

You can set specific settings which will be

  • Verbose output

    If you want to include debug information in the output, use the -v / --verbose flag to show it.

    $ crunchy-cli -v <command>

    This flag can't be used in combination with -q / --quiet.

  • Quiet output

    If you want to hide all output, use the -q / --quiet flag to do so. This is especially useful if you want to pipe the output video to an external program (like a video player).

    $ crunchy-cli -q <command>

    This flag can't be used in combination with -v / --verbose.

  • Language

    By default, the resulting metadata like title or description are shown in your system language (if Crunchyroll supports it, else in English). If you want to show the results in another language, use the --lang flag to set it.

    $ crunchy-cli --lang de-DE <command>
  • Experimental fixes

    Crunchyroll constantly changes and breaks its services or just delivers incorrect answers. The --experimental-fixes flag tries to fix some of those issues. As the experimental in --experimental-fixes states, these fixes may or may not break other functionality.

    $ crunchy-cli --experimental-fixes <command>

    For an overview which parts this flag affects, see the documentation of the underlying Crunchyroll library, all functions beginning with stabilization_ are applied.

  • Proxy

    The --proxy flag supports https and socks5 proxies to route all your traffic through. This may be helpful to bypass the geo-restrictions Crunchyroll has on certain series. You are also able to set in which part of the cli a proxy should be used. Instead of a normal url you can also use: <url>: (only proxies api requests), :<url> (only proxies download traffic), <url>:<url> (proxies api requests through the first url and download traffic through the second url).

    $ crunchy-cli --proxy socks5://127.0.0.1:8080 <command>

    Make sure that proxy can either forward TLS requests, which is needed to bypass the (cloudflare) bot protection, or that it is configured so that the proxy can bypass the protection itself.

  • User Agent

    There might be cases where a custom user agent is necessary, e.g. to bypass the cloudflare bot protection (#104). In such cases, the --user-agent flag can be used to set a custom user agent.

    $ crunchy-cli --user-agent "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)" <command>

    Default is the user agent, defined in the underlying library.

  • Speed limit

    If you want to limit how fast requests/downloads should be, you can use the --speed-limit flag. Allowed units are B (bytes), KB (kilobytes) and MB (megabytes).

    $ crunchy-cli --speed-limit 10MB

Login

The login command can store your session, so you don't have to authenticate every time you execute a command.

# save the refresh token which gets generated when login with credentials.
# your email and password won't be stored at any time on disk
$ crunchy-cli login --credentials "email:password"

With the session stored, you do not need to pass --credentials / --anonymous anymore when you want to execute a command.

Download

The download command lets you download episodes with a specific audio language and optional subtitles.

Supported urls

  • Single episode (with episode filtering)
    $ crunchy-cli download https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Series (with episode filtering)
    $ crunchy-cli download https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

Options

  • Audio language

    Set the audio language with the -a / --audio flag. This only works if the url points to a series since episode urls are language specific.

    $ crunchy-cli download -a de-DE https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is your system locale. If not supported by Crunchyroll, en-US (American English) is the default.

  • Subtitle language

    Besides the audio, you can specify the subtitle language by using the -s / --subtitle flag. In formats that support it (.mp4, .mov and .mkv ), subtitles are stored as soft-subs. All other formats are hardsubbed: the subtitles will be burned into the video track (cf. hardsub) and thus can not be turned off.

    $ crunchy-cli download -s de-DE https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is none.

  • Output template

    Define an output template by using the -o / --output flag.

    $ crunchy-cli download -o "ditf.mp4" https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome

    Default is {title}.mp4. See the Template Options section below for more options.

  • Output template for special episodes

    Define an output template which only gets used when the episode is a special (episode number is 0 or has non-zero decimal places) by using the --output-special flag.

    $ crunchy-cli download --output-specials "Special EP - {title}" https://www.crunchyroll.com/watch/GY8D975JY/veldoras-journal

    Default is the template, set by the -o / --output flag. See the Template Options section below for more options.

  • Universal output

    The output template options can be forced to get sanitized via the --universal-output flag to be valid across all supported operating systems (Windows has a lot of characters which aren't allowed in filenames...).

    $ crunchy-cli download --universal-output -o https://www.crunchyroll.com/watch/G7PU4XD48/tales-veldoras-journal-2
  • Resolution

    The resolution for videos can be set via the -r / --resolution flag.

    $ crunchy-cli download -r worst https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome

    Default is best.

  • Language tagging

    You can force the usage of a specific language tagging in the output file with the --language-tagging flag. This might be useful as some video players doesn't recognize the language tagging Crunchyroll uses internally.

    $ crunchy-cli download --language-tagging ietf https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • FFmpeg Preset

    You can specify specific built-in presets with the --ffmpeg-preset flag to convert videos to a specific coding while downloading. Multiple predefined presets how videos should be encoded (h264, h265, av1, ...) are available, you can see them with crunchy-cli download --help. If you need more specific ffmpeg customizations you could either convert the output file manually or use ffmpeg output arguments as value for this flag.

    $ crunchy-cli download --ffmpeg-preset av1-lossless https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • FFmpeg threads

    If you want to manually set how many threads FFmpeg should use, you can use the --ffmpeg-threads flag. This does not work with every codec/preset and is skipped entirely when specifying custom ffmpeg output arguments instead of a preset for --ffmpeg-preset.

    $ crunchy-cli download --ffmpeg-threads 4 https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Skip existing

    If you re-download a series but want to skip episodes you've already downloaded, the --skip-existing flag skips the already existing/downloaded files.

    $ crunchy-cli download --skip-existing https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • Skip specials

    If you doesn't want to download special episodes, use the --skip-specials flag to skip the download of them.

    $ crunchy-cli download --skip-specials https://www.crunchyroll.com/series/GYZJ43JMR/that-time-i-got-reincarnated-as-a-slime[S2]
  • Include chapters

    Crunchyroll sometimes provide information about skippable events like the intro or credits. These information can be stored as chapters in the resulting video file via the --include-chapters flag.

    $ crunchy-cli download --include-chapters https://www.crunchyroll.com/watch/G0DUND0K2/the-journeys-end
  • Yes

    Sometimes different seasons have the same season number (e.g. Sword Art Online Alicization and Alicization War of Underworld are both marked as season 3), in such cases an interactive prompt is shown which needs user further user input to decide which season to download. The --yes flag suppresses this interactive prompt and just downloads all seasons.

    $ crunchy-cli download --yes https://www.crunchyroll.com/series/GR49G9VP6/sword-art-online

    If you've passed the -q / --quiet global flag, this flag is automatically set.

  • Force hardsub

    If you want to burn-in the subtitles, even if the output format/container supports soft-subs (e.g. .mp4), use the --force-hardsub flag to do so.

    $ crunchy-cli download --force-hardsub -s en-US https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Threads

    To increase the download speed, video segments are downloaded simultaneously by creating multiple threads. If you want to manually specify how many threads to use when downloading, do this with the -t / --threads flag.

    $ crunchy-cli download -t 1 https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    The default thread count is the count of cpu threads your pc has.

Archive

The archive command lets you download episodes with multiple audios and subtitles and merges it into a .mkv file.

Supported urls

  • Single episode (with episode filtering)
    $ crunchy-cli archive https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Series (with episode filtering)
    $ crunchy-cli archive https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

Options

  • Audio languages

    Set the audio language with the -a / --audio flag. Can be used multiple times.

    $ crunchy-cli archive -a ja-JP -a de-DE https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is your system locale (if not supported by Crunchyroll, en-US (American English) and ja-JP (Japanese) are used).

  • Subtitle languages

    Besides the audio, you can specify the subtitle language by using the -s / --subtitle flag.

    $ crunchy-cli archive -s de-DE https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is all subtitles.

  • Output template

    Define an output template by using the -o / --output flag. crunchy-cli exclusively uses the .mkv container format, because of its ability to store multiple audio, video and subtitle tracks at once.

    $ crunchy-cli archive -o "{title}.mkv" https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is {title}.mkv. See the Template Options section below for more options.

  • Output template for special episodes

    Define an output template which only gets used when the episode is a special (episode number is 0 or has non-zero decimal places) by using the --output-special flag. crunchy-cli exclusively uses the .mkv container format, because of its ability to store multiple audio, video and subtitle tracks at once.

    $ crunchy-cli archive --output-specials "Special EP - {title}" https://www.crunchyroll.com/watch/GY8D975JY/veldoras-journal

    Default is the template, set by the -o / --output flag. See the Template Options section below for more options.

  • Universal output

    The output template options can be forced to get sanitized via the --universal-output flag to be valid across all supported operating systems (Windows has a lot of characters which aren't allowed in filenames...).

    $ crunchy-cli archive --universal-output -o https://www.crunchyroll.com/watch/G7PU4XD48/tales-veldoras-journal-2
  • Resolution

    The resolution for videos can be set via the -r / --resolution flag.

    $ crunchy-cli archive -r worst https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is best.

  • Merge behavior

    Due to censorship or additional intros, some episodes have multiple lengths for different languages. In the best case, when multiple audio & subtitle tracks are used, there is only one video track and all other languages can be stored as audio-only. But, as said, this is not always the case. With the -m / --merge flag you can define the behaviour when an episodes' video tracks differ in length. Valid options are audio - store one video and all other languages as audio only; video - store the video + audio for every language; auto - detect if videos differ in length: if so, behave like video - otherwise like audio; sync - detect if videos differ in length: if so, it tries to find the offset of matching audio parts and removes the offset from the beginning, otherwise it behaves like audio. Subtitles will always match the primary audio and video.

    $ crunchy-cli archive -m audio https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is auto.

  • Merge time tolerance

    Sometimes two video tracks are downloaded with --merge set to auto even if they only differ some milliseconds in length which shouldn't be noticeable to the viewer. To prevent this, you can specify a range in milliseconds with the --merge-time-tolerance flag that only downloads one video if the length difference is in the given range.

    $ crunchy-cli archive -m auto --merge-time-tolerance 100 https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default are 200 milliseconds.

  • Merge sync tolerance

    Sometimes two video tracks are downloaded with --merge set to sync because the audio fingerprinting fails to identify matching audio parts (e.g. opening). To prevent this, you can use the --merge-sync-tolerance flag to specify the difference by which two fingerprints are considered equal.

    $ crunchy-cli archive -m sync --merge-sync-tolerance 3 https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome

    Default is 6.

  • Merge sync precision

    If you use --merge set to sync and the syncing seems to be not accurate enough or takes to long, you can use the --sync-precision flag to specify the amount of offset determination runs from which the final offset is calculated.

    $ crunchy-cli archive -m sync --merge-sync-precision 3 https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome

    Default is 4.

  • Language tagging

    You can force the usage of a specific language tagging in the output file with the --language-tagging flag. This might be useful as some video players doesn't recognize the language tagging Crunchyroll uses internally.

    $ crunchy-cli archive --language-tagging ietf https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • FFmpeg Preset

    You can specify specific built-in presets with the --ffmpeg-preset flag to convert videos to a specific coding while downloading. Multiple predefined presets how videos should be encoded (h264, h265, av1, ...) are available, you can see them with crunchy-cli archive --help. If you need more specific ffmpeg customizations you could either convert the output file manually or use ffmpeg output arguments as value for this flag.

    $ crunchy-cli archive --ffmpeg-preset av1-lossless https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • FFmpeg threads

    If you want to manually set how many threads FFmpeg should use, you can use the --ffmpeg-threads flag. This does not work with every codec/preset and is skipped entirely when specifying custom ffmpeg output arguments instead of a preset for --ffmpeg-preset.

    $ crunchy-cli archive --ffmpeg-threads 4 https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Default subtitle

    --default-subtitle Set which subtitle language is to be flagged as default and forced.

    $ crunchy-cli archive --default-subtitle en-US https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is none.

  • Include fonts

    You can include the fonts required by subtitles directly into the output file with the --include-fonts flag. This will use the embedded font for subtitles instead of the system font when playing the video in a video player which supports it.

    $ crunchy-cli archive --include-fonts https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • Include chapters

    Crunchyroll sometimes provide information about skippable events like the intro or credits. These information can be stored as chapters in the resulting video file via the --include-chapters flag. This flag only works if --merge is set to audio because chapters cannot be mapped to a specific video steam.

    $ crunchy-cli archive --include-chapters https://www.crunchyroll.com/watch/G0DUND0K2/the-journeys-end
  • Skip existing

    If you re-download a series but want to skip episodes you've already downloaded, the --skip-existing flag skips the already existing/downloaded files.

    $ crunchy-cli archive --skip-existing https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • Skip existing method

    By default, already existing files are determined by their name and the download of the corresponding episode is skipped. But sometimes Crunchyroll adds dubs or subs to an already existing episode and these changes aren't recognized and --skip-existing just skips it. This behavior can be changed by the --skip-existing-method flag. Valid options are audio and subtitle (if the file already exists but the audio/subtitle are less from what should be downloaded, the episode gets downloaded and the file overwritten).

    $ crunchy-cli archive --skip-existing-method audio --skip-existing-method video https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • Skip specials

    If you doesn't want to download special episodes, use the --skip-specials flag to skip the download of them.

    $ crunchy-cli archive --skip-specials https://www.crunchyroll.com/series/GYZJ43JMR/that-time-i-got-reincarnated-as-a-slime[S2]
  • Yes

    Sometimes different seasons have the same season number (e.g. Sword Art Online Alicization and Alicization War of Underworld are both marked as season 3), in such cases an interactive prompt is shown which needs user further user input to decide which season to download. The --yes flag suppresses this interactive prompt and just downloads all seasons.

    $ crunchy-cli archive --yes https://www.crunchyroll.com/series/GR49G9VP6/sword-art-online

    If you've passed the -q / --quiet global flag, this flag is automatically set.

  • Threads

    To increase the download speed, video segments are downloaded simultaneously by creating multiple threads. If you want to manually specify how many threads to use when downloading, do this with the -t / --threads flag.

    $ crunchy-cli archive -t 1 https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    The default thread count is the count of cpu threads your pc has.

Search

The search command is a powerful tool to query the Crunchyroll library. It behaves like the regular search on the website but is able to further process the results and return everything it can find, from the series title down to the raw stream url. Using this command with the --anonymous flag or a non-premium account may return incomplete results.

Supported urls/input

  • Single episode (with episode filtering)
    $ crunchy-cli search https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Series (with episode filtering)
    $ crunchy-cli search https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx
  • Search input
    $ crunchy-cli search "darling in the franxx"

Options

  • Audio

    Set the audio language to search via the --audio flag. Can be used multiple times.

    $ crunchy-cli search --audio en-US https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is your system locale.

  • Result limit

    If your input is a search term instead of an url, you have multiple options to control which results to process. The --search-top-results-limit flag sets the limit of top search results to process. --search-series-limit sets the limit of only series, --search-movie-listing-limit of only movie listings, --search-episode-limit of only episodes and --search-music-limit of only concerts and music videos.

    $ crunchy-cli search --search-top-results-limit 10 "darling in the franxx"
    # only return series which have 'darling' in it. do not return top results which might also be non-series items
    $ crunchy-cli search --search-top-results-limit 0 --search-series-limit 10 "darling"
    # this returns 2 top results, 3 movie listings, 5 episodes and 1 music item as result
    $ crunchy-cli search --search-top-results-limit 2 --search-movie-listing-limit 3 --search-episode-limit 5 --search-music-limit 1 "test"

    Default is 5 for --search-top-results-limit, 0 for all others.

  • Output template

    The search command is designed to show only the specific information you want. This is done with the -o/--output flag. You can specify keywords in a specific pattern, and they will get replaced in the output text. The required pattern for this begins with {{, then the keyword, and closes with }} (e.g. {{episode.title}}). For example, if you want to get the title of an episode, you can use Title: {{episode.title}} and {{episode.title}} will be replaced with the episode title. You can see all supported keywords with crunchy-cli search --help.

    $ crunchy-cli search -o "{{series.title}}" https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx

    Default is S{{season.number}}E{{episode.number}} - {{episode.title}}.


Output Template Options

You can use various template options to change how the filename is processed. The following tags are available:

  • {title} → Title of the video
  • {series_name} → Name of the series
  • {season_name} → Name of the season
  • {audio} → Audio language of the video
  • {width} → Width of the video
  • {height} → Height of the video
  • {season_number} → Number of the season
  • {episode_number} → Number of the episode
  • {relative_episode_number} → Number of the episode relative to its season
  • {sequence_number} → Like {episode_number} but without possible non-number characters
  • {relative_sequence_number} → Like {relative_episode_number} but with support for episode 0's and .5's
  • {release_year} → Release year of the video
  • {release_month} → Release month of the video
  • {release_day} → Release day of the video
  • {series_id} → ID of the series
  • {season_id} → ID of the season
  • {episode_id} → ID of the episode

Example:

$ crunchy-cli archive -o "[S{season_number}E{episode_number}] {title}.mkv" https://www.crunchyroll.com/series/G8DHV7W21/dragon-ball
# Output file: '[S01E01] Secret of the Dragon Ball.mkv'

Episode filtering

Filters patterns can be used to download a specific range of episodes from a single series.

A filter pattern may consist of either a season, an episode, or a combination of the two. When used in combination, seasons S must be defined before episodes E.

There are many possible patterns, for example:

  • ...[E5] - Download the fifth episode.
  • ...[S1] - Download the whole first season.
  • ...[-S2] - Download the first two seasons.
  • ...[S3E4-] - Download everything from season three, episode four, onwards.
  • ...[S1E4-S3] - Download season one, starting at episode four, then download season two and three.
  • ...[S3,S5] - Download season three and five.
  • ...[S1-S3,S4E2-S4E6] - Download season one to three, then episodes two to six from season four.

In practice, it would look like this:

https://www.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx[E1-E5]

📜 Disclaimer

This tool is meant for private use only. You need a Crunchyroll Premium subscription to access premium content.

You are entirely responsible for what happens when you use crunchy-cli.

⚖ License

This project is licensed under the MIT License - see the LICENSE file for more details.

crunchy-cli's People

Contributors

adracea avatar bytedream avatar dependabot[bot] avatar frooastside avatar hannesbraun avatar hekmon avatar hitorilabs avatar ichbinleoon avatar kennedy avatar kevinstaude avatar kralverde avatar lordbex avatar nannk avatar nightquest avatar pdmahon1 avatar serverfrog avatar username404-59 avatar valentinegb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crunchy-cli's Issues

Login failure - invalid session id, user is not logged in

Hi, When I try to log in using crunchy, I get the following message from below and need to wait a while or switch proxies to use it
crunchy login --persistent <email> <password> -p http://127.0.0.1:****
invalid session id, user is not logged in

os: windows 11 22000
version: 2.2.1 (Installation via scoop)

crunchy info and downloads with www... failed

Der crunchy info Befehl funktioniert nicht mehr liegt vermutlich daran das crunchyroll die beta beendet hat
Die 'Beta-Version' ist nun ganz normal unter https://www.crunchyroll.com/de/ aufzufinden.

$ crunchy info
➞ An error occurred: error for endpoint https://www.crunchyroll.com/accounts/v1/me (403): invalid json response: invalid character '<' looking for beginning of value

Auch downloads welche mit www anstelle von beta ausgeführt werden brechen ab

[err] An error occurred: failed to get episodes: invalid url https://www.crunchyroll.com/de/series/G0XHWM5GQ/the-human-crazy-university

tausche ich das www hingegen mit beta aus funktioniert der download normal

liegt wahrscheinlich daran das der parser nicht damit umgehen kann das unter www nun die beta Seite ist

FFmpeg optimizations

In some circumstances ffmpeg takes a long time to encode video files, especially when using archive. Since gpus are a thing and ffmpeg has support for it, some optimizations can be done to use the gpu for faster encoding.

[Request]

Make an option to Disable --merge auto default.

I just want to download series without merging them with different audios and videos.

app.exe archive %stream% -l all -r best -d "{series_name}\Season {season_number}{audio}" -o "{series_name} [S{season_number}E{episode_number}] - {title} - [{resolution}].mkv"

This is the command i'm using.
As a result, it gives my Episode with a few videos and a few audios.
I just want it to download Episode 1 [Japanese].mkv, Episode 1 [English].mkv, etc...

Filter by Season name

Would it be possible to add a feature where you can set a filter by season name, atm having an issue where S3 and S4 are labeled S3 but have different names so it won't grab all the episodes

Archive: enhance mkv tracks metadata

Hello,

Just wondering why subtitles have their title set to human readable locale but not the their metadata language field ? (which is even more important for players to automatically select the right one for their user)

You do set the language field for video and audio. Why not subtitles ?

It seems to me that your actual locales would be valid values for mkv (from what I see in mkvtoolnix-gui).

Anyway, thank you for your work this software has been working flawlessly so far !

output parsing wrong

I Use:
crunchyroll-go --color download --output '{series_name} - S{season_number}E{episode_number} - {title} [{resolution},{fps},{audio},{subtitle}].mkv' 'https://www.crunchyroll.com/de/love-chunibyo-other-delusions'

But the output is:
Love, Chunibyo & Other Delusions - SE - Chance Encounter... with Wicked Lord Shingan [1920x1080,23,de-DE,].mkv

The series_name not match with the crunchyroll-go help download page and the both season_number, episode_number work nothing.

I think the first issue is fast to fix here: https://github.com/ByteDream/crunchyroll-go/blob/master/cmd/crunchyroll-go/cmd/download.go#L80

But for season_number and episode_number have i no idea.

Subtitle Track - not hard-subbed

Feature Improvement:

Would it be possible to get the subtitle in a separat subtitle track and not hardcoded? That would allow to increase subtitle text size on some players (got problems with my eyes and it is always to small).

And by the way: Great work! I love your CLI tool! :)

Bug Report: Touble to download a complete series that have more than one season

Hi,

First of all, thank you for your hard work, the downloader is amazing.

But I found a strange bug, I noticed it now on several series.

For Example I tried to download The Fruit of Grisaia.
I entered fallowing command to download the series.

crunchy download -r best --output "{series_name} - S{season_number}E{episode_number} - {title}.mkv" --audio ja-JP --subtitle de-DE --no-hardsub https://www.crunchyroll.com/the-fruit-of-grisaia

But somehow it randomly takes some Episodes from Season 1 and then from Season 3:

=> ✔ Logged in 
=> ✔ Parsed url 1 with 14 successes and 0 fails
=> 14 of 14 episodes could be parsed

=> Downloads:
=> 	1. Ordinary Academy Life » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E01)
=> 	2. School Killer Sakaki » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E02)
=> 	3. The Cocoon of Caprice III » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S03E03)
=> 	4. Where to Aim the Silver Bullet » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E04)
=> 	5. The Seed of Blanc Aile I » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S03E05)
=> 	6. The Seed of Blanc Aile II » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S03E06)
=> 	7. The Seed of Blanc Aile III » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S03E07)
=> 	8. Seed of the World Tree I » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E08)
=> 	9. Seed of the World Tree II » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E09)
=> 	10. Angelic Howl I » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E10)
=> 	11. Angelic Howl II » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E11)
=> 	12. Angelic Howl III » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E12)
=> 	13. 10 Centimeter Field of Fire » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S01E13)
=> 	14. The Cocoon of Caprice 0 » 1920x1080px, 23.97 FPS, Japanese audio (The Fruit of Grisaia S02E14)

As you saw, episode 1 - 2 are from season 1 and episode 3 is randomly from season 3

I noticed the bug also on

  • My Teen Romantic Comedy SNAFU
  • Is It Wrong to Try to Pick Up Girls in a Dungeon?
  • My Next Life as a Villainess

In my opinion this problem only occurs on shows that have more than one seasons.

I tried then to download them link by link using fallowing command

I used lynx -dump https://www.crunchyroll.com/the-fruit-of-grisaia | awk '/http/{print $2}' | grep -Ei episode to get a list of episodes

https://www.crunchyroll.com/the-fruit-of-grisaia/episode-10-the-seed-of-blanc-aile-vi-678079
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-9-the-seed-of-blanc-aile-v-678077
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-8-the-seed-of-blanc-aile-iv-678075
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-7-the-seed-of-blanc-aile-iii-678073
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-6-the-seed-of-blanc-aile-ii-678071
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-5-the-seed-of-blanc-aile-i-678069
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-4-the-cocoon-of-caprice-iv-678067
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-3-the-cocoon-of-caprice-iii-678065
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-2-the-cocoon-of-caprice-ii-678063
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-1-the-cocoon-of-caprice-i-678061
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-14-the-cocoon-of-caprice-0-678007
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-13-10-centimeter-field-of-fire-661517
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-12-angelic-howl-iii-661515
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-11-angelic-howl-ii-661513
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-10-angelic-howl-i-661511
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-9-seed-of-the-world-tree-ii-661509
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-8-seed-of-the-world-tree-i-661507
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-7-letter-of-happiness-661505
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-6-raison-dtre-661503
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-5-vox-in-box-661501
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-4-where-to-aim-the-silver-bullet-661499
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-3-sweet-diet-661497
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-2-school-killer-sakaki-661495
https://www.crunchyroll.com/the-fruit-of-grisaia/episode-1-ordinary-academy-life-661493

Then I run the command to download every episode link by link

lynx -dump https://www.crunchyroll.com/the-fruit-of-grisaia | awk '/http/{print $2}' | grep -Ei episode | parallel -j 1 '~/Tools/crunchyroll-go/crunchy download -r best --output "{series_name} - S{season_number}E{episode_number} - {title}.mkv" --audio ja-JP --subtitle de-DE --no-hardsub {}'

After the Download has finished, I noticed that some files had the same file name, for example S01E02 exists twice

./The Fruit of Grisaia - S01E02 - School Killer Sakaki (0).mkv
./The Fruit of Grisaia - S01E13 - 10 Centimeter Field of Fire.mkv
./The Fruit of Grisaia - S01E10 - Angelic Howl I.mkv
./The Fruit of Grisaia - S01E04 - Where to Aim the Silver Bullet.mkv
./The Fruit of Grisaia - S01E04 - Where to Aim the Silver Bullet (0).mkv
./The Fruit of Grisaia - S02E14 - The Cocoon of Caprice 0.mkv
./The Fruit of Grisaia - S01E08 - Seed of the World Tree I.mkv
./The Fruit of Grisaia - S01E07 - Letter of Happiness (0).mkv
./The Fruit of Grisaia - S01E07 - Letter of Happiness.mkv
./The Fruit of Grisaia - S03E01 - The Cocoon of Caprice I.mkv
./The Fruit of Grisaia - S01E02 - School Killer Sakaki.mkv
./The Fruit of Grisaia - S03E09 - The Seed of Blanc Aile V.mkv
./The Fruit of Grisaia - S03E03 - The Cocoon of Caprice III.mkv
./The Fruit of Grisaia - S01E11 - Angelic Howl II.mkv
./The Fruit of Grisaia - S03E06 - The Seed of Blanc Aile II.mkv
./The Fruit of Grisaia - S03E05 - The Seed of Blanc Aile I.mkv
./The Fruit of Grisaia - S01E10 - Angelic Howl I (0).mkv
./The Fruit of Grisaia - S03E01 - The Cocoon of Caprice I (0).mkv
./The Fruit of Grisaia - S03E05 - The Seed of Blanc Aile I (0).mkv
./The Fruit of Grisaia - S01E09 - Seed of the World Tree II.mkv
./The Fruit of Grisaia - S01E08 - Seed of the World Tree I (0).mkv
./The Fruit of Grisaia - S01E12 - Angelic Howl III.mkv
./The Fruit of Grisaia - S01E06 - Raison D'être.mkv
./The Fruit of Grisaia - S03E03 - The Cocoon of Caprice III (0).mkv

I checked the md5sum of these two, and both were different

948d23a154a245f33f1ef5123831a53a  The Fruit of Grisaia - S01E02 - School Killer Sakaki.mkv
b2a6bca9f9f8c09f2e7cdbd2acdb633a  The Fruit of Grisaia - S01E02 - School Killer Sakaki (0).mkv

But the video content is the same, so it downloaded the episode twice.

And that's strange, I cannot explain why this happens do you have an idea?

Thank you in advance
Mike

Windows format & output bugs

When downloading videos under windows some bugs do appear

  • Invalid success prefix (the spelling mistake is on linux too)
    image

  • Missing newline / linebreak
    image

  • Wrong destination file
    image

Add output option for episode numbers relative to its season

The format option {episode_number} for the output file represents the episode number of the episode which is currently downloaded. In the most cases, this number is relative to the first season of the series downloaded. For example, you have season 1 with episode 1 - 13 and season 2 with episode 14 - 39 and -o "S{season_number}E{episode_number}" which results to S2E20 (for episode 7 of the 2nd season).
There is currently no way to format the output file name to match episode numbers relative to its season (episode 7 of the 2nd season would resolve to S2E7 in this case).

The audio track disappears because of the reencode

I noticed that since the update with the reencode, when downloading several audio tracks, only the Japanese one was left
I therefore removed the code for reencode and tried again.
Now they were all there.

Mein Test Command war

./crunchy archive 'https://beta.crunchyroll.com/de/series/G1XHJV2X9/lycoris-recoil[S01E02]' --merge audio  -v --resolution worst -l ja-JP -l de-DE 

MediaInfo with reencode:

Matroska:97,4 MiB, 24 min 2s
1 Video stream: AVC
1 Audio stream: AAC LC                         <- different number
1 Text stream: ASS
Dauer: 24 min 2s
Gesamte Bitrate: 567 kb/s.                      <- and here a different bitrate 
Kodierendes Programm: Lavf59.27.100
verwendete Encoder-Bibliothek: Lavf59.27.100
ErrorDetectionType: Per level 1

without:

Matroska:109 MiB, 24 min 2s
1 Video stream: AVC
2 Audio streams: AAC LC / AAC LC.            <- different number
1 Text stream: ASS
Dauer: 24 min 2s
Gesamte Bitrate: 632 kb/s.                           <- and here a different bitrate 
Kodierendes Programm: Lavf59.27.100
verwendete Encoder-Bibliothek: Lavf59.27.100
ErrorDetectionType: Per level 1

Problem with Spaces in Folder- and Filename?

I am using the newest Version on Windows and specify an Output Folder and Name with Spaces in it. Without Spaces it works.

When i run(cmd/powershell):

.\crunchy.exe archive -l de-DE -l ja-JP -r best -d "F:\Anime\{series_name}\{season_number} {season_name}\" -o "S{season_number}E{episode_number} {title}.mkv" https://www.crunchyroll.com/series/GRMG8ZQZR/one-piece[S1E1]

It Results in (notice the {title}.mkv which shouldnt be there):

=> Failed to parse url 1
=> An error occurred: failed to get episodes: invalid url {title}.mkv https://www.crunchyroll.com/series/GRMG8ZQZR/one-piece

I have also tried escaping the spaces with ^ and ` and enclosing Paths with double and Single Quotation Marks.
Is this a Bug, or does my linux brain just not understand how to use the Windows Shell?

login failed with go runtime error

[debug] Executing `login` command with 2 arg(s)
[debug] Logging in via credentials
[err] interface conversion: interface {} is nil, not map[string]interface {}: goroutine 1 [running]:
runtime/debug.Stack()
	/opt/homebrew/Cellar/go/1.18.1/libexec/src/runtime/debug/stack.go:24 +0x68
github.com/ByteDream/crunchyroll-go/cmd/crunchyroll-go/cmd.Execute.func1()

By poking around in the code, I found out that login queries where denied (most likely by cloudflare) with 429 Too Many Requests and returned body was empty, preventing the casting of non present values.

I will send you a PR handling such cases.

Error running under Windows

when i run under windows

crunchy download -o "daaaaaaaaaaaaaaaarling.mkv" --audio ja-JP --subtitle ja-JP https://beta.crunchyroll.com/series/GY8VEQ95Y/darling-in-the-franxx -v -g 32 -p http://127.0.0.1:7890

it will error like this

[debug] Executing `download` command with 1 arg(s)
[info] Using custom proxy http://127.0.0.1:7890
[debug] Validating arguments
[debug] Custom file ending '.mkv' (ffmpeg is installed)
[debug] Locales: audio: ja-JP / subtitle: ja-JP
[debug] Using resolution 'best'
[debug] Logging in
[err] zh-CN is not a supported locale, using en-US as fallback
[debug] Logged in
[debug] Parsing url 1
[err] interface conversion: interface {} is nil, not []interface {}: goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x65
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.Execute.func1()
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/root.go:65 +0x4a
panic({0x1384a60, 0xc000243890})
        /usr/lib/go/src/runtime/panic.go:838 +0x207
github.com/ByteDream/crunchyroll-go/v2.(*Series).Seasons(0xc00035a3c0)
        /home/bytedream/backup/crunchyroll-go/video.go:217 +0x6c5
github.com/ByteDream/crunchyroll-go/v2.(*Crunchyroll).ExtractEpisodesFromUrl(0xc000016140?, {0xc000016140?, 0x1481d44?}, {0xc00007d8f8, 0x2, 0x0?})
        /home/bytedream/backup/crunchyroll-go/url.go:18 +0xb2
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.extractEpisodes({0xc000016140, 0x43}, {0xc00007d8f8, 0x2, 0x2})
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/utils.go:261 +0x1cb
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.downloadExtractEpisodes({0xc000016140?, 0x13db595?})
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/download.go:272 +0x91
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.download({0xc00013c240?, 0x1, 0x0?})
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/download.go:132 +0xfd
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.glob..func4(0x16a4f80?, {0xc00013c240, 0x1, 0xc})
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/download.go:74 +0x3c
github.com/spf13/cobra.(*Command).execute(0x16a4f80, {0xc00013c180, 0xc, 0xc})
        /home/bytedream/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x16a4a80)
        /home/bytedream/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        /home/bytedream/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.Execute()
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/cmd/root.go:72 +0x54
main.main()
        /home/bytedream/backup/crunchyroll-go/cmd/crunchyroll-go/main.go:8 +0x17

I hope to get help and thanks for your project~ In addition, is it possible to add a parameter to download the latest episodes?

Beta Support

Hi, really love your work!!!!
the best CR downloader i had to use!

I want to suggest some thing:

  1. Beta Support
  2. Funimation Support

Thank you for your Hard Work!

With some episodes i have problems with the download

With some episodes i have problems with the download, i get the error:

=> Logged in
=> Failed to parse url 1
An error occurred: failed to get episodes: could not find any matching episode

Download in the debug mode:

[debug] Executing `archive` command with 1 arg(s)
[debug] Validating arguments
[debug] FFmpeg detected
[debug] Using following audio locales: de-DE, ja-JP
[debug] Using auto merge behavior
[debug] Using resolution 'best'
[debug] Logging in
[debug] Logged in with username ...
[debug] Logged in
[debug] Parsing url 1
[debug] Failed to parse url 1

An error occurred: failed to get episodes: could not find any matching episode

this error come at the folow episodes:
http://www.crunchyroll.com/de/skeleton-knight-in-another-world/episode-2-a-first-job-a-girls-wish-and-an-approaching-shadow-842578
http://www.crunchyroll.com/de/the-dawn-of-the-witch/episode-2-dont-call-me-a-traitor-842670

Subtitle size/styling does not match Crunchyroll.

Subtitles are too small, lack shadow, and have a thinner outline.

Screenshots
Screenshot_20221031-030943.png
Screenshot_20221031-031851.png

The second image is Crunchyroll.

Client (please complete the following information):

  • OS: Windows
  • Version Latest

Additional context
This needs fixing asap please, also an option to change the font would be awesome. I personally really like Roboto.

Downloading some episodes cannot be played

When I download episode 6, it can't be played after the download is complete. But I downloaded episode 5 again and it played fine.

./crunchy archive -l ja-JP https://beta.crunchyroll.com/series/G5PHNM403/the-dawn-of-the-witch[S01E06] -v -g 5

Download process:

[debug] Entering season 1, episode 6 with 0 additional formats
[debug] Set up signal catcher
[info] Downloading episode `Knowledge of Ignorance` to `Knowledge of Ignorance.mkv` (merging audio for additional formats)
[info]  Episode: S01E06
[info]  Audio: ja-JP
[info]  Subtitle: 
[info]  Resolution: 1920x1080px
[info]  FPS: 23.97


[debug] Merging segments
[debug] Downloaded 'ja-JP' video
[debug] Downloaded 'ar-SA' subtitles
[debug] Downloaded 'en-US' subtitles
[debug] Downloaded 'fr-FR' subtitles
[debug] Downloaded 'de-DE' subtitles
[debug] Downloaded 'it-IT' subtitles
[debug] Downloaded 'pt-BR' subtitles
[debug] Downloaded 'ru-RU' subtitles
[debug] Downloaded 'es-419' subtitles
[debug] Downloaded 'es-ES' subtitles
[debug] FFmpeg merge command: ffmpeg -y -i "/tmp/Knowledge of Ignorance.mkv_ja-JP_video_4228809968.ts" -i "/tmp/Knowledge of Ignorance.mkv_ar-SA_subtitle_2246873797.ass" -i "/tmp/Knowledge of Ignorance.mkv_en-US_subtitle_96231048.ass" -i "/tmp/Knowledge of Ignorance.mkv_fr-FR_subtitle_3549463093.ass" -i "/tmp/Knowledge of Ignorance.mkv_de-DE_subtitle_3645851011.ass" -i "/tmp/Knowledge of Ignorance.mkv_it-IT_subtitle_2836418908.ass" -i "/tmp/Knowledge of Ignorance.mkv_pt-BR_subtitle_2467827141.ass" -i "/tmp/Knowledge of Ignorance.mkv_ru-RU_subtitle_3717983405.ass" -i "/tmp/Knowledge of Ignorance.mkv_es-419_subtitle_1758587536.ass" -i "/tmp/Knowledge of Ignorance.mkv_es-ES_subtitle_3931097704.ass" -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 -map 6 -map 7 -map 8 -map 9 -metadata:s:v:0 language="ja-JP" -metadata:s:v:0 title="Japanese" -metadata:s:a:0 language="ja-JP" -metadata:s:a:0 title="Japanese" -metadata:s:s:0 language="ar-SA" -metadata:s:s:0 title="Arabic" -metadata:s:s:1 language="en-US" -metadata:s:s:1 title="English (US)" -metadata:s:s:2 language="fr-FR" -metadata:s:s:2 title="French" -metadata:s:s:3 language="de-DE" -metadata:s:s:3 title="German" -metadata:s:s:4 language="it-IT" -metadata:s:s:4 title="Italian" -metadata:s:s:5 language="pt-BR" -metadata:s:s:5 title="Portuguese (Brazil)" -metadata:s:s:6 language="ru-RU" -metadata:s:s:6 title="Russian" -metadata:s:s:7 language="es-419" -metadata:s:s:7 title="Spanish (Latin America)" -metadata:s:s:8 language="es-ES" -metadata:s:s:8 title="Spanish (Spain)" -disposition:s:0 0 -c copy -f matroska /tmp/3676206230
[debug] Download finished
[debug] Stopped signal catcher

And the file that cannot be played normally contains a German subtitle with an abnormal time,When I remove this subtitle file and remix the stream, the video can be played normally.

ID                                       : 6
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Duration                                 : 3 时 59 分
Compression mode                         : 无损
Title                                    : German
Language                                 : German (DE)
Default                                  : 否
Forced                                   : 否

This is the 5th episode, it can be played normally after it is downloaded, but the 6th episode cannot.

./crunchy archive -l ja-JP https://beta.crunchyroll.com/series/G5PHNM403/the-dawn-of-the-witch[S01E05] -v -g 5

[debug] Entering season 1, episode 5 with 0 additional formats
[debug] Set up signal catcher
[info] Downloading episode `I Decide Who's Worthy` to `I Decide Who's Worthy.mkv` (merging audio for additional formats)
[info]  Episode: S01E05
[info]  Audio: ja-JP
[info]  Subtitle: 
[info]  Resolution: 1920x1080px
[info]  FPS: 23.97



[debug] Merging segments
[debug] Downloaded 'ja-JP' video
[debug] Downloaded 'ar-SA' subtitles
[debug] Downloaded 'en-US' subtitles
[debug] Downloaded 'fr-FR' subtitles
[debug] Downloaded 'de-DE' subtitles
[debug] Downloaded 'it-IT' subtitles
[debug] Downloaded 'pt-BR' subtitles
[debug] Downloaded 'ru-RU' subtitles
[debug] Downloaded 'es-419' subtitles
[debug] Downloaded 'es-ES' subtitles
[debug] FFmpeg merge command: ffmpeg -y -i "/tmp/I Decide Who's Worthy.mkv_ja-JP_video_3629755215.ts" -i "/tmp/I Decide Who's Worthy.mkv_ar-SA_subtitle_594230327.ass" -i "/tmp/I Decide Who's Worthy.mkv_en-US_subtitle_775737117.ass" -i "/tmp/I Decide Who's Worthy.mkv_fr-FR_subtitle_2237748135.ass" -i "/tmp/I Decide Who's Worthy.mkv_de-DE_subtitle_2171227641.ass" -i "/tmp/I Decide Who's Worthy.mkv_it-IT_subtitle_1034428868.ass" -i "/tmp/I Decide Who's Worthy.mkv_pt-BR_subtitle_1369825909.ass" -i "/tmp/I Decide Who's Worthy.mkv_ru-RU_subtitle_2177413224.ass" -i "/tmp/I Decide Who's Worthy.mkv_es-419_subtitle_1392795710.ass" -i "/tmp/I Decide Who's Worthy.mkv_es-ES_subtitle_3336197141.ass" -map 0 -map 1 -map 2 -map 3 -map 4 -map 5 -map 6 -map 7 -map 8 -map 9 -metadata:s:v:0 language="ja-JP" -metadata:s:v:0 title="Japanese" -metadata:s:a:0 language="ja-JP" -metadata:s:a:0 title="Japanese" -metadata:s:s:0 language="ar-SA" -metadata:s:s:0 title="Arabic" -metadata:s:s:1 language="en-US" -metadata:s:s:1 title="English (US)" -metadata:s:s:2 language="fr-FR" -metadata:s:s:2 title="French" -metadata:s:s:3 language="de-DE" -metadata:s:s:3 title="German" -metadata:s:s:4 language="it-IT" -metadata:s:s:4 title="Italian" -metadata:s:s:5 language="pt-BR" -metadata:s:s:5 title="Portuguese (Brazil)" -metadata:s:s:6 language="ru-RU" -metadata:s:s:6 title="Russian" -metadata:s:s:7 language="es-419" -metadata:s:s:7 title="Spanish (Latin America)" -metadata:s:s:8 language="es-ES" -metadata:s:s:8 title="Spanish (Spain)" -disposition:s:0 0 -c copy -f matroska /tmp/458289425
[debug] Download finished
[debug] Stopped signal catcher

MKV Support

Please add MKV support.
Ideally still with the possibility to save different "audio" and "subtitle".

Sorting screwed up when archiving

Describe the bug
When running archive with a series which has multiple seasons, the sorting (and resulting download order) is messed up.

To Reproduce
Steps / command to reproduce the behavior:

$ crunchy archive -l ja-JP https://www.crunchyroll.com/series/G6NQ5DWZ6/my-hero-academia

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Client (please complete the following information):

  • OS: Arch Linux
  • Version: v2.3.5

Additional context
Does not occur with download.

[Bug] -l all - After downloading the Japanese Dub, it's merging without using -m auto

app.exe archive --resolution best -l all --directory "Season {season_number} ({audio})" --output "{series_name} [S{season_number}E{episode_number}] - {title} - [{resolution}].mkv" %stream%

I've used this command,
And when it's done downloading the Japanese dub, it's continue to German dub, and the German gets merge
with all of the videos available for the series and all of the audios, without using -m audio/video option.

Incorrectly encapsulating multiple video streams as well as audio streams

When I download https://beta.crunchyroll.com/watch/GJWU2XQDD/sound-hashira-tengen-uzui, it has two S2 one is "Demon Slayer: Mugen Train Arc" and the other is "Demon Slayer: Entertainment District Arc" "
When I set the parameter to S2E1 it downloads the first episode of "Demon Slayer: Mugen Train Arc" and the first episode of "Demon Slayer: Entertainment District Arc" and packages them together, but it's actually two different seasons.

Same with this, when I download S1E7 of https://beta.crunchyroll.com/series/GNVHKN7M4/shikimoris-not-just-a-cutie, it turns the previous episode "S1 E-SP - Special" Encapsulating them together will result in a mkv file containing two video streams and audio streams, which is the same as the above

New name for CLI

Beginning with version v3, this repo splits up in 2 seperate packages. One containing only the go library and the second the cli part.
This allows me to add more dependencies to the cli without bloating up the library and structure the code more the way I like it. There are probably some people who only use the library and don't need the cli part.

The library should keep the name crunchyroll-go to not break dependencies and because it's the most descriptive for a library, so the cli part needs a new name.

Post your naming suggestions as a reply in this issue if you have any good idea.
React to a suggestion 👍 or 👎 if you like or dislike it.

Merging segments - Unexpected error: runtime error: slice bounds out of range [7:6]

Hi, just started trying to archive GATE and came across this error. The command I ran was .\crunchy-v2.0.0_windows.exe archive -l all -o "S{episode_number}E{episode_number} - {title}.mkv" https://www.crunchyroll.com/gate which produced the following log output:

=> Logged in
| en-US has no matching episodes
| es-419 has no matching episodes
| es-ES has no matching episodes
| fr-FR has no matching episodes
| pt-PT has no matching episodes
| pt-BR has no matching episodes
| it-IT has no matching episodes
| de-DE has no matching episodes
| ru-RU has no matching episodes
| ar-SA has no matching episodes
-> Parsed url 1
=> GATE Season 1
=>      1. The Self-Defense Force Goes to Another World » 1920x1080px, 23.97 FPS (S01E01)
=>      2. The Two Armies » 1920x1080px, 23.97 FPS (S01E02)
=>      3. Fire Dragon » 1920x1080px, 23.97 FPS (S01E03)
=>      4. To Unknown Lands » 1920x1080px, 23.97 FPS (S01E04)
=>      5. The Battle of Italica » 1920x1080px, 23.97 FPS (S01E05)
=>      6. Ride of the Valkyries » 1920x1080px, 23.97 FPS (S01E06)
=>      7. The Princess's Decision » 1920x1080px, 23.97 FPS (S01E07)
=>      8. Japan, Beyond the Gate » 1920x1080px, 23.97 FPS (S01E08)
=>      9. The Hakone Mountain Night Battle » 1920x1080px, 23.97 FPS (S01E09)
=>      10. Despair and Hope » 1920x1080px, 23.97 FPS (S01E10)
=>      11. Visitor » 1920x1080px, 23.97 FPS (S01E11)
=>      12. What Would Itami Do? » 1920x1080px, 23.97 FPS (S01E12)
=>      13. The Banquet Begins » 1920x1080px, 23.97 FPS (S01E13)
=>      14. The Imperial Capital Quake » 1920x1080px, 23.97 FPS (S01E14)
=>      15. Tuka Luna Marceau » 1920x1080px, 23.97 FPS (S01E15)
=>      16. The Fire Dragon, Once More » 1920x1080px, 23.97 FPS (S01E16)
=>      17. Decisive Battle » 1920x1080px, 23.97 FPS (S01E17)
=>      18. The Magic City of Rondel » 1920x1080px, 23.97 FPS (S01E18)
=>      19. Dangerous Sisters » 1920x1080px, 23.97 FPS (S01E19)
=>      20. Lover » 1920x1080px, 23.97 FPS (S01E20)
=>      21. Deadline » 1920x1080px, 23.97 FPS (S01E21)
=>      22. The Empress in Slave's Clothing » 1920x1080px, 23.97 FPS (S01E22)
=>      23. Paradrop » 1920x1080px, 23.97 FPS (S01E23)
=>      24. Thus They Fought » 1920x1080px, 23.97 FPS (S01E24)

=> Downloading episode `The Self-Defense Force Goes to Another World` to `S01E01 - The Self-Defense Force Goes to Another World (1).mkv` (merging audio for additional formats)
=>      Episode: S01E01
=>      Audio: ja-JP
=>      Subtitle:
=>      Resolution: 1920x1080px
=>      FPS: 23.97
=> Merging segments [=====================>]  99%      711/712=> Unexpected error: runtime error: slice bounds out of range [7:6]

Any idea why? I assume because it finishes downloading before it has all the expected segments, but why it does that is a bit puzzling.

OS: Windows 10 x64
Location: Germany

Cannot download when the system language is zh-CN

Describe the bug
I have specified ja-JP to download but the local language will still be downloaded ,Then the above problem occurs.

To Reproduce

$ crunchy archive -l ja-JP https://www.crunchyroll.com/series/G9VHN91ZP/legend-of-mana--the-teardrop-crystal-[S1E1] -debug
➞ Failed to parse url 1
➞ An error occurred: failed to get episodes: error for endpoint https://beta-api.crunchyroll.com/cms/v2/FR/M3/crunchyroll/movies?movie_listing_id=G9VHN91ZP&locale=zh-CN&Signature=G9Z~3eRxH..... (400): Unsupported locale zh-CN

Expected behavior
I hope it can be downloaded in the specified language.

Client (please complete the following information):

  • OS: Debian 11
  • Version v2.3.5

[ERROR] interface conversion: interface {} is nil, not map[string]interface {}

  • Version: git (source)
  • Built with: go, as in:
$ git clone https://github.com/ByteDream/crunchyroll-go
$ cd crunchyroll-go/cmd/crunchyroll-go/
$ go build -o crunchy
$ sudo cp crunchy /usr/local/bin
  • OS: Ubuntu 20.04

  • Go: go1.17.6 linux/arm64

  • Platform: ARM64

  • What happens:

When running `crunchy login user passwd the binary throws the error:

=> interface conversion: interface {} is nil, not map[string]interface {}

Archive with --merge on audio is merging video

Recently I tried to download a series testing the new version 2.3.0, I can confirm that now is download Spanish dub.
But taking a look to file size is a monster, 10Gb per cap, thats totally impossible.
Taking a look to mkvToolNix I found the script is also merging the videos even with the --merge on audio

Merge on audio:
image

Merge on video:
image

Cleaning this "und" I got a totally fine 1.4Gb per cap

Seems like the ffmpeg command used is still merging the video but without the name of the language and it should not merge that video at all, at least when --merge is set on audio

Can't compile latest master

Actual Behavior

# go version
go version go1.16.9 linux/amd64

# make
cd cmd/crunchyroll-go && go build -o crunchy
go: downloading github.com/grafov/m3u8 v0.11.1
go: downloading github.com/spf13/cobra v1.2.1
go: downloading github.com/spf13/pflag v1.0.5
# github.com/ByteDream/crunchyroll-go/cmd/crunchyroll-go/cmd
cmd/download.go:472:45: cannot use func literal (type func(*m3u8.MediaSegment, int, int, *os.File, error) error) as type func(*m3u8.MediaSegment, int, int, *os.File) error in argument to format.DownloadSegments
make: *** [Makefile:9: build] Error 2

Steps to Reproduce the Problem

  1. git clone https://github.com/ByteDream/crunchyroll-go
  2. cd crunchyroll-go
  3. make

Specifications

  • Version: latest commit in master
  • Platform: Ubuntu 20.04 amd64 with latest updates applied. Go version installed from golang.org

API error

There is some kind of api error or unexpected change. Now the crunchyroll api always return zero results when searching for any kind of series or movie.

Session ID login fails

I found this experimenting with the API from a REST client, but I checked using crunchy login --session-id to ensure it wasn't my own error: It seems that https://api.crunchyroll.com/start_session.0.json is now returning Set-Cookie etp_rt=deleted. This causes the POST to https://beta-api.crunchyroll.com/auth/v1/token attempting to use that etp_rt cookie to fail so login fails.

Download multiple episods

Heyy, I have a question. How to download multiple episodes (like 1,2 and 3 at same time), and how to download all episodes of a season ?

Not working since website (ui) update

As of 19.10.2022, Crunchyroll rolled out a new design (and a lot of new logic) for their website at www.crunchyroll.com which was only available at beta.crunchyroll.com before. crunchy-cli utilized the beta subdomain to perform all its request, but with the domain switch, Crunchyroll added a bot check for every request.
Sadly, this bot check works quiet well and detects that this program is not a user in a web browser and it cannot be bypassed (or only with a high amount of work and unreliable results). Without this check everything would work as before.

I don't know if we will find a good way to keep this tool usable, but we try our best. Stay patient and visit this issue from time to time to see if something has changed or head over to our Discord.

Using archive ignores -d pathing

Using crunchy-v2.0.1_windows.exe.
Path just defaults to the default download location and ignores all -d flags.
While using all the same flags, but changing to download instead of archive, -d works as intended.

Slashes in filename issue

When an episode output name has a / in it (will probably the same for \ in windows), the output file is interpreted as a an sub-directory with sub-files

image

Naming issues

Whenever I download something neither season no nor episode no shows. Any way to fix this?

error message when using all commands

Hi, I just tried installing this on my Ubuntu 21.04 VPS, and regardless of the command given, it always returns this message:

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.systemLocale(0x0)
        /home/admin/crunchyroll-go/cmd/crunchyroll-go/cmd/utils.go:37 +0x35a
github.com/ByteDream/crunchyroll-go/v2/cmd/crunchyroll-go/cmd.init.0()
        /home/admin/crunchyroll-go/cmd/crunchyroll-go/cmd/archive.go:123 +0x45


Please Help

Why is there no Arabic translation download?
Can you help with something?
File name should be "A Centaur's Life S01E01"
And not the title of the episode because it is too big and I want to withdraw large amounts of anime
Is it possible to add that the file is in mkv format and not ts
I would be very grateful to help with that

[Bug] (-l all -m audio) adding the English Dub when it isn't matching

-m audio - adds only English Dubs even when it isn't match.
Others are ignored, only English always added.

I've tried using this command:
app.exe archive --resolution best -l all -m audio --directory "Season {season_number}" --output "{series_name} [S{season_number}E{episode_number}] - {title} - [{resolution}][{audio}][{subtitle}].mkv" %stream%

and tried on Classroom of the Elite.
https://beta.crunchyroll.com/series/GRVN8MNQY

login --permanent , dont exist

Caching session id in separate file if only logged in permanently (with crunchy login --permanent ...) to reduce the amount of re-logging in when running multiple times.

so it brings me the message unknown command flag or so ^^"

[Request] Improve the Archive option

Hi,
I'm using the Archive option and it works perfectly,
But it isn't sorted well.

Can you make the Archive split dubs into different folders?

like:

EnglishDub/Ep1,Ep2,etc...
JapaneseDub/Ep1,Ep2,etc...
Spanish/Ep1,Ep2,etc...
etc/Ep1,Ep2,etc...

And i want the files be calling like:
One Piece Season 1 Episode 3
One Piece Season 3 Episode 23
etc...

How can i do that? how can i get the value of the episode number and use it as output?
Thanks :)

Corrupted Windows Binary for Release 2.3.0

Describe the bug
When attempting to run the binary for release 2.3.0, I get the error message that "The file or directory is corrupted and unreadable".

To Reproduce
Steps / command to reproduce the behavior:

  • Download Windows binary from Github release for 2.3.0.
  • Attempt to run (in the console or by double clicking, they both produce the same result).

Client (please complete the following information):

  • OS: Windows 10 x64
  • Version 2.3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.