mirror of https://github.com/FreeTubeApp/FreeTube
use fetchWithTimeout for piped instances
This commit is contained in:
parent
ab6bcc023b
commit
f9b791e8f6
|
@ -151,14 +151,17 @@ export default defineComponent({
|
|||
this.grabUserSettings().then(async () => {
|
||||
this.checkThemeSettings()
|
||||
|
||||
await this.fetchInvidiousInstances()
|
||||
await Promise.allSettled([
|
||||
this.fetchInvidiousInstances(),
|
||||
this.fetchPipedInstances()
|
||||
])
|
||||
|
||||
if (this.defaultInvidiousInstance === '') {
|
||||
await this.setRandomCurrentInvidiousInstance()
|
||||
this.setRandomCurrentInvidiousInstance()
|
||||
}
|
||||
|
||||
await this.fetchPipedInstances()
|
||||
if (this.defaultPipedInstance === '') {
|
||||
await this.setRandomCurrentPipedInstance()
|
||||
this.setRandomCurrentPipedInstance()
|
||||
}
|
||||
|
||||
this.grabAllProfiles(this.$t('Profile.All Channels')).then(async () => {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import fs from 'fs/promises'
|
||||
import { pathExists } from '../../helpers/filesystem'
|
||||
import { fetchWithTimeout } from '../../helpers/utils'
|
||||
|
||||
const state = {
|
||||
currentPipedInstance: '',
|
||||
|
@ -22,7 +23,7 @@ const actions = {
|
|||
|
||||
let instances = []
|
||||
try {
|
||||
const response = await (await fetch(requestUrl)).json()
|
||||
const response = await (await fetchWithTimeout(15_000, requestUrl)).json()
|
||||
instances = response.map(instance => instance.api_url)
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
[
|
||||
"https://pipedapi.kavin.rocks",
|
||||
"https://api-piped.mha.fi",
|
||||
"https://piped-api.lunar.icu",
|
||||
"https://piped-api.garudalinux.org",
|
||||
"https://pipedapi.leptons.xyz",
|
||||
"https://ytapi.dc09.ru",
|
||||
"https://pa.il.ax",
|
||||
"https://piped-api.game.yt",
|
||||
"https://pipedapi-libre.kavin.rocks",
|
||||
"https://api.piped.projectsegfau.lt",
|
||||
"https://pipedapi.in.projectsegfau.lt",
|
||||
"https://pipedapi.us.projectsegfau.lt",
|
||||
"https://pipedapi.smnz.de",
|
||||
"https://pipedapi.astartes.nl",
|
||||
"https://pipedapi.simpleprivacy.fr",
|
||||
"https://api.piped.privacydev.net",
|
||||
"https://pipedapi.adminforge.de",
|
||||
"https://pipedapi.osphost.fi",
|
||||
"https://pipedapi.drgns.space",
|
||||
"https://pipedapi.owo.si"
|
||||
"https://piped-backend.seitan-ayoub.lol"
|
||||
]
|
Loading…
Reference in New Issue