deconz_fw_downloader/ikea.py

25 lines
566 B
Python
Raw Normal View History

#!/usr/bin/env python3
2019-12-05 21:48:56 +01:00
import json
from urllib.request import urlopen
2019-12-05 21:48:56 +01:00
from downloader import Downloader
2019-12-05 21:48:56 +01:00
class Ikea(Downloader):
2019-12-05 21:48:56 +01:00
def get_url_list(self):
f = urlopen("http://fw.ota.homesmart.ikea.net/feed/version_info.json")
data = f.read()
2019-12-05 21:48:56 +01:00
arr = json.loads(data)
res = []
for i in arr:
if 'fw_binary_url' in i:
url = i['fw_binary_url']
ls = url.split('/')
fname = ls[len(ls) - 1]
2019-12-05 21:48:56 +01:00
res.append((url, fname))
2019-12-05 21:48:56 +01:00
return res