anikimiapi icon indicating copy to clipboard operation
anikimiapi copied to clipboard

fixed error/issue: host giving 403 error code on every request

Open ryan-k8 opened this issue 3 years ago • 0 comments

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) 

ryan-k8 avatar Dec 08 '21 20:12 ryan-k8