From 55f048d02b2d3cdaaef1e54a60f45e8737c7fe84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 24 Jul 2017 18:33:42 +0200 Subject: [PATCH] ignore case of cookiejar magic strings --- gallery_dl/extractor/common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 0fa40ef0..b43a2edd 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -9,6 +9,7 @@ """Common classes and constants used by extractor modules.""" import os +import re import time import netrc import queue @@ -186,6 +187,13 @@ def safe_request(session, url, method="GET", *args, **kwargs): return r +# Reduce strictness of the expected magic string in cookie jar files. +# (This allows the use of Wget-generated cookiejar files without modification) + +http.cookiejar.MozillaCookieJar.magic_re = re.compile( + "#( Netscape)? HTTP Cookie File", re.IGNORECASE) + + # The first import of requests happens inside this file. # If we are running on Windows and the from requests expected certificate file # is missing (which happens in a standalone executable from py2exe), the