Site owners tend to hate web crawlers and anidb is no exception. Always prefer official APIs and language-specific bindings to them, if possible
Thou shall be bs4-powered library to fetch various data from anidb site, without relying on any API. Im making it solely for my discord server's bot to use and right now its extremely WIP
- python 3.8+
- beautifulsoup4
- requests
import anidb_parser as ap
fetcher = ap.AnidbFetcher(user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0")
client = ap.AnidbClient(fetcher_instance = fetcher)
client.get_anime(99)- There wont be async support. I initially planned to implement it, but since flooding anidb with requests will bring your IP to their blacklist - I stepped back on that decision
- Another reason behind decision above is that multiple requests within few seconds will return 403, due to anti-bot protection. For the time being, its your own responsibility to ensure there are pauses long enough to prevent it
- Because automated web parsing is banned by anidb, in order to use this library, you must supply it with real browser's user agent
- Its only possible to process pages available to anonymous. I may reconsider that choice later, but for the time being everything that require you to provide your anidb account creditnails in unaccessible