From 8b444099dbad4e064880031fb0ed77564bf42d86 Mon Sep 17 00:00:00 2001 From: Thibaud Date: Mon, 2 Mar 2026 17:12:30 +0100 Subject: [PATCH] fix wallabag_explorer.py and add page param --- uv.lock | 2 +- wallabag_explorer.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/uv.lock b/uv.lock index 6ed98e5..3b111be 100644 --- a/uv.lock +++ b/uv.lock @@ -953,7 +953,7 @@ wheels = [ [[package]] name = "wallabag-api" version = "1.2.3" -source = { git = "https://git.gasser.ovh/thib8956/wallabag-api-client.git#275cf0c6b0f73347bb177eac097e47cd0014ac21" } +source = { git = "https://git.gasser.ovh/thib8956/wallabag-api-client.git#4ef3de646ef303ec5eb3f9f05da75cb919683f3d" } dependencies = [ { name = "aiohttp" }, ] diff --git a/wallabag_explorer.py b/wallabag_explorer.py index 63adfc3..c8f0809 100644 --- a/wallabag_explorer.py +++ b/wallabag_explorer.py @@ -9,21 +9,21 @@ async def get_paginated_entries(w_api: Wallabag, per_page: int, page: int): return await w_api.get_entries(perPage=per_page, page=page) -async def async_main(path: str = "config.ini", per_page: int = 10): +async def async_main(path: str = "config.ini", page: int = 1, per_page: int = 10): async with aiohttp.ClientSession() as session: configuration = dict(load_configuration(path)) w_api = await connect_to_wallabag(configuration, session) - - for page in range(1, 10): - entries = await get_paginated_entries(w_api, per_page, page) + entries = await get_paginated_entries(w_api, per_page, page) + print(entries) def main(): parser = argparse.ArgumentParser() parser.add_argument("--config", default="config.ini", help="Path to config file") + parser.add_argument("--page", type=int, default=1, help="Page number") parser.add_argument("--per-page", type=int, default=10, help="Entries per page") args = parser.parse_args() - asyncio.run(async_main(args.config, args.per_page)) + asyncio.run(async_main(args.config, args.page, args.per_page)) if __name__ == "__main__":