caronc/nzb-subliminal

Temporary ban addic7ed?

Closed this issue · 5 comments

Hey!

Ok so I just started using the script, and registered with an account over at addic7ed. It starts off just fine:

INFO - Addic7ed using authentication serice.

but then it seems that I get a temporary ban after the script has run for a minute or two. Does the script need to authenticate for each and every episode? (seems it doesn't save the session?)

WARNING - Failed to authenticate with Addic7ed!

but then it seems that I get a temporary ban after the script has run for a minute or two.

There could be several things going on here... first off (source):
screenshot from 2018-04-17 09-04-50

By the sounds of it, you're scanning your entire media library and this will generate a lot traffic against their site. Your temporary bans might be a result of that.

From my end of things... i can still through the code and see if there is a way i can optimize it. Or with respect to the Facebook post (screenshot above), i could throttle requests for Addi7ed to be 1 minute apart from one another. However, if i did this; it would be an optional switch that would default to be turned off. But it would at least allow people to perform a one time scan on their entire library if they desire.

Does the script need to authenticate for each and every episode?

I'm pretty sure the session is lost before each new file is scanned. While I agree this generates 2 extra hits (a login and a logout), i don't think this is your problem.

I get a temporary ban after the script has run for a minute or two.

This is where I get the assumption you're scanning your entire media library; is this the case?

Yeah, this is the result of scanning the whole library (first use) and thud generating a lot of traffic to addic7ed servers.

I understand there won't be a need to do this later and I can do it once per day or so.

I think you have a very legit concern. I was thinking more about your problem and it almost makes sense to just build something into the script (that is permanent) to handle it.

I mean... No one wants to get banned (even for a short time) from a server they favor and/or rely on (in our case a sub-title source). I think it would make sense to auto-throttle the entire application once it senses that it may be abusing services.

What I'll do is define a new variable X which will represent the number of requests we can make to a subtitle server (from this script) before it 'throttles' our connection for a predefined period of time (variable Y). We'll have to play with X and Y so we can keep the script running as fast as possible but eliminate the possibility of being ban (even temporary ones). At this time I don't have a good suggestion as to what these variables could be. But we could start with something like every 15 requests (X) sleep/block for 30 seconds (Y) and we'll tweak with these values from there.

I won't have time to look into this until the weekend (hopefully). But does that seem reasonable to you?

Hmm... sorry, but I'm no developer so I'm not really the right person to ask for device from.

Although, I find it strange that the script has to login/logout for every search. I understand that Sickbeard uses (cookie?) sessions, and thus not hammering the servers with login/logout. I think it then fetches the RSS-feed from the server and works with that, instead of scraping the server.

I'm not sure if that helps, maybe have a look at how that works?

It took a while; but I got around to resolving this. Basically throttling is built into the application now and is fully customizable for those wishing to change it's default values or flat out disable it (putting things back how they were).