Last active
January 14, 2023 15:59
-
-
Save jneilliii/61478a04a1cdaa96ae89549b46de27b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
import subprocess | |
# path to file extracted from backup or exported from plugin manager | |
plugin_list = "C:/Users/jneil/Downloads/backup_test/plugin_list.json" | |
# load master plugin list. | |
master_plugin_list = requests.get("https://plugins.octoprint.org/plugins.json").json() | |
# load plugins from backup file | |
with open(plugin_list) as file: | |
plugins = json.load(file) | |
# loop through master plugin list and if it was in the backup file install it | |
for plugin in master_plugin_list: | |
if any(map(lambda r: r["key"] == plugin["id"], plugins)): | |
print("Installing {}".format(plugin["title"])) | |
subprocess.run(["pip", "install", plugin["archive"]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment