wolfswolke / aniworld_scraper

Aniworld.to mp4 scraper for animes.
MIT License
60 stars 17 forks source link

[REQUEST] Sequential Download Option #66

Closed Milian20 closed 2 months ago

Milian20 commented 2 months ago

Please describe what you want to be added/changed: Hi,

Is it possible to add a feature that allows the next episode to be downloaded automatically after the previous one is finished? This would help avoid too many simultaneous downloads or idle time between downloads.

Thank you!

Possible Solutions if you have any:

MrMysterius commented 2 months ago

I pretty sure that it already downloads every episode of a show one after another. And if anything it runs like 5 downloads simultaneously, but in sequential order with a bit of wait time to not hit a rate limit / ddos protections.

https://github.com/wolfswolke/aniworld_scraper/blob/22b958ccb2694e90f6d64570198b361b8f4443f6/src/constants.py#L35-L36

wolfswolke commented 2 months ago

Hello @Milian20 . What do you mean? The current system starts 5 downloads and then waits 60 seconds to not trigger any DDOS protections on the websites. This can be changed in constants.py:

ddos_protection_calc = 5
ddos_wait_timer = 60  # in seconds

Do you want it to download one after each other and not multiple threads that download multiple episodes at once? The only downtime would be the DDOS timer but that can be changed with testing around.

Milian20 commented 2 months ago

Hi,

Currently, two downloads start simultaneously, and after 60 seconds, more downloads are initiated. However, if the previous downloads haven't finished yet, this leads to an increasing number of simultaneous downloads. When too many downloads run at the same time, some of them might fail or get interrupted. Depending on the series, episodes can vary significantly in length, and the internet speed isn't always consistent.

I think it would be helpful if the code could download only one or two episodes at a time, and once they are finished, automatically start the next downloads. This would make the process more efficient and reduce the chances of downloads failing due to network congestion.

I use main.py und constants.py

tkanks for you quik answer

Milian20 commented 2 months ago

how can i use the multi_runner.bat?

wolfswolke commented 2 months ago

Currently adding the timeout with Threading. Also just run it. It explains everything ^^

wolfswolke commented 2 months ago

@Milian20 try latest commit. Added some vars for this:

max_download_threads = 5 # This does NOT limit the threads but won't start more when the DDOS Timer starts.
thread_download_wait_timer = 30  # in seconds
disable_thread_timer = False # If true the script will start downloads as soon as the ddos protection is over.

5 downloads are about 16 threads from what i see so 5 should be OK as it wont start anything unless its under 5 so MAX it reashes 20 threads. Which would be around max 6 downloads as 1 download would be 3 threads.

Milian20 commented 2 months ago

just after downloading the updatet files from github in an difrent folder. it says :

PS D:\unterhaltung\Anime_down\seriend downloader ani st - Kopie> & C:/Users/boehm/AppData/Local/Programs/Python/Python312/python.exe "d:/unterhaltung/Anime_down/seriend downloader ani st - Kopie/aniworld_scraper-main/main.py" 2024-08-28 21:42:01 - INFO - src.start_app - ------------- AnimeSerienScraper v01-10-00 started ------------ 2024-08-28 21:42:01 - ERROR - src.start_app - No Read Permission. Please check if you own the Folder and/or have permissions to read.

I tried to change the do_not_delet txt file vrom the privios code to the updated. Now im lost i just wanted to try your update and now it is brocken. i hope that I just did same thing wrong. maybe you can help me. and the privios code in an anower folder does now also not work. Idk

wolfswolke commented 2 months ago

@Milian20 please check that you have read/write permission and that the do not delete file exists. You can do that by right clicking the folder and going into security. image

Milian20 commented 2 months ago

thanks jes it does show read. Now ich downloaded the code 2.05 with git clone und the htpps and it does work now. before i installt it via zip folder and extrakt it maybe that was the problem but it works and ich will check out the feture that you addet thanks

Milian20 commented 2 months ago

thank you it works fine for me now .