diff options
| author | 2022-02-14 17:17:07 -0500 | |
|---|---|---|
| committer | 2022-02-14 17:17:07 -0500 | |
| commit | 7900ee4e3692dbd8056c3e47c81bb22eda030b65 (patch) | |
| tree | 54d10ca35e4b8538d2c61470490642b660e2ae77 /gallery_dl/extractor/reddit.py | |
| parent | 99bc014c924c755f10a4a930b1a83efabd84fde1 (diff) | |
New upstream version 1.20.5.upstream/1.20.5
Diffstat (limited to 'gallery_dl/extractor/reddit.py')
| -rw-r--r-- | gallery_dl/extractor/reddit.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index f7809de..01538bf 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -172,7 +172,7 @@ class RedditUserExtractor(RedditExtractor): """Extractor for URLs from posts by a reddit user""" subcategory = "user" pattern = (r"(?:https?://)?(?:\w+\.)?reddit\.com/u(?:ser)?/" - r"([^/?#]+(?:/([a-z]+))?)/?(?:\?([^#]*))?") + r"([^/?#]+(?:/([a-z]+))?)/?(?:\?([^#]*))?$") test = ( ("https://www.reddit.com/user/username/", { "count": ">= 2", @@ -197,8 +197,8 @@ class RedditSubmissionExtractor(RedditExtractor): """Extractor for URLs from a submission on reddit.com""" subcategory = "submission" pattern = (r"(?:https?://)?(?:" - r"(?:\w+\.)?reddit\.com/(?:r/[^/?#]+/comments|gallery)" - r"|redd\.it)/([a-z0-9]+)") + r"(?:\w+\.)?reddit\.com/(?:(?:r|u|user)/[^/?#]+" + r"/comments|gallery)|redd\.it)/([a-z0-9]+)") test = ( ("https://www.reddit.com/r/lavaporn/comments/8cqhub/", { "pattern": r"https://c2.staticflickr.com/8/7272/\w+_k.jpg", @@ -235,6 +235,10 @@ class RedditSubmissionExtractor(RedditExtractor): ("https://np.reddit.com/r/lavaporn/comments/2a00np/"), ("https://m.reddit.com/r/lavaporn/comments/2a00np/"), ("https://redd.it/2a00np/"), + ("https://www.reddit.com/user/TheSpiritTree/comments/srilyf/", { + "pattern": r"https://i.redd.it/8fpgv17yqlh81.jpg", + "count": 1, + }), ) def __init__(self, match): |
