winterbird-code / adbb

Object Oriented UDP Client Library for AniDB
GNU General Public License v3.0
17 stars 4 forks source link

some windows fixes and changed update intervall #2

Closed Andy2244 closed 7 years ago

Andy2244 commented 7 years ago

Hi,

i changed the update interval to 36 hours, just to-be on the safe side. The remote size check seems pointless, since the anidb guys noted that the file will be updated every 24-48 hours anyway, so size may change always. The request to check the size would also count against the access limit, so if we want to add this logic we need to make sure the check/read happens using the same request.

If possible could you add a extra safeguard using the db itself and store the last url access time, its rather annoying if something goes wrong or the user actually cleaned the temp dirs within 24 hours and you get ip banned for 24 hours. So we should store the last access time in the db and first check this and than the filedate. So that only if the db was deleted and the temp dir cleaned, you might get temp banned.

winterbird-code commented 7 years ago

Thanks, merged. I guess a check against a database timestamp could be good, but I guess we should make a big fat note in the readme to warn against clearing cache/db as well as throw an exception with a clear message about why we refuse to fetch the file and why the library will be unusable for 24 hours :)

Andy2244 commented 7 years ago

Yeah i talked to the anidb mods and you will at least get a 24h ban, i even had a 48 h ban because my tests vs the header counted as separate requests. So they will add-up, the mod even showed me a example of someone who had a ban until 2020 :)

The bans will be lifted automatically, but if you manage to hammer the file with a bunch of coded requests, before the actual ip-ban logic can kick in, all will be summed up, for some funny ban times.