glance icon indicating copy to clipboard operation
glance copied to clipboard

[HELP] request-url-template

Open AlissonSantos95 opened this issue 1 year ago • 6 comments

Hi, i moved from homelab to a VPS but i can't understand how to use the request-url-template option it will always give me some tipe of error like those this way:


- type: reddit
            subreddit: selfhosted
            request-url-template: https://reddit.domain.com.br/

gave me this error : failed parsing config file: no {REQUEST-URL} placeholder specified

this way:


- type: reddit
            subreddit: selfhosted
            request-url-template: https://reddit.domain.com.br/{REQUEST-URL}

gave me this error Get "/https:/www.reddit.com/r/selfhosted/hot.json": stopped after 10 redirects

can you explaying and give-me an exemaple how i should put this?

i'm using a oracle VPS

AlissonSantos95 avatar May 16 '24 13:05 AlissonSantos95

Hey,

Are you trying to use the request-url-template option because Reddit is blocking requests from your VPS or is it that you're trying to change the links to the comments so you can link to your own Reddit front-end? The former will require you to set up an HTTP proxy and then point to it:

request-url-template: https://your-proxy.com/{REQUEST-URL}

The latter is done by using the comments-url-template property:

comments-url-template: https://old.reddit.com/{POST-PATH}

svilenmarkov avatar May 17 '24 16:05 svilenmarkov

Reddit is blocking requests from my VPS, so when i put thisrequest-url-template: https://your-proxy.com/{REQUEST-URL} it give me this error Get "/https:/www.reddit.com/r/selfhosted/hot.json": stopped after 10 redirects

AlissonSantos95 avatar May 17 '24 16:05 AlissonSantos95

Which HTTP proxy are you using and can you confirm that it proxies requests successfully from your VPS?

svilenmarkov avatar May 17 '24 16:05 svilenmarkov

oh i'm using troddit, i need an actuval proxy? i'm confused

AlissonSantos95 avatar May 17 '24 16:05 AlissonSantos95

Yes, you would need to have a reverse proxy that isn't blocked by Reddit which sends the requests on behalf of Glance. Assuming your proxy lives on your home network and your home network isn't publicly accessible, you'd also need to have the VPS and your home network connected to the same VPN. Something like cors-anywhere or nginx can work as the reverse proxy.

All of that looks a little something like this:

reddit-proxy

svilenmarkov avatar May 17 '24 17:05 svilenmarkov

Undertood, i can't host anymore on my house so ok i will go with .rss, thanks

AlissonSantos95 avatar May 18 '24 12:05 AlissonSantos95