mirror of
https://github.com/TeamNewPipe/documentation
synced 2025-10-06 00:22:52 +02:00
Add 5 second timeout for http request
This commit is contained in:
@@ -20,7 +20,7 @@ for filename in os.listdir():
|
||||
checkstring = "# " + link.replace("#", "").replace("-", " ")
|
||||
if not checkstring in filedata.lower():
|
||||
RETURN_VALUE = 1
|
||||
print(filename + ": Could not find target for" + link)
|
||||
print(filename + ": Could not find target for " + link)
|
||||
else:
|
||||
if link.startswith("img/"):
|
||||
link = BASE_URL + "/" + link
|
||||
@@ -31,7 +31,7 @@ for filename in os.listdir():
|
||||
RETURN_VALUE = 1
|
||||
print(filename + ": " + link + " is not https")
|
||||
else:
|
||||
res = requests.get(link)
|
||||
res = requests.get(link, timeout=5)
|
||||
if res.status_code != 200:
|
||||
RETURN_VALUE = 1
|
||||
print(filename + ": " + link + " returns " + str(res.status_code))
|
||||
|
Reference in New Issue
Block a user