animesync icon indicating copy to clipboard operation
animesync copied to clipboard

Slow Downloads

Open ali-m-github opened this issue 2 years ago • 3 comments

Hello, I am getting too slow downloads even though I am running this on a 10 gbps server. A 50 episodes series took about 8-9 hours to finish.

ali-m-github avatar May 24 '22 13:05 ali-m-github

Download speed depends on two factors: your download speed, and the provider upload speed. Crunchyroll has limitations for the maximum upload speed they allot to individual connections. From my tests, that is about 2x video speed. One episode would therefore download in roughly 10 minutes.

Another factor is this is that animesync pretends to be a regular user. It downloads everything in context of a web browser, and behaves as much as possible as a regular user. A regular user never watches more than one episode at once. So animesync never downloads more than one episode at once. Since there's no parallelization going on, downloads happen in serial.

A quick calculation would then tell us that 50 episodes * 10 minutes = 500 minutes = 8.3 hours. Seems about right to me.

Deathspike avatar May 24 '22 19:05 Deathspike

Download speed depends on two factors: your download speed, and the provider upload speed. Crunchyroll has limitations for the maximum upload speed they allot to individual connections. From my tests, that is about 2x video speed. One episode would therefore download in roughly 10 minutes.

Another factor is this is that animesync pretends to be a regular user. It downloads everything in context of a web browser, and behaves as much as possible as a regular user. A regular user never watches more than one episode at once. So animesync never downloads more than one episode at once. Since there's no parallelization going on, downloads happen in serial.

A quick calculation would then tell us that 50 episodes * 10 minutes = 500 minutes = 8.3 hours. Seems about right to me.

Thanks for your reply! I got you! Would it be possible to speed it up or that would get my IP banned?

ali-m-github avatar May 24 '22 19:05 ali-m-github

I personally wouldn't risk it. I have read reports about IP-bans for downloads, but I'm not intimately familiar with the specifics of those situations. I can't imagine they would ban for a few parallel downloads, but you never know. In the long run, the time spent downloading is far quicker than you could possibly watch it yourself. I really wouldn't risk it.

That said, you could change the shell code to parallelize downloads up to a limit. The code is here https://github.com/Deathspike/animesync/blob/master/src/shell/actions/createDownload.ts#L41. The core/server already supports parallel downloads, so all you need to figure out is how to limit parallelization in the shell code.

Deathspike avatar May 25 '22 11:05 Deathspike