mirror of
https://github.com/jo1gi/grawlix.git
synced 2026-06-05 22:14:58 -06:00
fix: resolve compatibility issues from upstream rebase
- Fix f-string quote syntax in ereolen.py for Python < 3.12 - Fix Storytel login signature to match new url parameter - Fix Nextory API field names (identifier vs isbn confusion)
This commit is contained in:
parent
476d460846
commit
ed8fe9eafa
@ -23,7 +23,7 @@ class Ereolen(Source):
|
|||||||
.read_text("utf8") \
|
.read_text("utf8") \
|
||||||
.split("\n")
|
.split("\n")
|
||||||
match: list[str] = [
|
match: list[str] = [
|
||||||
rf"https://(www.)?({"|".join(library_domains)})/reader\?orderid=.+$",
|
rf"https://(www.)?({'|'.join(library_domains)})/reader\?orderid=.+$",
|
||||||
]
|
]
|
||||||
_authentication_methods = [ "login" ]
|
_authentication_methods = [ "login" ]
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class Nextory(Source):
|
|||||||
session_response = await self._client.post(
|
session_response = await self._client.post(
|
||||||
"https://api.nextory.com/user/v1/sessions",
|
"https://api.nextory.com/user/v1/sessions",
|
||||||
json = {
|
json = {
|
||||||
"isbn": username,
|
"identifier": username,
|
||||||
"password": password
|
"password": password
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@ -144,7 +144,7 @@ class Nextory(Source):
|
|||||||
for format_type in ("epub", "pdf"):
|
for format_type in ("epub", "pdf"):
|
||||||
for fmt in product_data["formats"]:
|
for fmt in product_data["formats"]:
|
||||||
if fmt["type"] == format_type:
|
if fmt["type"] == format_type:
|
||||||
return (format_type, fmt["isbn"])
|
return (format_type, fmt["identifier"])
|
||||||
raise InvalidUrl
|
raise InvalidUrl
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class Storytel(Source):
|
|||||||
|
|
||||||
# Authentication methods
|
# Authentication methods
|
||||||
|
|
||||||
async def login(self, username: str, password: str, **kwargs) -> None:
|
async def login(self, url: str, username: str, password: str) -> None:
|
||||||
self.__username = username
|
self.__username = username
|
||||||
self.__password = self.encrypt_password(password)
|
self.__password = self.encrypt_password(password)
|
||||||
self._client.headers.update({"User-Agent": "Storytel/23.49 (Android 13; Pixel 6) Release/2288481"})
|
self._client.headers.update({"User-Agent": "Storytel/23.49 (Android 13; Pixel 6) Release/2288481"})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user