mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-21 18:22:30 +01:00
add 'method' parameter
This commit is contained in:
parent
7588974306
commit
b630753e5e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user