Made peertube instance list use cache if it fails
This commit is contained in:
parent
c0b93130f0
commit
3bd83642f3
|
@ -442,16 +442,19 @@ def breezeWiki():
|
||||||
|
|
||||||
|
|
||||||
def peertube():
|
def peertube():
|
||||||
r = requests.get(
|
try:
|
||||||
'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt')
|
r = requests.get(
|
||||||
rJson = json.loads(r.text)
|
'https://instances.joinpeertube.org/api/v1/instances?start=0&count=1045&sort=-createdAt')
|
||||||
|
rJson = json.loads(r.text)
|
||||||
|
|
||||||
myList = ['https://search.joinpeertube.org']
|
myList = ['https://search.joinpeertube.org']
|
||||||
for k in rJson['data']:
|
for k in rJson['data']:
|
||||||
myList.append('https://'+k['host'])
|
myList.append('https://'+k['host'])
|
||||||
|
|
||||||
mightyList['peertube'] = myList
|
mightyList['peertube'] = myList
|
||||||
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'PeerTube')
|
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'PeerTube')
|
||||||
|
except Exception:
|
||||||
|
fetchCache('peertube', 'PeerTube')
|
||||||
|
|
||||||
|
|
||||||
def isValid(url): # This code is contributed by avanitrachhadiya2155
|
def isValid(url): # This code is contributed by avanitrachhadiya2155
|
||||||
|
|
Loading…
Reference in New Issue