forked from nutomic/joinpeertube
add wip instance data generator, plus updated instance data
This commit is contained in:
parent
911a6ea03b
commit
524674f9cc
2 changed files with 82 additions and 26 deletions
40
generate-instances-json.py
Normal file
40
generate-instances-json.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/python3
|
||||
|
||||
import json
|
||||
import requests
|
||||
|
||||
instance_list = ['peertube.social', 'tube.tchncs.de', 'vidcommons.org']
|
||||
|
||||
json_list = []
|
||||
for i in instance_list:
|
||||
r = requests.get('https://' + i + '/api/v1/config')
|
||||
jsonres = r.json()
|
||||
|
||||
data = json.dumps({
|
||||
"id": -1,
|
||||
"host": i,
|
||||
"name": jsonres['instance']['name'],
|
||||
"shortDescription": r.json()['instance']['shortDescription'],
|
||||
"version": jsonres['serverVersion'],
|
||||
"signupAllowed": jsonres['signup']['allowed'],
|
||||
"userVideoQuota": jsonres['user']['videoQuota'],
|
||||
"categories": [],
|
||||
"languages": [],
|
||||
"autoBlacklistUserVideosEnabled": False,
|
||||
"defaultNSFWPolicy": jsonres['instance']['defaultNSFWPolicy'],
|
||||
"isNSFW": jsonres['instance']['isNSFW'],
|
||||
"totalUsers": None,
|
||||
"totalVideos": None,
|
||||
"totalLocalVideos": None,
|
||||
"totalInstanceFollowers": None,
|
||||
"totalInstanceFollowing": None,
|
||||
"health": None,
|
||||
"createdAt": None
|
||||
})
|
||||
json_list.append(data)
|
||||
print(data)
|
||||
|
||||
print("\n\n\n")
|
||||
|
||||
# TODO: need to dump it all as a single list, no idea why this is not working
|
||||
json.dumps(json_list)
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"total": 1,
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"total": 3,
|
||||
"data": [{
|
||||
"id": -1,
|
||||
"host": "peertube.social",
|
||||
"name": "Peertube.social",
|
||||
"shortDescription": "Peertube instance for leftist and non-commercial content. Unlimited uploads (up to 500 MB per day)",
|
||||
|
@ -14,18 +13,37 @@
|
|||
"autoBlacklistUserVideosEnabled": false,
|
||||
"defaultNSFWPolicy": "do_not_list",
|
||||
"isNSFW": false,
|
||||
"totalUsers": 4,
|
||||
"totalVideos": 10282,
|
||||
"totalLocalVideos": 8,
|
||||
"totalInstanceFollowers": 10,
|
||||
"totalInstanceFollowing": 64,
|
||||
"supportsIPv6": true,
|
||||
"country": "US",
|
||||
"health": 100,
|
||||
"createdAt": "2020-02-08T17:52:18.386Z"
|
||||
"totalUsers": null,
|
||||
"totalVideos": null,
|
||||
"totalLocalVideos": null,
|
||||
"totalInstanceFollowers": null,
|
||||
"totalInstanceFollowing": null,
|
||||
"health": null,
|
||||
"createdAt": null
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"id": -1,
|
||||
"host": "tube.tchncs.de",
|
||||
"name": "tchncs",
|
||||
"shortDescription": "PeerTube instance for your unique Vlogs and what not. 😉",
|
||||
"version": "2.0.0",
|
||||
"signupAllowed": false,
|
||||
"userVideoQuota": -1,
|
||||
"categories": [],
|
||||
"languages": [],
|
||||
"autoBlacklistUserVideosEnabled": false,
|
||||
"defaultNSFWPolicy": "do_not_list",
|
||||
"isNSFW": false,
|
||||
"totalUsers": null,
|
||||
"totalVideos": null,
|
||||
"totalLocalVideos": null,
|
||||
"totalInstanceFollowers": null,
|
||||
"totalInstanceFollowing": null,
|
||||
"health": null,
|
||||
"createdAt": null
|
||||
},
|
||||
{
|
||||
"id": -1,
|
||||
"host": "vidcommons.org",
|
||||
"name": "The VidCommons Project",
|
||||
"shortDescription": "A PeerTube instance dedicated to media licensed under the Creative Commons and Public Domain.",
|
||||
|
@ -37,15 +55,13 @@
|
|||
"autoBlacklistUserVideosEnabled": false,
|
||||
"defaultNSFWPolicy": "do_not_list",
|
||||
"isNSFW": false,
|
||||
"totalUsers": 4,
|
||||
"totalVideos": 10282,
|
||||
"totalLocalVideos": 8,
|
||||
"totalInstanceFollowers": 10,
|
||||
"totalInstanceFollowing": 64,
|
||||
"supportsIPv6": true,
|
||||
"country": "US",
|
||||
"health": 100,
|
||||
"createdAt": "2020-02-08T17:52:18.386Z"
|
||||
"totalUsers": null,
|
||||
"totalVideos": null,
|
||||
"totalLocalVideos": null,
|
||||
"totalInstanceFollowers": null,
|
||||
"totalInstanceFollowing": null,
|
||||
"health": null,
|
||||
"createdAt": null
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue