mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-17 18:58:33 +00:00
actually fix dynamic URL reference for reddit/twitter
This commit is contained in:
parent
197c1dc0e6
commit
56be4ece8c
@ -22,6 +22,9 @@ async function getAccessToken() {
|
|||||||
|| Number(values.expiry) > new Date().getTime();
|
|| Number(values.expiry) > new Date().getTime();
|
||||||
if (!needRefresh) return values.access_token;
|
if (!needRefresh) return values.access_token;
|
||||||
|
|
||||||
|
let redditURL = "reddit.com";
|
||||||
|
if (global.torEnabled) redditURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion";
|
||||||
|
|
||||||
const data = await fetch(`https://www.${redditURL}/api/v1/access_token`, {
|
const data = await fetch(`https://www.${redditURL}/api/v1/access_token`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@ -49,11 +52,8 @@ async function getAccessToken() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function(obj) {
|
export default async function(obj) {
|
||||||
let redditURL;
|
let redditURL = "reddit.com";
|
||||||
let regularURL = "reddit.com";
|
if (global.torEnabled) redditURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion";
|
||||||
let torURL = "reddittorjg6rue252oqsxryoxengawnmo46qy4kyii5wtqnwfj4ooad.onion";
|
|
||||||
redditURL = regularURL;
|
|
||||||
if (global.torEnabled) redditURL = torURL;
|
|
||||||
|
|
||||||
let twitterDispatcher;
|
let twitterDispatcher;
|
||||||
twitterDispatcher = false;
|
twitterDispatcher = false;
|
||||||
|
@ -6,11 +6,8 @@ function bestQuality(arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default async function(obj) {
|
export default async function(obj) {
|
||||||
let twitterURL;
|
let twitterURL = "twitter.com";
|
||||||
let regularURL = "twitter.com";
|
if (global.torEnabled) twitterURL = "twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion";
|
||||||
let torURL = "twitter3e4tixl4xyajtrzo62zg5vztmjuricljdp2c5kshju4avyoid.onion";
|
|
||||||
twitterURL = regularURL;
|
|
||||||
if (global.torEnabled) twitterURL = torURL;
|
|
||||||
|
|
||||||
let twitterDispatcher;
|
let twitterDispatcher;
|
||||||
twitterDispatcher = false;
|
twitterDispatcher = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user