return output
-def update_config(config_path, versions):
+def update_config(www_path, versions):
+ config_path = "{}/config.js".format(www_path)
content = ""
with open(str(config_path), "r", encoding="utf-8") as file:
content = file.read()
def scrape(args):
url = args.domain
- www_path = args.www_path
- config_path = "{}/config.js".format(www_path)
- data_path = "{}/data".format(www_path)
+ data_path = "{}/data".format(args.www_path)
versions = {}
def handle_release(target):
versions[release] = "data/{}/overview.json".format(release)
- update_config(config_path, versions)
+ update_config(args.www_path, versions)
"""
def scrape_wget(args):
url = args.domain
- www_path = args.www_path
- config_path = "{}/config.js".format(www_path)
- data_path = "{}/data".format(www_path)
+ data_path = "{}/data".format(args.www_path)
versions = {}
with tempfile.TemporaryDirectory() as tmp_dir:
else:
json.dump(output, outfile, sort_keys=True)
- update_config(config_path, versions)
+ update_config(args.www_path, versions)
"""
def scan(args):
- # firmware selector config
- config_path = "{}/config.js".format(args.www_path)
# the overview.json files are placed here
data_path = "{}/data".format(args.www_path)
versions = {}
else:
json.dump(output, outfile, sort_keys=True)
- update_config(config_path, versions)
+ update_config(args.www_path, versions)
def main():