Skip to content

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

Notifications You must be signed in to change notification settings

shah-deep/final-redirect-url

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks