stupid piped sys admin didnt renew certs on time
This commit is contained in:
parent
e87afb4e97
commit
35abc04c72
|
@ -13,6 +13,7 @@
|
|||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"express-ws": "^5.0.2",
|
||||
"https": "^1.0.0",
|
||||
"ioredis": "^5.3.1",
|
||||
"isomorphic-dompurify": "^1.0.0",
|
||||
"node-fetch": "2",
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
const fetch = require('node-fetch')
|
||||
const https = require('https')
|
||||
const maxRetries = 5
|
||||
|
||||
const ignoreSsl = new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
})
|
||||
|
||||
async function getInstance() {
|
||||
const instances = await (await fetch('https://api.invidious.io/instances.json?pretty=1', {
|
||||
headers: {
|
||||
|
@ -15,7 +20,8 @@ async function getPipedInstance() {
|
|||
const instances = await (await fetch('https://piped-instances.kavin.rocks/', {
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (compatible; PreserveTube/0.0; +https://preservetube.com)'
|
||||
}
|
||||
},
|
||||
agent: ignoreSsl
|
||||
})).json()
|
||||
return (instances[Math.floor(Math.random() * instances.length)]).api_url
|
||||
}
|
||||
|
|
|
@ -648,6 +648,11 @@ https-proxy-agent@^5.0.1:
|
|||
agent-base "6"
|
||||
debug "4"
|
||||
|
||||
https@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/https/-/https-1.0.0.tgz#3c37c7ae1a8eeb966904a2ad1e975a194b7ed3a4"
|
||||
integrity sha512-4EC57ddXrkaF0x83Oj8sM6SLQHAWXw90Skqu2M4AEWENZ3F02dFJE/GARA8igO79tcgYqGrD7ae4f5L3um2lgg==
|
||||
|
||||
iconv-lite@0.4.24:
|
||||
version "0.4.24"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
|
||||
|
|
Loading…
Reference in New Issue