Community discussions

MikroTik App
 
User avatar
LincolnG
newbie
Topic Author
Posts: 26
Joined: Mon Dec 21, 2015 11:02 pm
Location: Catalunya

fetch where the site employs redirect

Tue May 30, 2017 1:57 pm

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 ??
 
troffasky
Member
Member
Posts: 436
Joined: Wed Mar 26, 2014 4:37 pm

Re: fetch where the site employs redirect

Tue May 30, 2017 9:47 pm

Fetch it with wget and see where the redirect goes, and use that.
 
ranpha
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Mon Jan 09, 2012 3:16 am

Re: fetch where the site employs redirect

Thu Dec 13, 2018 10:57 am

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.

Who is online

Users browsing this forum: No registered users and 11 guests