diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index f4abc7a6..01153116 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2025 Mike Fährmann +# Copyright 2015-2026 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -634,7 +634,8 @@ class DeviantartGalleryExtractor(DeviantartExtractor): subcategory = "gallery" archive_fmt = "g_{_username}_{index}.{extension}" pattern = (BASE_PATTERN + r"/gallery" - r"(?:/all|/recommended-for-you)?/?(\?(?!q=).*)?$") + r"(?:/all|/recommended-for-you)?" + r"/?(\?(?!q=|catpath=scraps).*)?$") example = "https://www.deviantart.com/USER/gallery/" def deviations(self): diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index 83f01b64..e731c841 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2017-2025 Mike Fährmann +# Copyright 2017-2026 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -305,7 +305,7 @@ class RedditUserExtractor(RedditExtractor): subcategory = "user" directory_fmt = ("{category}", "Users", "{user[name]}") pattern = (r"(?:https?://)?(?:\w+\.)?reddit\.com/u(?:ser)?/" - r"([^/?#]+)(/[a-z]+)?/?(?:\?([^#]*))?") + r"([^/?#]+)(/[a-z]+)?/?(?:\?([^#]*))?$") example = "https://www.reddit.com/user/USER/" def __init__(self, match): diff --git a/test/test_extractor.py b/test/test_extractor.py index 25c0aee7..4ade9b71 100644 --- a/test/test_extractor.py +++ b/test/test_extractor.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2018-2025 Mike Fährmann +# Copyright 2018-2026 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -119,12 +119,14 @@ class TestExtractorModule(unittest.TestCase): try: extr = cls.from_url(url) + find = extractor.find(url) except ImportError as exc: if exc.name in ("youtube_dl", "yt_dlp"): return sys.stdout.write( f"Skipping '{cls.category}' category checks\n") raise self.assertTrue(extr, url) + self.assertIs(extr.__class__, find.__class__, url) categories = result.get("#category") if categories: