From b630753e5e5507fa15f9915f0e19b26079e4b56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 31 Oct 2014 23:38:21 +0100 Subject: [PATCH] add 'method' parameter --- gallery_dl/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 122988be..e5e0cb4f 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -2,12 +2,12 @@ import time import requests import html.parser -def safe_request(session, url, *args, **kwargs): +def safe_request(session, url, method="GET", *args, **kwargs): tries = 0 while True: # try to connect to remote source try: - r = session.get(url, *args, **kwargs) + r = session.request(method, url, *args, **kwargs) except requests.exceptions.ConnectionError: tries += 1 time.sleep(1)