Skip to content

Commit 21a7981

Browse files
committed
Check a different url if lineageos exists
1 parent c985726 commit 21a7981

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

openandroidinstaller/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@
2222

2323
def get_download_link(devicecode: str) -> Optional[str]:
2424
"""Check if a lineageOS version for this device exists on download.lineageos.com and return the respective download link."""
25-
url = f"https://download.lineageos.org/{devicecode}"
25+
url = f"https://download.lineageos.org/api/v2/devices/{devicecode}"
2626
try:
2727
logger.info(f"Checking {url}")
2828
# Get Url
2929
res = requests.get(url, timeout=5)
3030
# if the request succeeds
3131
if res.status_code == 200:
32-
logger.info(f"{url} exists.")
33-
return url
32+
download_url = f"https://download.lineageos.org/devices/{devicecode}/builds"
33+
logger.info(f"{download_url} exists.")
34+
return download_url
3435
else:
3536
logger.info(f"{url} doesn't exist, status_code: {res.status_code}")
3637
return None

0 commit comments

Comments
 (0)