Compare commits
5 Commits
cc2e31f0a6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c461f7a5a8 | |||
| 209af375fe | |||
| dfa9a1a09e | |||
| 5b72076f26 | |||
| d3bc698da0 |
@@ -1,2 +1,3 @@
|
|||||||
requests
|
requests
|
||||||
pyyaml
|
pyyaml
|
||||||
|
bs4
|
||||||
@@ -7,12 +7,13 @@ SDAROT_DOMAIN = "sdarot.buzz"
|
|||||||
DOWNLOAD_DIRECTORY_PATH = 'downloads'
|
DOWNLOAD_DIRECTORY_PATH = 'downloads'
|
||||||
|
|
||||||
class SdarotApi:
|
class SdarotApi:
|
||||||
def __init__(self):
|
def __init__(self, username, password):
|
||||||
self.session = requests.session()
|
self.session = requests.session()
|
||||||
self.session.headers.update({
|
self.session.headers.update({
|
||||||
'Referer': f'https://www.{SDAROT_DOMAIN}/',
|
'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'
|
'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):
|
def get_cookies(self):
|
||||||
sdarot_cookies = self.session.get(f"https://{SDAROT_DOMAIN}/index").cookies['Sdarot']
|
sdarot_cookies = self.session.get(f"https://{SDAROT_DOMAIN}/index").cookies['Sdarot']
|
||||||
|
|||||||
17
serie.py
17
serie.py
@@ -1,7 +1,20 @@
|
|||||||
|
class Episode:
|
||||||
|
def __init__(self, number, url):
|
||||||
|
self.number = number
|
||||||
|
self.url = url
|
||||||
|
|
||||||
|
|
||||||
|
class Season:
|
||||||
|
def __init__(self, number, url):
|
||||||
|
self.number = number
|
||||||
|
self.url = url
|
||||||
|
|
||||||
class Serie:
|
class Serie:
|
||||||
def __init__(self, sid, name, seasons):
|
def __init__(self, sid:str, name:str, seasons:list[Season], url:str):
|
||||||
self.sid = sid
|
self.sid = sid
|
||||||
self.name = name
|
self.name = name
|
||||||
self.seasons = seasons
|
self.seasons = seasons
|
||||||
|
self.url = url
|
||||||
|
|
||||||
def get_serie_seasons(self):
|
def get_serie_seasons(self):
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user