ani-cli icon indicating copy to clipboard operation
ani-cli copied to clipboard

Some episodes wont start playing in mpv

Open chbo70 opened this issue 4 years ago • 25 comments

HI, so my main issue is about Black Clover (TV) episodes. After selecting the episode the Player wont start, however i tried it with different animes and they work just fine.

i tried replacing the select video quality print function in issue #192

but it seems its just this anime...

maybe someone can help me or tell me if they have the same issue thanks

chbo70 avatar Dec 18 '21 13:12 chbo70

i have same issue at "senpai ga uzai kouhai no hanashi"

Duoslow avatar Dec 18 '21 17:12 Duoslow

same problem

GetDeleted20454 avatar Dec 19 '21 07:12 GetDeleted20454

I tried reinstalling ani-cli and reinstalling the dependincies still doesnt work

GetDeleted20454 avatar Dec 19 '21 07:12 GetDeleted20454

I am getting this error when I try to watch One Piece, I tried to do a debug, but as I know little about shell script, it didn't work.

When I tried to download, I realize what is the error: image

When I remove the dot in the final of URL, he can get the right m3u file.

https://www16.anicdn.stream/astream/c751bab1939a2b83020565e1ac242896/one-piece-episode-1004.1639880060..m3u8 to https://www16.anicdn.stream/astream/c751bab1939a2b83020565e1ac242896/one-piece-episode-1004.1639880060.m3u8

I don't know much about shell scripting, but the error seems to be in get_links line 129.

alt-art avatar Dec 20 '21 00:12 alt-art

I think he couldn't find the quality of the video.

alt-art avatar Dec 20 '21 00:12 alt-art

I will try to make a condition to this at least.

alt-art avatar Dec 20 '21 00:12 alt-art

I changed the line 129 with this:

    # Replace the video with highest quality video
    if [ -z "$video_quality" ];
  	 then printf '%s' "$video_url";
         else printf '%s' "$video_url" | sed -n -E "s/(.*)\.m3u8/\1.$video_quality.m3u8/p";
    fi

Now Black Cover and One Piece works, but some animes may not work yet.

alt-art avatar Dec 20 '21 04:12 alt-art

i did replace it however black clover still doesnt work

chbo70 avatar Dec 20 '21 09:12 chbo70

well, if i am precise, the first episode works but without sound, all the episodes after that still don't work

chbo70 avatar Dec 20 '21 09:12 chbo70

Here is my debug.log

chbo70 avatar Dec 20 '21 10:12 chbo70

There's still an error that I haven't identified yet, I don't think I'll have time to debug this year.

alt-art avatar Dec 20 '21 17:12 alt-art

There's still an error that I haven't identified yet, I don't think I'll have time to debug this year.

Bro no worries, already thankful for everything ;)

chbo70 avatar Dec 20 '21 17:12 chbo70

I changed the line 129 with this:

    # Replace the video with highest quality video
    if [ -z "$video_quality" ];
  	 then printf '%s' "$video_url";
         else printf '%s' "$video_url" | sed -n -E "s/(.*)\.m3u8/\1.$video_quality.m3u8/p";
    fi

Now Black Cover and One Piece works, but some animes may not work yet.

It helped me to watch One Piece. Thanks a lot )

Stepan-Savchuk avatar Dec 20 '21 18:12 Stepan-Savchuk

I looked a little into this issue; it seems like, for at least some of the anime, gogoanime is pointing their videos to a streamsb server. From there, the current script cannot produce a valid href in the get_links function. I have tried looking into getting around this but not getting anywhere. Hopefully, someone with a little more understanding of this can either give advice or solve this themselves with this knowledge in hand.

seeing this issue with at least the following anime: "senpai ga uzai kouhai no hanashi" "mieruko-chan"

wh1ter4bb1t-js avatar Dec 22 '21 16:12 wh1ter4bb1t-js

@wh1ter4bb1t-js We are in trouble, steamsb won't let us scrap the video.

I tried an answer on stack overflow, and it still had more walls.

I have a temporary suggestion for this problem, animes that can't find a link will run the xdg-open command with an embedded_video_url.

alt-art avatar Dec 23 '21 18:12 alt-art

@alt-art I don't mind having a temporary solution like that, in fact, I thought of doing the same thing. My main concern is that I think that gogoanime is offloading all of their stuff on these third-party servers and with the number of issues that seem to be open that all are related to this issue. I think streamsb may become the defacto server that is being used and if we have to xdg-open for every video then there is really no point in using ani-cli.

wh1ter4bb1t-js avatar Dec 23 '21 22:12 wh1ter4bb1t-js

@wh1ter4bb1t-js True, maybe we can scrape another site, but as we don't have control over it maybe will end up anyway.

Anyway, I like this complicated stuff, and one day I'm going to scrape a site that doesn't usually have many updates (e.g. Crunchyroll).

alt-art avatar Dec 24 '21 00:12 alt-art

I encountered the same bug while trying to watch Cowboy Bebop. It looks like get_links is returning an empty string because the function fails to scrap the video url. In fact, the video url is hidden inside an iframe, and even that only shows up after some javascript inserts the actual video element in the page (it isn't present in the HTML document itself).

GarkGarcia avatar Dec 24 '21 20:12 GarkGarcia

Leaving this open, if someone wants to go wild on the regex stuff, feel invited

port19x avatar Dec 29 '21 12:12 port19x

I found some workaround, though I am not entirely familiar on regex but it works on some anime

I added this line after line 262 and before the assignment of video_url

    if [ "$episode_id" = "" ]; then
        episode_id=$(echo "$embedded_video_url" | grep -oP "id.+?&") 
    fi;
	video_url="https://gogoplay1.com/download?${episode_id}"

SaiCral avatar Dec 30 '21 01:12 SaiCral