Coder Social home page Coder Social logo

crunchy-labs / crunchy-cli Goto Github PK

View Code? Open in Web Editor NEW
586.0 10.0 58.0 1.23 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 rustlang hacktoberfest

crunchy-cli's Issues

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

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 ^^"

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!

Naming issues

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

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.

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

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.

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.

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.

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)

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

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

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.

[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 :)

[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.

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

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

[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...

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

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?

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

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

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.

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


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?

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.

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 ?

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

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

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

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.

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

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

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

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! :)

[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 {}

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.

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.

[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

MKV Support

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

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).

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.