crunchy-labs / crunchy-cli

πŸ‘‡ Command-line downloader for Crunchyroll
MIT License
606 stars 63 forks source link

No matching stream found also if available #81

Closed aniplayIt closed 1 year ago

aniplayIt commented 1 year ago

Describe the bug I'm trying to download an episode with the command below. The episode is

I expect to get errors until the episode is not available obviously, but once they publish it I continue to recieve the same error: Process detail:

After some hours without a specific reason the download works.

To Reproduce Steps / command to reproduce the behavior:

$ crunchy download -a ja-JP -s it-IT -o one_piece_1044.mp4 -r 1080p https://www.crunchyroll.com/it/series/GRMG8ZQZR/one-piece[S13E1044]

I also tried to append a timestamp to get rid of some weird cache problem:
$ crunchy download -a ja-JP -s it-IT -o one_piece_1044.mp4 -r 1080p https://www.crunchyroll.com/it/series/GRMG8ZQZR/one-piece?t=1670832000279[S13E1044]

Expected behavior Download the episode

Screenshots If applicable, add screenshots to help explain your problem.

Client (please complete the following information):

Additional context IMPORTANT If I try to start the download from another pc with a clean version of crunchy-cli it works

bytedream commented 1 year ago

Was this the first incident or has this already occurred multiple times? This may (hopefully) be a one-time bug if this only occurred once.

aniplayIt commented 1 year ago

Was this the first incident or has this already occurred multiple times? This may (hopefully) be a one-time bug if this only occurred once.

It already happend multiple times. For such episodes, they become available after some days while they were already present. For example I still cannot download the mentioned One Piece episode from that pc but I can from another one. It happened last week with Boruto too.

aniplayIt commented 1 year ago

Another strange behaviour I noticed is that an episode is already available and watchable on crunchyroll. In this case Dr. Stone Ep 1 Italian Dubbed, but the downloader keeps telling me Stone World has no it-IT audio, using ja-JP as fallback

bytedream commented 1 year ago

Was this the first incident or has this already occurred multiple times? This may (hopefully) be a one-time bug if this only occurred once.

It already happend multiple times. For such episodes, they become available after some days while they were already present. For example I still cannot download the mentioned One Piece episode from that pc but I can from another one. It happened last week with Boruto too.

This is indeed very strange. This sounds like a caching problem but the cli doesn't cache anything nor should your OS / computer do this. Maybe re-logging in solves the problem.

bytedream commented 1 year ago

Another strange behaviour I noticed is that an episode is already available and watchable on crunchyroll. In this case Dr. Stone Ep 1 Italian Dubbed, but the downloader keeps telling me Stone World has no it-IT audio, using ja-JP as fallback

With crunchy download -a it-IT https://www.crunchyroll.com/series/GYEXQKJG6/dr-stone[S1E1] the download works for me.

aniplayIt commented 1 year ago

Another strange behaviour I noticed is that an episode is already available and watchable on crunchyroll. In this case Dr. Stone Ep 1 Italian Dubbed, but the downloader keeps telling me Stone World has no it-IT audio, using ja-JP as fallback

With crunchy download -a it-IT https://www.crunchyroll.com/series/GYEXQKJG6/dr-stone[S1E1] the download works for me.

And it just did for me, but the episode is available since 2 hours ago

aniplayIt commented 1 year ago

Was this the first incident or has this already occurred multiple times? This may (hopefully) be a one-time bug if this only occurred once.

It already happend multiple times. For such episodes, they become available after some days while they were already present. For example I still cannot download the mentioned One Piece episode from that pc but I can from another one. It happened last week with Boruto too.

This is indeed very strange. This sounds like a caching problem but the cli doesn't cache anything nor should your OS / computer do this. Maybe re-logging in solves the problem.

Already tried to restart and relogin. Still cannot download One Piece

aniplayIt commented 1 year ago

Do you have any suggestion on how to fix this? After 3 days I still receive this message: crunchy download -a ja-JP -s it-IT -o episode.mp4 -r 1080p https://www.crunchyroll.com/it/series/GRMG8ZQZR/one-piece\[S13E1044] ➞ Failed to parse url 1 ➞ An error occurred: error while receiving format for Clutch! Robin, un demone in forma umana!: no matching stream found

aniplayIt commented 1 year ago

I'm here to keep you updated. In this case: crunchy download -a ja-JP -s it-IT -o ep.mp4 -r 720p [https://www.crunchyroll.com/it/series/GZJH3DJ8E/the-daily-life-of-the-immortal-king[S3E12] I'm not able to download it anywhere also even the episode is available since yesterday. Can you please check if it's the same on your side?

bytedream commented 1 year ago

Can confirm this. Here we have a complete different problem. The anime is not japense but chinese. So the right command would be crunchy download -a zh-CN -s it-IT -o ep.mp4 -r 720p https://www.crunchyroll.com/it/series/GZJH3DJ8E/the-daily-life-of-the-immortal-king[S3E12] (zh-CN = chinese). Then the cli finds the correct episode. Buut... even though the audio is chinese (at least it sounds like that) Crunchyroll marks it as japanese which causes the cli to not find the correct stream.

aniplayIt commented 1 year ago

Mm ok good to know. However I'm still trying to download one piece πŸ˜…

bytedream commented 1 year ago

I tried to reproduce the behavior that it downloads from one PC but not from another but hadn't any success yet :/

aniplayIt commented 1 year ago

Something is missing here. Today I have tried for 2 hours to download another episode, no episodes are matching the given filter but it's not true. I have no clue on why it says that..

aniplayIt commented 1 year ago

@ByteDream I was wondering, I don't know the actual architecture of crunchyroll but could it be that the downloader is asking for the episode to a node where data is still not replicated?

bytedream commented 1 year ago

This might be the case, I hadn't the time to test this yet. Crunchyroll provides two different stream formats (HLS and DASH). The crunchyroll website uses the DASH stream and the cli HLS (as this format is simpler and easier to implement). It might be that they generate the HLS streams later than the DASH equivalent. I'm planning to adopt DASH streams in the cli soon, so if that's the cause of the issue it's fixed with this adoption. If not, I have to search somewhere else for the problem.

aniplayIt commented 1 year ago

I was trying to test it also with a proxy but I didn't figure out how to pass the proxy arg. I get a ➞ Unexpected error: interface conversion: error is url.Error, not crunchyroll.RequestError. Can you tell me please how to pass it?

bytedream commented 1 year ago

What was the (complete) command you were using?

aniplayIt commented 1 year ago

It is not documented so I just tried with crunchy download -p ip.ip.ip.ip -a ja-JP -s it-IT -o episode.mp4 -r best https://www.crunchyroll.com/it/series/GRMG8ZQZR/one-piece[S13E1044]

bytedream commented 1 year ago

I think you have to specify the protocol and port too, so http://ip.ip.ip.ip:port or socks5://ip.ip.ip.ip:port. TBH I never really tested this xD. The only time I tested this I used unstable public proxies which resolved connection errors.

aniplayIt commented 1 year ago

I tested the v3 with that infamous one piece episode. Now I get a different error: Episode 1044 (Clutch! A Demon Incarnate, Robin!) of season 13 (One Piece: WANO KUNI (892-Current)) of One Piece has no it-IT subtitles But it obvioulsy has IT subtitles 🫀

adracea commented 1 year ago

I tested the v3 with that infamous one piece episode. Now I get a different error: Episode 1044 (Clutch! A Demon Incarnate, Robin!) of season 13 (One Piece: WANO KUNI (892-Current)) of One Piece has no it-IT subtitles But it obvioulsy has IT subtitles 🫀

One Piece has no it-IT subtitles But it obvioulsy has IT subtitles

Hey @aniplayIt , I tried digging on this issue today and I honestly am not able to see any subs for OnePiece other than English for some reason ? Crunchyroll might be pulling something shady as they have started reporting ja-JP and even zh-CN locales as en-US .

bytedream commented 1 year ago

It seems that the subtitles are geo restricted as I can only access German subtitles.

aniplayIt commented 1 year ago

Yes correct. Fixed using a VPN. This does not depend on the downloader so I'm closing the issue

aniplayIt commented 1 year ago

I'm reopening this so maybe you can help me figure out how to download this.

crunchy --credentials xxx:xxx --lang it-IT download -a ja-JP -s it-IT -o episode.ts -r best https://www.crunchyroll.com/it/watch/G2XU0Q9EN/please-eat-me-up-great-evil-dragon :: βœ” Logged in
:: βœ” Parsed url 1
:: βœ” Fetching series details
:: a unexpected error occurred: could not find any stream with hardsub locale 'it-IT'

bytedream commented 1 year ago

That's interesting. I can download it without problems. Does the issue still exist for you?

aniplayIt commented 1 year ago

@ByteDream now I can download it but the audio is chinese...

bytedream commented 1 year ago

The anime shouldn't have a chinese dub at all πŸ€”

aniplayIt commented 1 year ago

The animes

aniplayIt commented 1 year ago

Here we go again crunchy --credentials xxx:xxx --lang it-IT download -a ja-JP -s it-IT -o episode.ts -r 1080p https://www.crunchyroll.com/it/series/GQWH0M455/dont-toy-with-me-miss-nagatoro\[S2E2] :: βœ” Logged in :: βœ” Parsed url 1 :: βœ” Fetching series details :: a unexpected error occurred: could not find any stream with hardsub locale 'it-IT'

immagine
bytedream commented 1 year ago

Now I can reproduce :o

bytedream commented 1 year ago

Okay, this is the point where ffmpeg is/will be mandatory for download too. Crunchyroll provides subtitles in two ways: Burnt into the video and as file which only contains the subtitle. It seems that they're moving away from burning them into the video? The download command always uses the video with subtitles burnt in but Crunchyroll fails to deliver those kind of videos for every language. Italian is one of the languages which does not always receive a burnt-in variant, which is the cause of your issue.

aniplayIt commented 1 year ago

Ok so you'll add some flag to tell ffmpeg to re-encode the episode with burnt-in subtitles?

bytedream commented 1 year ago

Yep