def FollowRedirectGetHttpStatus(url): try: response = redirect_follower.GetRedirect(url,global_request_timeout) if response <> None: resp = str(response.getcode()) except: resp = '0' if Prefs['debug']: Log(url +' : HTTPResponse = '+ resp) return resp
def FollowRedirectGetHttpStatus(url, timeout=global_request_timeout): try: response = redirect_follower.GetRedirect(url, timeout) if response <> None: resp = str(response.getcode()) except Exception as e: resp = '0' if Prefs['debug']: Log('Error common_fnc.py > FollowRedirectGetHttpStatus: ' + str(e)) Log(url + ' : HTTPResponse = ' + resp) return resp
def GetRedirectingUrl(url): #Log("Url ----- : " + url) redirectUrl = url try: response = redirect_follower.GetRedirect(url, 7) if response <> None: return response.geturl() except: redirectUrl = url Log("Redirecting url ----- : " + redirectUrl) return redirectUrl
def GetRedirectingUrl(url): #Log("Url ----- : " + url) redirectUrl = url try: response = redirect_follower.GetRedirect(url, global_request_timeout) if response <> None: return response.geturl() except: redirectUrl = url #Log("Redirecting url ----- : " + redirectUrl) return redirectUrl