mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
add 'downloader.http.verify' option
(also: change the default 'timeout' from None to 30)
This commit is contained in:
parent
65997d835b
commit
b8862ff15e
@ -105,12 +105,27 @@ downloader.http.timeout
|
||||
-----------------------
|
||||
=========== =====
|
||||
Type ``float`` or ``null``
|
||||
Default ``null``
|
||||
Default ``30``
|
||||
Description Amount of time (in seconds) to wait for a successful connection
|
||||
and a response from a remote server.
|
||||
and response from a remote server.
|
||||
|
||||
This value gets internally used as the ``timeout`` parameter for the
|
||||
|requests.get()|_ method.
|
||||
This value gets internally used as the |timeout|_ parameter for the
|
||||
|requests.request()|_ method during downloads.
|
||||
=========== =====
|
||||
|
||||
|
||||
downloader.http.verify
|
||||
----------------------
|
||||
=========== =====
|
||||
Type ``bool`` or ``string``
|
||||
Default ``true``
|
||||
Description Controls whether to verify SSL/TLS certificates for HTTPS requests.
|
||||
|
||||
If this is a ``string``, it must be the path to a CA bundle to use
|
||||
instead of the default certificates.
|
||||
|
||||
This value gets internally used as the |verify|_ parameter for the
|
||||
|requests.request()|_ method during downloads.
|
||||
=========== =====
|
||||
|
||||
|
||||
@ -302,7 +317,7 @@ Type ``float``
|
||||
Default ``3.0``
|
||||
Description Minimum wait time in seconds between each image
|
||||
|
||||
Exhentai detects and blocks automated downloaders.
|
||||
ExHentai detects and blocks automated downloaders.
|
||||
``gallery-dl`` waits a randomly selected number of
|
||||
seconds between ``wait-min`` and ``wait-max`` after
|
||||
each image to prevent getting blocked.
|
||||
@ -380,7 +395,7 @@ extractor.imgur.mp4
|
||||
=========== =====
|
||||
Type ``bool`` or ``string``
|
||||
Default ``true``
|
||||
Description Controls whether to choose the GIF or MP4 version of an animation
|
||||
Description Controls whether to choose the GIF or MP4 version of an animation.
|
||||
|
||||
* ``true``: Follow Imgur's advice and choose MP4 if the
|
||||
``prefer_video`` flag in an image's metadata is set.
|
||||
@ -538,7 +553,9 @@ Description The ``refresh_token`` value you get from linking your Reddit account
|
||||
|
||||
.. |.netrc| replace:: ``.netrc``
|
||||
.. |tempfile.gettempdir()| replace:: ``tempfile.gettempdir()``
|
||||
.. |requests.get()| replace:: ``requests.get()``
|
||||
.. |requests.request()| replace:: ``requests.request()``
|
||||
.. |timeout| replace:: ``timeout``
|
||||
.. |verify| replace:: ``verify``
|
||||
.. |mature_content| replace:: ``mature_content``
|
||||
.. |webbrowser.open()| replace:: ``webbrowser.open()``
|
||||
.. |datetime.max| replace:: ``datetime.max``
|
||||
@ -550,7 +567,9 @@ Description The ``refresh_token`` value you get from linking your Reddit account
|
||||
|
||||
.. _.netrc: https://stackoverflow.com/tags/.netrc/info
|
||||
.. _tempfile.gettempdir(): https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir
|
||||
.. _requests.get(): https://docs.python-requests.org/en/latest/user/advanced/#timeouts
|
||||
.. _requests.request(): https://docs.python-requests.org/en/master/api/#requests.request
|
||||
.. _timeout: https://docs.python-requests.org/en/latest/user/advanced/#timeouts
|
||||
.. _verify: https://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
|
||||
.. _format string: https://docs.python.org/3/library/string.html#formatstrings
|
||||
.. _format strings: https://docs.python.org/3/library/string.html#formatstrings
|
||||
.. _strptime: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior
|
||||
|
@ -6,7 +6,8 @@
|
||||
"http":
|
||||
{
|
||||
"retries": 5,
|
||||
"timeout": null
|
||||
"timeout": 30,
|
||||
"verify": true
|
||||
}
|
||||
},
|
||||
"extractor":
|
||||
@ -36,7 +37,12 @@
|
||||
"wait-max": 6,
|
||||
"original": true,
|
||||
"username": null,
|
||||
"password": null
|
||||
"password": null,
|
||||
"cookies": {
|
||||
"igneous": null,
|
||||
"s": null,
|
||||
"yay": "louder"
|
||||
}
|
||||
},
|
||||
"nijie":
|
||||
{
|
||||
|
@ -21,7 +21,8 @@ log = logging.getLogger("http")
|
||||
class Downloader(BasicDownloader):
|
||||
|
||||
retries = config.interpolate(("downloader", "http", "retries",), 5)
|
||||
timeout = config.interpolate(("downloader", "http", "timeout",), None)
|
||||
timeout = config.interpolate(("downloader", "http", "timeout",), 30)
|
||||
verify = config.interpolate(("downloader", "http", "verify",), True)
|
||||
|
||||
def __init__(self, session, output):
|
||||
BasicDownloader.__init__(self)
|
||||
@ -42,7 +43,7 @@ class Downloader(BasicDownloader):
|
||||
# try to connect to remote source
|
||||
try:
|
||||
response = self.session.get(
|
||||
url, stream=True, timeout=self.timeout
|
||||
url, stream=True, timeout=self.timeout, verify=self.verify,
|
||||
)
|
||||
except (rexcepts.ConnectionError, rexcepts.Timeout) as exception:
|
||||
msg = exception
|
||||
|
Loading…
Reference in New Issue
Block a user