chenqingyu / auto-sub

Automatically exported from code.google.com/p/auto-sub
0 stars 0 forks source link

Large download queue handling #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a large video library (in my case roughly 4000 episodes
2. run auto-sub

On 0.5.5 the whole queue gets processed (both getsublink and the download 
process) instead of stopping when the API call limit is reached.

Simply adding a check inside the for loop function run() in checkSub.py instead 
of just once before processing the whole loop solves it. (literally copy/paste 
the "if not autosub.Helpers(checkAPICalls():" portion (3 lines) inside the for 
loop and it's solved.)

This also goes for the function run() in downloadSubs.py

Original issue reported on code.google.com by nielswij...@gmail.com on 9 Jul 2012 at 11:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
As i forgot myself: add the following too when exiting out of the for loop when 
the api limit is reached:

autosub.TODOWNLOADQUEUELOCK = False
autosub.WANTEDQUEUELOCK = False

Obviously goes for both functions ;)

Original comment by nielswij...@gmail.com on 9 Jul 2012 at 11:49

GoogleCodeExporter commented 9 years ago
Add to this the the fact that i currently need all 300 api calls to get 
downloadlinks.. and then some.
After checkSub() is done, downloadSubs doesn't have any api calls left to 
download.. it's going to take weeks to even get the first sub to download 
without resetting the api calls.
As far as i can see we only need 1 api call to download a sub.. maybe it's a 
good idea to stop the checksub thread once the download queue equals (or is 
bigger than) the amount of api calls left.
That way each day a bunch of subs get downloaded instead of having to wait for 
checkSub() to fully complete querying the Bierdopje api for possible subs.

Also.. if i have 300 episodes which have no subtitles on bierdopje the 
downloadSub() function will never be able to run.
It may be wise to step away from the current threaded model and download the 
sub once a download link is available, preventing this odd behavior for large 
wanted lists.

Original comment by nielswij...@gmail.com on 10 Jul 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Agree on this issue, will try to implement it after the higher priority issues.

Original comment by romke.va...@gmail.com on 11 Jul 2012 at 5:25

GoogleCodeExporter commented 9 years ago
I have the same issue. My api calls are left by getting the downloadlinks.
Is it possible to fix this problem in de next release?

Original comment by i...@pbservers.nl on 29 Jul 2012 at 9:40

GoogleCodeExporter commented 9 years ago

Original comment by romke.va...@gmail.com on 20 Sep 2012 at 2:45

GoogleCodeExporter commented 9 years ago

Original comment by romke.va...@gmail.com on 4 Oct 2012 at 1:43