diff options
| author | 2025-04-27 20:34:15 -0400 | |
|---|---|---|
| committer | 2025-04-27 20:34:15 -0400 | |
| commit | 3a12d48ab86c807fc29282e2bffea8a04bbb383b (patch) | |
| tree | 12829c0d6af8ce582f51f9b9dacc901bb60dff16 /gallery_dl/extractor/common.py | |
| parent | 791ab4bb3cdc72367f676a128b4c6ecd16470b4b (diff) | |
| parent | 4a18b5837c1dd82f5964afcfc3fecc53cd97e79c (diff) | |
Update upstream source from tag 'upstream/1.29.5'
Update to upstream version '1.29.5'
with Debian dir c46551cee05d39267f14cbe436ddc25833683f54
Diffstat (limited to 'gallery_dl/extractor/common.py')
| -rw-r--r-- | gallery_dl/extractor/common.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 995505f..c430ec1 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -59,7 +59,7 @@ class Extractor(): @classmethod def from_url(cls, url): if isinstance(cls.pattern, str): - cls.pattern = re.compile(cls.pattern) + cls.pattern = util.re_compile(cls.pattern) match = cls.pattern.match(url) return cls(match) if match else None @@ -240,6 +240,11 @@ class Extractor(): raise exception.HttpError(msg, response) + def request_location(self, url, **kwargs): + kwargs.setdefault("method", "HEAD") + kwargs.setdefault("allow_redirects", False) + return self.request(url, **kwargs).headers.get("location", "") + _handle_429 = util.false def wait(self, seconds=None, until=None, adjust=1.0, |
