deconz_fw_downloader/github_koenkk.py
Daniel Demus cadbbb8666 Add download from github.com/koenkk
Pythony naming
Signed-off-by: Daniel Demus <daniel-github@demus.dk>
2022-10-04 00:01:06 +02:00

23 lines
590 B
Python

#!/usr/bin/env python3
from posixpath import basename
import requests, json, time
from downloader import Downloader
class GithubKoenkk(Downloader):
def get_url_list(self):
res = []
response = requests.get('https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json')
data = json.loads(response.content)
for x in data:
url = x['url']
if 'path' in x:
filename = basename(x['path'])
else:
filename = basename(url)
res.append((url, filename))
return res