insert username and password SdarotAPI

This commit is contained in:
2023-07-17 14:28:09 +03:00
parent d3bc698da0
commit 5b72076f26

View File

@@ -7,12 +7,13 @@ SDAROT_DOMAIN = "sdarot.buzz"
DOWNLOAD_DIRECTORY_PATH = 'downloads'
class SdarotApi:
def __init__(self):
def __init__(self, username, password):
self.session = requests.session()
self.session.headers.update({
'Referer': f'https://www.{SDAROT_DOMAIN}/',
'accepts': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7'
})
self.login(username, password)
def get_cookies(self):
sdarot_cookies = self.session.get(f"https://{SDAROT_DOMAIN}/index").cookies['Sdarot']