anikimiapi
anikimiapi copied to clipboard
fixed error/issue: host giving 403 error code on every request
context : #11 #12
i have fixed this by adding an attribute user_agent
in the constructor of the main class which is passed on as header option for every request made to the host.
the main gist of changes ⬇️
the constructor of the main class
def __init__(
self,
gogoanime_token: str,
auth_token: str,
host: str = "https://gogoanime.pe/",
user_agent:dict = {'User-Agent': 'Mozilla/5.0'},
):
now every get requests made to the host looks something like this
requests.get(animelink,headers=self.user_agent)
#or
session.get(url,headers=self.user_agent)