Page 1 of 1

fetch where the site employs redirect

Posted: Tue May 30, 2017 1:57 pm
by LincolnG
I need to use a scheduled script for renewing my ip address with Getflix. The code I'm using is

/tool fetch url="https://www.getflix.com.au/api/helper/i ... t-tell-you" dst-path="/getflix.txt" mode=https

However the code doesn't work and when I put it manually into the console it returns this error.

status: failed

failure: closing connection: <302 Found> 149.126.74.241:443 (4)


I have discovered a explanation, which is that the ip address 149.126.74.241 contains a redirect and is not the actual location of the website - apparently the fetch command cannot deal with this.

Does anybody have a script or a mechanism for discovering actually where the page resides before then running the routine or any other ideas ??

Re: fetch where the site employs redirect

Posted: Tue May 30, 2017 9:47 pm
by troffasky
Fetch it with wget and see where the redirect goes, and use that.

Re: fetch where the site employs redirect

Posted: Thu Dec 13, 2018 10:57 am
by ranpha
After mucking around with 'fetch', the below code is what I use to update my current IP with Getflix:-

Code: Select all

/tool fetch mode=https user=replace_this_with_your_API password=x keep-result=no http-method=put url=https://www.getflix.com.au/api/v1/addresses.json
Putting it here so that no one else coming from Bing and Google has to work hard for this.