Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lector/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ def _wait_for_js(self):
These modules provide the interface used to execute API queries.
"""
# Wait for the Module Manager to load
mod_mgr_script = ur"return window.hasOwnProperty('KindleModuleManager');"
mod_mgr_script = r"return window.hasOwnProperty('KindleModuleManager');"
mod_mgr_loaded = lambda br: br.execute_script(mod_mgr_script)
self._wait(5).until(mod_mgr_loaded)

# Wait for the DB Client to load
db_client_script = dedent(ur"""
db_client_script = dedent(r"""
var done = arguments[0];
if (!window.hasOwnProperty('KindleModuleManager') ||
!KindleModuleManager
Expand Down
17 changes: 17 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
from lector import KindleCloudReaderAPI

# Zugriff auf Umgebungsvariablen
email = os.getenv("thomas.m.lenz@t-online.de")
password = os.getenv("T3454955!")

# API-Initialisierung
api = KindleCloudReaderAPI(email, password)

# Bibliothek abrufen und aktuellen Lesefortschritt anzeigen
my_library = api.get_library_metadata()
book = my_library[0]
book_progress = api.get_book_progress(book.asin)
_, current_page, last_page = book_progress.page_nums

print("Currently reading %s (Page %d of %d)" % (book.title, current_page, last_page))