I'm trying to check if some file links are up or not. I've tried with requests library:
import requests
url = 'http://releases.libreelec.tv/LibreELEC-RPi2.arm-9.0.1.img.gz'
print(requests.get(url).status_code)
And also with httplib2:
import httplib2
url = 'http://releases.libreelec.tv/LibreELEC-RPi2.arm-9.0.1.img.gz'
http = httplib2.Http()
resp = http.request(url)[0]
print(resp.status)
As the link is good.. it takes too long (I've never waited it to finish) to return a '200' status code. It works fine for forbidden (403) code. The point is i need it to be fast.