disable urllib3s InsecureConnectionWarning

This commit is contained in:
Mike Fährmann
2017-02-11 21:01:31 +01:00
parent bad623751f
commit 0b59d9f8c7
2 changed files with 4 additions and 2 deletions

View File

@@ -107,9 +107,11 @@ def safe_request(session, url, method="GET", *args, **kwargs):
if os.name == "nt":
import os.path
import requests.certs
import requests.packages.urllib3 as ulib3
if not os.path.isfile(requests.certs.where()):
def patched_init(self):
session_init(self)
self.verify = False
session_init = requests.Session.__init__
requests.Session.__init__ = patched_init
ulib3.disable_warnings(ulib3.exceptions.InsecureRequestWarning)

View File

@@ -257,9 +257,9 @@ class ImgcandyImageExtractor(ImagehostImageExtractor):
category = "imgcandy"
pattern = [(r"(?:https?://)?((?:www\.)?imgcandy\.net/img-([a-z0-9]+)"
r"(?:_.+)?\.html)")]
test = [("http://imgcandy.net/img-57d02527efee8_test-テスト.png.html", {
test = [("http://imgcandy.net/img-57d02527efee8_test.png.html", {
"url": "bc3c9207b10dbfe8e65ccef5b9e3194a7427b4fa",
"keyword": "1ed1587ef38a6b26ce28b35857a78417239d197a",
"keyword": "6482e58492e65fcc6d6622ecc2fb19f9d35ff18b",
"content": "0c8768055e4e20e7c7259608b67799171b691140",
})]