GithubHelp home page GithubHelp logo

pdmahon1 / crunchy-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crunchy-labs/crunchy-cli

1.0 0.0 0.0 809 KB

๐Ÿ‘‡ A pure Rust written Crunchyroll cli client and downloader

License: GNU General Public License v3.0

Rust 98.48% Nix 1.52%

crunchy-cli's Introduction

crunchy-cli

A pure Rust CLI for Crunchyroll.

Code size Download Badge License Release Discord CI

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 crunchyroll.com.

This README belongs to the master branch which is currently under heavy development towards the next major version (3.0). It is mostly stable but some issues may still occur. If you do not want to use an under-development / pre-release version, head over to the golang branch which contains the EOL but last stable version (and documentation for it).

โœจ 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.

๐Ÿ’พ Get the executable

๐Ÿ“ฅ Download the latest binaries

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

โ„๏ธ The nix way

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
$ cargo build --release
$ cargo install --force --path .

๐Ÿ–ฅ๏ธ Usage

All shown commands are examples ๐Ÿง‘๐Ÿผโ€๐Ÿณ

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 (username:password) or by using a refresh token.

  • Credentials
    • $ crunchy --credentials "user:password"
  • Refresh Token
    • To obtain a refresh token, you have to log in at crunchyroll.com and extract the etp_rt cookie. The easiest way to get it is via a browser extension which lets you export your cookies, like Cookie-Editor (Firefox / Chrome). When installed, look for the etp_rt entry and extract its value.
    • $ crunchy --etp-rt "4ebf1690-53a4-491a-a2ac-488309120f5d"
  • Stay Anonymous
    • Skip the login check:
    • $ crunchy --anonymous

Login

crunchy-cli can store your session, so you don't have to authenticate every time you execute a command.

Note that the login keyword has to be used last.

$ crunchy --etp-rt "4ebf1690-53a4-491a-a2ac-488309120f5d" login

With the session stored, you do not need to use --credentials / --etp-rt anymore. This does not work with --anonymous.

Download

Supported urls

  • Single episode
    $ crunchy download https://www.crunchyroll.com/watch/GRDQPM1ZY/alone-and-lonesome
  • Series
    $ crunchy 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 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. The subtitles will be burned into the video track (cf. hardsub) and thus can not be turned off.

    $ crunchy 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. If you want to use any other file format than .ts you need ffmpeg.

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

    Default is {title}.ts.

  • Resolution

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

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

    Default is best.

Archive

Supported urls

  • Series

    Only series urls are supported, because episode urls are locked to a single audio language.

    $ crunchy 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 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 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 uses the .mkv container format, because of it's ability to store multiple audio, video and subtitle tracks at once.

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

    Default is {title}.mkv.

  • Resolution

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

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

    Default is best.

  • Merge behavior

    Due to censorship, 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. Subtitles will always match the primary audio and video.

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

    Default is auto.

  • Default subtitle

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

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

    Default is none.

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 ONLY meant for private use. You need a subscription to ๐Ÿ’ณ Crunchyroll Premium ๐Ÿ’ณ to download premium content.

You are entirely responsible for what happens to files you downloaded through crunchy-cli.

โš– License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for more details.

crunchy-cli's People

Contributors

bytedream avatar ichbinleoon avatar hekmon avatar adracea avatar hannesbraun avatar lordbex avatar dependabot[bot] avatar hitorilabs avatar

Stargazers

Josep Ribes avatar

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.