From 5508bdc5e18331d77f332150146dbb3af2166496 Mon Sep 17 00:00:00 2001 From: AT0myks Date: Thu, 21 Dec 2023 15:23:58 +0100 Subject: [PATCH] Fix readme example --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8d10a19..9fc1f59 100644 --- a/README.md +++ b/README.md @@ -175,14 +175,18 @@ You should not use it to repack a custom firmware. ### As a library ```py +import asyncio from reolinkfw import ReolinkFirmware, get_info -url = "https://reolink-storage.s3.amazonaws.com/website/firmware/20200523firmware/RLC-410-5MP_20_20052300.zip" -print(get_info(url)) -pak = "/home/ben/RLC-410-5MP_20_20052300.pak" -with ReolinkFirmware.from_file(pak) as fw: - print(fw.get_info()) - fw.extract() +async def main(): + url = "https://reolink-storage.s3.amazonaws.com/website/firmware/20200523firmware/RLC-410-5MP_20_20052300.zip" + print(await get_info(url)) + pak = "/home/ben/RLC-410-5MP_20_20052300.pak" + with ReolinkFirmware.from_file(pak) as fw: + print(await fw.get_info()) + fw.extract() + +asyncio.run(main()) ``` In most cases where a URL is used, it will be a direct link to the file