forked from QuarkSources/quarksources.github.io
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAltSourceToScarlet.py
55 lines (49 loc) · 1.53 KB
/
AltSourceToScarlet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import json
# Open the file
with open("wuxu-complete-plus.json", "r") as f:
data = json.load(f)
# Convert each app's data to the new format
new_apps = []
for app in data["apps"]:
new_app = {
"name": app["name"],
"version": app["version"],
"down": app["downloadURL"],
"dev": app["developerName"],
"icon": app["iconURL"],
"category": "category",
"changelog": app["versionDescription"],
"description": app["localizedDescription"],
"bundleID": app["bundleIdentifier"],
"appstore": app["bundleIdentifier"],
"screenshots": app["screenshotURLs"],
"contact": {
"web": "https://bit.ly/wuxus-sources",
"discord": "https://bit.ly/wuxuslibrary-discord"
}
}
# Add the contact information
if app["developerName"] == "Cool developer name":
new_app["contact"]["web"] = "https://cooldeveloper.com"
new_app["contact"]["twitter"] = "https://twitter.com/cooldeveloper"
new_apps.append(new_app)
# Create the new data object
new_data = {
"name": data["name"],
"version": "1.0",
"down": "",
"dev": "Cool developer name",
"icon": "",
"category": "category",
"description": "",
"bundleID": data["identifier"],
"screenshots": [],
"contact": {
"web": "https://cooldeveloper.com",
"twitter": "https://twitter.com/cooldeveloper"
},
"apps": new_apps
}
# Write the new data to a file
with open("wuxu-complete-scarlet-updated.json", "w") as f:
json.dump(new_data, f)