Coder Social home page Coder Social logo

sorrowful-crowz / crunchyroll-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crunchy-labs/crunchy-cli

0.0 0.0 0.0 443 KB

๐Ÿ‘‡ A crunchyroll api integration in go with included cli

License: GNU Lesser General Public License v3.0

Makefile 1.04% Go 90.74% Roff 8.22%

crunchyroll-go's Introduction

Version 2 is out ๐Ÿฅณ, see all the changes.

crunchyroll-go

A Go library & cli for the undocumented crunchyroll api. To use it, you need a crunchyroll premium account to for full (api) access.

Code size Download Badge License Go version Release Discord

CLI ๐Ÿ–ฅ๏ธ โ€ข Library ๐Ÿ“š โ€ข Disclaimer โ˜๏ธ โ€ข License โš–

๐Ÿ–ฅ๏ธ CLI

โœจ Features

  • Download single videos and entire series from crunchyroll.
  • Archive episode or seasons in an .mkv file with multiple subtitles and audios and compress them to gzip or zip files.
  • Specify a range which episodes to download from an anime.

๐Ÿ’พ Get the executable

  • ๐Ÿ“ฅ Download the latest binaries here or get it from below:
  • If you use Arch btw. or any other Linux distro which is based on Arch Linux, you can download the package via the AUR:
    $ yay -S crunchyroll-go
    
  • ๐Ÿ›  Build it yourself
    • use make (requires go to be installed):
    $ git clone https://github.com/ByteDream/crunchyroll-go
    $ cd crunchyroll-go
    $ make && sudo make install
    
    • use go:
    $ git clone https://github.com/ByteDream/crunchyroll-go
    $ cd crunchyroll-go/cmd/crunchyroll-go
    $ go build -o crunchy
    

๐Ÿ“ Examples

Before reading: Because of the huge functionality not all cases can be covered in the README. Make sure to check the wiki, further usages and options are described there.

Login

Before you can do something, you have to login first.

This can be performed via crunchyroll account email and password.

$ crunchy login [email protected] password

or via session id

$ crunchy login --session-id 8e9gs135defhga790dvrf2i0eris8gts

Download

By default, the cli tries to download the episode with your system language as audio. If no streams with your system language are available, the video will be downloaded with japanese audio and hardsubbed subtitles in your system language. If your system language is not supported, an error message will be displayed and en-US (american english) will be chosen as language.

$ crunchy download https://www.crunchyroll.com/darling-in-the-franxx/episode-1-alone-and-lonesome-759575

With -r best the video(s) will have the best available resolution (mostly 1920x1080 / Full HD).

$ crunchy download -r best https://www.crunchyroll.com/darling-in-the-franxx/episode-1-alone-and-lonesome-759575

The file is by default saved as a .ts (mpeg transport stream) file. .ts files may can't be played or are looking very weird (it depends on the video player you are using). With the -o flag, you can change the name (and file ending) of the output file. So if you want to save it as, for example, mp4 file, just name it whatever.mp4. You need ffmpeg to store the video in other file formats.

$ crunchy download -o "daaaaaaaaaaaaaaaarling.ts" https://www.crunchyroll.com/darling-in-the-franxx/episode-1-alone-and-lonesome-759575

With the --audio flag you can specify which audio the video should have and with --subtitle which subtitle it should have. Type crunchy help download to see all available locales.

$ crunchy download --audio ja-JP --subtitle de-DE https://www.crunchyroll.com/darling-in-the-franxx
Flags

The following flags can be (optional) passed to modify the download process.

Short Extended Description
-a --audio Forces audio of the video(s).
-s --subtitle Forces subtitle of the video(s).
-d --directory Directory to download the video(s) to.
-o --output Name of the output file.
-r --resolution The resolution of the video(s). best for best resolution, worst for worst.
-g --goroutines Sets how many parallel segment downloads should be used.

Archive

Archive works just like download. It downloads the given videos as .mkv files and stores all (soft) subtitles in it. Default audio locales are japanese and your system language (if available) but you can set more or less with the --language flag.

Archive a file

$ crunchy archive https://www.crunchyroll.com/darling-in-the-franxx/darling-in-the-franxx/episode-1-alone-and-lonesome-759575

Downloads the first two episode of Darling in the FranXX and stores it compressed in a file.

$ crunchy archive -c "ditf.tar.gz" https://www.crunchyroll.com/darling-in-the-franxx/darling-in-the-franxx
Flags

The following flags can be (optional) passed to modify the archive process.

Short Extended Description
-l --language Audio locale which should be downloaded. Can be used multiple times.
-d --directory Directory to download the video(s) to.
-o --output Name of the output file.
-m --merge Sets the behavior of the stream merging. Valid behaviors are 'auto', 'audio', 'video'. See the wiki for more information.
-c --compress If is set, all output will be compresses into an archive. This flag sets the name of the compressed output file and the file ending specifies the compression algorithm (gzip, tar, zip are supported).
-r --resolution The resolution of the video(s). best for best resolution, worst for worst.
-g --goroutines Sets how many parallel segment downloads should be used.

Help

  • General help

    $ crunchy help
  • Login help

    $ crunchy help login
  • Download help

    $ crunchy help download
  • Archive help

    $ crunchy help archive

Global flags

These flags you can use across every sub-command

Flag Description
-q Disables all output.
-v Shows additional debug output.
-p Use a proxy to hide your ip / redirect your traffic.

๐Ÿ“š Library

Download the library via go get

$ go get github.com/ByteDream/crunchyroll-go

The documentation is available on pkg.go.dev.

Examples how to use the library and some features of it are described in the wiki.

โ˜๏ธ Disclaimer

This tool is ONLY meant to be used for private purposes. To use this tool you need crunchyroll premium anyway, so there is no reason why rip and share the episodes.

The responsibility for what happens to the downloaded videos lies entirely with the user who downloaded them.

โš– License

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

crunchyroll-go's People

Contributors

bytedream avatar ichbinleoon 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.