pystardust / ani-cli

A cli tool to browse and play anime
GNU General Public License v3.0
7.86k stars 540 forks source link

Links seem to have been outdated or gogoanime has blocked ani-cli? #139

Closed jnishwanth closed 2 years ago

jnishwanth commented 2 years ago
Getting data for episode 111
Downloading episode 111 ...
https://loadfast1.com/www10/c6e4aca092c75849d378f418687a5c58/ep.111.1613285431.720..m3u8
ffmpeg version n4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[https @ 0x55b0df4fae40] No trailing CRLF found in HTTP header. Adding it.
[https @ 0x55b0df4fae40] HTTP error 404 Not Found
https://loadfast1.com/www10/c6e4aca092c75849d378f418687a5c58/ep.111.1613285431.720..m3u8: Server returned 404 Not Found
Download failed episode: 111

I disabled dumping of output into null and got this 404 error on the link generated by ani-cli. Possibly gogoanime or the site hosting the stream files have set up some extra measures of late?

stl3 commented 2 years ago

I was thinking I was the only one having problems, there might be something to this. Anyone else able to confirm? I'm able to use the site, just ani-cli has problems it seems.

asunanto commented 2 years ago

Yea i am experiencing the same issue when I disabled dumping of output into null. It was working for me the day before

Playing: https://loadfast1.com/www01/723e5dbcf4cd1e9397e2ca402baa95bd/ep.24.1605941102.360..m3u8
[ytdl_hook] ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by <HTTPError 404: 'Not Found'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[ytdl_hook] youtube-dl failed, trying to play URL directly ... 
[ffmpeg] https: HTTP error 404 Not Found
Failed to open https://loadfast1.com/www01/723e5dbcf4cd1e9397e2ca402baa95bd/ep.24.1605941102.360..m3u8.
stl3 commented 2 years ago

Can you guys test it again right now? It's working for me again.

asunanto commented 2 years ago

Yeap working for me now

jnishwanth commented 2 years ago

No luck for me still

viasux commented 2 years ago

Unable to watch, it shows the "currently playing" screen, but nothing plays.

Dink4n commented 2 years ago

Add these 2 lines to line 123.

tmp_url=$(printf '%s' "$video_url" | sed -n -E 's/(.*)\.([0-9]+\.[0-9]+)\.[0-9]+\.m3u8/\1.\2.m3u8/p')
[ -z "$tmp_url" ] || video_url="$tmp_url"
zhenchai00 commented 2 years ago

Add these 2 lines to line 123.

tmp_url=$(printf '%s' "$video_url" | sed -n -E 's/(.*)\.([0-9]+\.[0-9]+)\.[0-9]+\.m3u8/\1.\2.m3u8/p')
[ -z "$tmp_url" ] || video_url="$tmp_url"

This work for me :) Can help make pull request on it

hamzawinix commented 2 years ago

Add these 2 lines to line 123.

tmp_url=$(printf '%s' "$video_url" | sed -n -E 's/(.*)\.([0-9]+\.[0-9]+)\.[0-9]+\.m3u8/\1.\2.m3u8/p')
[ -z "$tmp_url" ] || video_url="$tmp_url"

sed magic can help fix anything eh, btw it would be awesome to port this to windows powershell using vlc as a video player

Reaper176 commented 2 years ago

for sake of an answer to a question that will end up being asked. Remove the old installation from /usr/local/bin. Add the line above ani-cli. do Sudo make. "I know doing things with Sudo is BbBaAAdD". Profit. also yes I know it could just be changed in the local bin but for some reason that proved to be an issue with mine and this might help someone else. <3

joshualagat commented 2 years ago

Can confirm Dink4n's lines worked. As what Reaper176 said you can remove the old installation in /usr/local/bin or just add the two lines in but make sure you're using sudo before editing it. The text editor won't save it when you don't sudo. (I tried it without)

Then just do sudo make and you should be good to go as far as I know

jnishwanth commented 2 years ago

@Dink4n could you tell me how you fixed it in layman's terms? I don't really know a lot about sed or scrapping links. Thanks!

BluPenDragon commented 2 years ago

adding these 2 lines at 123 did not fix it for me, the terminal side still seems to work but no mpv window opens

joshualagat commented 2 years ago

@BluPenDragon Have you tried adding the 2 lines to the ani-cli file on usr/local/bin?

That seemed to work for me.

cd usr/local/bin

sudo nano --linenumbers ani-cli

sudo make
BluPenDragon commented 2 years ago

@BluPenDragon Have you tried adding the 2 lines to the ani-cli file on usr/local/bin?

That seemed to work for me.

cd usr/local/bin

sudo nano ani-cli

sudo make

thanks that worked

kxrn0 commented 2 years ago

Add these 2 lines to line 123.

tmp_url=$(printf '%s' "$video_url" | sed -n -E 's/(.*)\.([0-9]+\.[0-9]+)\.[0-9]+\.m3u8/\1.\2.m3u8/p')
[ -z "$tmp_url" ] || video_url="$tmp_url"

thanks, it works

amazonian4 commented 2 years ago

I switched to Linux last month and don't have a clear idea on how to fix this myself, can anyone point me to what I need to read up on to fix this or alternatively does anyone mind typing out a simple tutorial on how to fix this?

Derisis13 commented 2 years ago

I switched to Linux last month and don't have a clear idea on how to fix this myself, can anyone point me to what I need to read up on to fix this or alternatively does anyone mind typing out a simple tutorial on how to fix this?

Are you sure you have all the dependencies? They are listed in the readme. Hint: try consulting your package manager

Derisis13 commented 2 years ago

Also I suggest pinning the issue until the patch is applied to the repository

jidland12 commented 2 years ago

After applying @Dink4n fix, when I go to download the videos the videos no longer download with metadata as they previously did. I use Plex to watch the downloaded videos and before, Plex would automatically get the metadata and pull all the info it needed from it like cover art, episode names, voice actors, and other info. But now Plex can not find the metadata. Also, I have noticed that now the download rate was impacted greatly and now takes longer to download then it did before.

Is there anything different that this patch does compared to before the patch? Or is it a change on gogoanime's side?

kxrn0 commented 2 years ago

it's broken again

Reaper176 commented 2 years ago

I switched to Linux last month and don't have a clear idea on how to fix this myself, can anyone point me to what I need to read up on to fix this or alternatively does anyone mind typing out a simple tutorial on how to fix this?

Use a text editor. I personally like atom. And add those two lines of code to the corresponding "line number". And then save the file. An example of me doing this was....

in the command line.

  1. atom /usr/local/bin/ani-cli This command for me opens the text editor atom and the file ani-cli
  2. scroll down to line 123.
  3. copy past the new lines into the line 123 it should look like this afterward.

    get_links () {
    embedded_video_url="$1"
    video_url=$(curl -s "$embedded_video_url" |
    sed -n -E '
        /^[[:space:]]*sources:/{
        s/.*(https[^'\'']*).*/\1/p
        q
        }
        ')
    tmp_url=$(printf '%s' "$video_url" | sed -n -E 's/(.*)\.([0-9]+\.[0-9]+)\.[0-9]+\.m3u8/\1.\2.m3u8/p')
    [ -z "$tmp_url" ] || video_url="$tmp_url"
    video_quality=$(get_video_quality "$embedded_video_url" "$video_url")
    
    # Replace the video with highest quality video
    printf '%s' "$video_url" | sed -n -E "s/(.*)\.m3u8/\1.$video_quality.m3u8/p"
    }
  4. save and enjoy all of Dink4n's hard work.
AlexShashkov commented 2 years ago

Search still doesn't work after copying these two lines into code 🤔

Derisis13 commented 2 years ago

Broken again! Fix: change the variable base url from https://gogoanime.cm to https://www1.gogoanime.cm (line 9)

jnishwanth commented 2 years ago

Closing this issue as it seems to have been fixed in a subsequent commit.

NyllRE commented 2 years ago

I checked the fixes and they seem to be applied but the problem still persists

jnishwanth commented 2 years ago

@NyllRE it works for me at the moment. Could you make sure the clone you have is up-to date with the main branch?

elliot0319 commented 2 years ago

@NyllRE it works for me at the moment. Could you make sure the clone you have is up-to date with the main branch?

Im new to git. I did git pull in ani-cli directory. It says it's already up to date. I had a look at the line 123, and it had the line. However, the video still doesn't show up.

zhenchai00 commented 2 years ago

@NyllRE it works for me at the moment. Could you make sure the clone you have is up-to date with the main branch?

Im new to git. I did git pull in ani-cli directory. It says it's already up to date. I had a look at the line 123, and it had the line. However, the video still doesn't show up.

Didn't you try "sudo make" to rebuild the bin files?

elliot0319 commented 2 years ago

I did, and it didn't work. (I don't know what sudo make does, but yeah.)

zhenchai00 commented 2 years ago

I did, and it didn't work. (I don't know what sudo make does, but yeah.)

Did you try to check the ani-cli located by using the "which ani-cli" The file path should be something like "/usr/local/bin/ani-cli"?

elliot0319 commented 2 years ago

it does say that. Also, I used brew to get all the dependencies. ➜ bin which ani-cli /usr/local/bin/ani-cli

Derisis13 commented 2 years ago

Can you access www1.gogoanime.cm trough your web browser? It could have been blocked by your dorm/ISP/county. Either way please provide the output you get from ani-cli, it would greatly help in debugging.

Reaper176 commented 2 years ago

I feel like your ani-cli is calling to an older version that did not get updated. Just a thought that you might want to go through and make sure every trace of it is removed before doing a new get and install.

elliot0319 commented 2 years ago

I do have access to the website. I can play the video just fine.

jnishwanth commented 2 years ago

Does running ./ani-cli from the repo clone directory work?

Edit: make sure the file is executable with chmod +x ani-cli

elliot0319 commented 2 years ago

I'm not sure what you mean by "work." I can use the search, select the episode, but it wouldn't play the video. I did chmod +x ani-cli, and it still says it's currently playing the anime, but mpv wouldn't show up.

Reaper176 commented 2 years ago

and www1.gogoanime.cm is what is on line...6? 7?

elliot0319 commented 2 years ago

It is on line 8 or 7. can't count:)

Reaper176 commented 2 years ago

hmmm.....well....all i got for you is to go into /usr/local/bin and remove ani-cli. remove the git of it, re-git it, and re-make it. If that does not work....we throw the bat signal up.

Derisis13 commented 2 years ago

What I would try is snatching an embedded video link (eg. from Youtube) and try playing that with mpv. I think that's where your problem should be

Reaper176 commented 2 years ago

something like - mpv "https://youtu.be/Gzvvvnisf5M"

elliot0319 commented 2 years ago

woo.. I tried to run mpv "https://youtu.be/Gzvvvnisf5M" it says the following. [ytdl_hook]
[ytdl_hook] youtube-dl failed: not found or not enough permissions Failed to recognize file format.

Exiting... (Errors when loading file)

elliot0319 commented 2 years ago

hmmm.....well....all i got for you is to go into /usr/local/bin and remove ani-cli. remove the git of it, re-git it, and re-make it. If that does not work....we throw the bat signal up.

yeah...I did all that, and the issue persists.

Derisis13 commented 2 years ago

woo.. I tried to run mpv "https://youtu.be/Gzvvvnisf5M" it says the following. [ytdl_hook] [ytdl_hook] youtube-dl failed: not found or not enough permissions Failed to recognize file format.

Exiting... (Errors when loading file)

Well that might be the probem... Try brew install youtub-dl and run the script again

elliot0319 commented 2 years ago

Right. I can play YouTube videos now.

Dink4n commented 2 years ago

Take a look at #106, #137, #2

tl;dr

Try replacing the setsid -f with nohup in line 280. Also add an & at the end of the line. https://github.com/pystardust/ani-cli/blob/1a1909b1f7bced503cd9173e433d9a712eae137c/ani-cli#L280

ghost commented 2 years ago

is there a way to add a if the website is down a backup / alternate website will be used as base_url? like if gogoanime.cm changed then cni-cli would switch to gogoanime.wiki? i thought

base_url="gogoanime.nvnvnvnvnvn" || base_url="gogoanime.wiki"

would force ani-cli to pick the latter as base_url

gilbustamante commented 2 years ago

I'm still relatively new to Github/shell stuff in general so I apologize if this isn't the correct place to put this.

I've been having this same issue, and while troubleshooting I noticed something:

When I added a quick echo $video_url on line 279 (right above the setsid line) I noticed that some (but not all) shows end up with an extra . in the URL. For example if I try to play the show "The Detective Is Already Dead" the video_url ends with episode-1.original..m3u8 and mpv will not play anything. But if I try another show like Fire Force, the video_url does not contain the extra . and the video plays as expected.

I also noticed the first post in this thread has the same thing; the URL on the third line ends with 1613285431.720..m3u8 although I can't say for sure if this is related.

To see if this was the problem I replaced the echo statement with a bash replacement construct to replace instances of .. with .:

video_url="${video_url//../.}"

And after running sudo make, shows that were previously causing issues are now playing correctly. I'm not sure if this is too much of a "hacky" solution to the problem but hopefully it helps someone else.

Dink4n commented 2 years ago

@gilbustamante This is already fixed in 1a1909b1f7bced503cd9173e433d9a712eae137c