Nitter instance bouncing is no longer SAAD
This commit is contained in:
parent
6ddd607da3
commit
d80a69920f
@ -4,15 +4,18 @@ import { createSource, createSourceOptions, extractImages, downloadImages, getPo
|
|||||||
let nitter = {}
|
let nitter = {}
|
||||||
|
|
||||||
export const fetchChannelFromInstances = async (source) => {
|
export const fetchChannelFromInstances = async (source) => {
|
||||||
let index = 0
|
let cachedLinkIndex = source.instances.indexOf(source.cache.link)
|
||||||
let instances = source.instances
|
let index = 0
|
||||||
let cachedLink = source.cache.link
|
let instances
|
||||||
let channel
|
let channel
|
||||||
|
|
||||||
if(cachedLink) {
|
if(cachedLinkIndex !== -1) {
|
||||||
instances.unshift(cachedLink.hostname)
|
instances = source.instances.toSpliced(cachedLinkIndex, 1)
|
||||||
}
|
instances.unshift(source.instances[cachedLinkIndex])
|
||||||
|
} else {
|
||||||
|
instances = [ ...source.instances ]
|
||||||
|
}
|
||||||
|
|
||||||
while(!channel && index != instances.length) {
|
while(!channel && index != instances.length) {
|
||||||
source.hostname = instances[index]
|
source.hostname = instances[index]
|
||||||
channel = await fetchChannel(source)
|
channel = await fetchChannel(source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user