wolfswolke / aniworld_scraper

Aniworld.to mp4 scraper for animes.
MIT License
56 stars 15 forks source link

VOE is working with dependency ffmpeg #16

Closed speedyconzales closed 1 year ago

speedyconzales commented 1 year ago

UPDATE:

wolfswolke commented 1 year ago

Thank you again! I will look at it when im home and if it does work without the Captcha ill merge it. (It could be that they removed the captcha some time ago.)

wolfswolke commented 1 year ago

Is it possible to inclue FFMPEG as a lib? Downloading a tool just to use a tool is kinda dumb in my eyes... Also the FFMPEG website is down atm xD Maybe we can use something like: https://github.com/kkroening/ffmpeg-python?

wolfswolke commented 1 year ago

Just found: moviepy and it can do what we need i think. ill tinker around with the code a little. Code: from moviepy.editor import VideoFileClip video = VideoFileClip(hls_url) video.write_videofile(file_name) video.close()

wolfswolke commented 1 year ago

Ok it took 15 minutes to download 5 episodes... with 100% CPU... Is FFMPEG also so slow? Because this lib uses it aswell but has it integrated... @speedyconzales Code: def download_and_convert_hls_stream(hls_url, file_name): try: video = VideoFileClip(hls_url) video.write_videofile(file_name, codec="h264_nvenc") video.close()

speedyconzales commented 1 year ago

if you want to get rid of ffmpeg as a tool dependency I would just use streamlink, but I do have problems with threading when using this. Both of your suggestions also use ffmpeg btw.

wolfswolke commented 1 year ago

I know they do but they have it included. The thing is telling a user download Tool X and then use our tool is bad. But including a Tool in the tool is ok. The User doesnt have to search for a download and if that Tool ever gets deleted from the interrnet or the website is down they dont need to worry. I just want this to be a complete tool with no external downloads needed.

speedyconzales commented 1 year ago

Ok it took 15 minutes to download 5 episodes... with 100% CPU... Is FFMPEG also so slow? Because this lib uses it aswell but has it integrated... @speedyconzales Code: def download_and_convert_hls_stream(hls_url, file_name): try: video = VideoFileClip(hls_url) video.write_videofile(file_name, codec="h264_nvenc") video.close()

I did not experience anything like that with solely using ffmpeg. Moviepy is overkill in my opinion cause it is introducing several new dependencies which are not needed. only ffmpeg is really needed. "MoviePy depends on the Python modules Numpy, imageio, Decorator, and tqdm, which will be automatically installed during MoviePy’s installation. The software FFMPEG should be automatically downloaded/installed (by imageio) during your first use of MoviePy (installation will take a few seconds)."

The only thing I see is that you like the feature that it is installing ffmpeg automatically. But I am not a friend of that. I would always list all dependencies and tell the user to install it instead of automatically installing something. That said moviepy does not have ffmpeg integrated, it installed it via imageio (another python package) on your system.

wolfswolke commented 1 year ago

Well we can leave it with ffpeg as a external Software. But currently the website is down so i cant even test it...

speedyconzales commented 1 year ago

ffmpeg is a widely accepted and common tool, that nearly every other third party video editing tool uses. As you experienced yourself now, both of your suggestions use it as well and it is not integrated. It will be installed on your system.

speedyconzales commented 1 year ago

the website is not down for me. you can't use this URL: http://ffmpeg.org ?

speedyconzales commented 1 year ago

I would assume that during use of moviepy you now already have it. I would just try ffmpeg -version in terminal.

wolfswolke commented 1 year ago

Yea its down when i connect from Austria. Just tried a VPN to germany and it works there... weird... Ill try installing it now

wolfswolke commented 1 year ago

Ok it works. We can just include the ffmpeg File in the src Folder according to the MIT License they have. Or we could add a link to the Github Page for the download aswell. What do you think is a better idea?

speedyconzales commented 1 year ago

I do not have an opinion on that: but for the full understanding: the main repo is this https://git.ffmpeg.org/ffmpeg.git Github is only a mirror, but I think it is totally fine to link to the Github page. There is all the relevant information anyway. and regarding license: "FFmpeg is licensed under the GNU Lesser General Public License (LGPL) version 2.1 or later. However, FFmpeg incorporates several optional parts and optimizations that are covered by the GNU General Public License (GPL) version 2 or later. If those parts get used the GPL applies to all of FFmpeg"

speedyconzales commented 1 year ago

Ok it took 15 minutes to download 5 episodes... with 100% CPU... Is FFMPEG also so slow? Because this lib uses it aswell but has it integrated... @speedyconzales Code: def download_and_convert_hls_stream(hls_url, file_name): try: video = VideoFileClip(hls_url) video.write_videofile(file_name, codec="h264_nvenc") video.close()

I assume that you got a 100% CPU usage because of the codec you specified. The ffmpeg command I provided uses the -c copy option which tells ffmpeg to simply copy audio and video streams. In your example I am pretty sure it reencoded the stream with the codec you specified. That is pretty resource intensive to do. EDIT: The nvenc codec specifies an hardware encoding for NVIDIA GPUs. Are you using one? Normally your CPU should not have been working that much then.

wolfswolke commented 1 year ago

I would say we add the ffmped File for windows and linux to the SRC. This makes the Project still a all in one solution and the user doesnt need to go around finding links and Files. Ill push the Files and a thirdparty.md File so the User can see where the File came from and the License they use. (https://github.com/BtbN/FFmpeg-Builds/releases)