Skip to content

Commit e9e657f

Browse files
committed
Use the region from the restore code when restoring
Fixes #18
1 parent 1ead53a commit e9e657f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bna/http.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def restore(serial: str, restore_code: str) -> str:
119119
if len(restore_code) != 10:
120120
raise ValueError(f"invalid restore code (should be 10 characters): {restore_code}")
121121

122-
client = APIClient()
122+
# Region is always the first two chars of a restore code
123+
region = serial[:2]
124+
client = APIClient(region=region)
123125
challenge = client.initiate_paper_restore(serial)
124126

125127
code = restore_code_to_bytes(restore_code)

0 commit comments

Comments
 (0)