mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-01-04 21:11:31 +00:00
Tor check bug fixes; recognise december blocking
This commit is contained in:
@@ -17,18 +17,18 @@ class TorManager {
|
||||
}
|
||||
|
||||
async request(url, test) {
|
||||
let result = null
|
||||
let done = false
|
||||
let g
|
||||
while (!done) {
|
||||
const req = await request(url, {agent: this.agent}, {log: true, statusLine: "TOR"})
|
||||
g = await request(url, {agent: this.agent}, {log: true, statusLine: "TOR"})
|
||||
try {
|
||||
result = await test(req)
|
||||
done = true
|
||||
await g.check(test)
|
||||
break
|
||||
} catch (e) {
|
||||
await this.newCircuit()
|
||||
}
|
||||
}
|
||||
return result
|
||||
return g
|
||||
}
|
||||
|
||||
newCircuit() {
|
||||
|
||||
Reference in New Issue
Block a user