shah-deep / final-redirect-url

If a url automatically redirects to another url, this code will give final url after all redirects. For example, get end url from google maps api.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get Final URL after Redirects

If a url automatically redirects to another url, this code will give final url after all redirects.

For example, if you try to get images from google maps api, you get a temporary url that redirects to a static url for the image. This temporary url expires in some time and you need to make a new api call to get the same image (hence you are paying again for the same image and api call).

Codes in this repository call get_final_url function to fetch the final static url after all redirects. You can save this url in your database and re-use it without the need to make an api call.

Code:

  1. Python
  2. JavaScript
  3. PHP

About

If a url automatically redirects to another url, this code will give final url after all redirects. For example, get end url from google maps api.

License:MIT License


Languages

Language:PHP 62.2%Language:JavaScript 20.6%Language:Python 17.2%