Skip to content

Commit

Permalink
Fix readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
AT0myks committed Dec 21, 2023
1 parent fb4f7fe commit 5508bdc
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5508bdc

Please sign in to comment.