2022-05-27 16:41:34 +02:00
|
|
|
#!/usr/bin/env python3
|
2019-12-05 21:48:56 +01:00
|
|
|
import json
|
2022-05-27 16:41:34 +02:00
|
|
|
from urllib.request import urlopen
|
2019-12-05 21:48:56 +01:00
|
|
|
|
2022-05-27 16:41:34 +02:00
|
|
|
from downloader import Downloader
|
2019-12-05 21:48:56 +01:00
|
|
|
|
2022-05-27 16:41:34 +02:00
|
|
|
class Ikea(Downloader):
|
2019-12-05 21:48:56 +01:00
|
|
|
|
2022-10-04 00:01:06 +02:00
|
|
|
def get_url_list(self):
|
2022-05-27 16:41:34 +02:00
|
|
|
|
|
|
|
f = urlopen("http://fw.ota.homesmart.ikea.net/feed/version_info.json")
|
|
|
|
data = f.read()
|
2019-12-05 21:48:56 +01:00
|
|
|
|
2022-05-27 16:41:34 +02: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
|
|
|
|
2022-05-27 16:41:34 +02:00
|
|
|
res.append((url, fname))
|
2019-12-05 21:48:56 +01:00
|
|
|
|
2022-05-27 16:41:34 +02:00
|
|
|
return res
|