[reddit] support comment share link (#8434)
This commit is contained in:
@@ -317,8 +317,8 @@ class RedditSubmissionExtractor(RedditExtractor):
|
|||||||
"""Extractor for URLs from a submission on reddit.com"""
|
"""Extractor for URLs from a submission on reddit.com"""
|
||||||
subcategory = "submission"
|
subcategory = "submission"
|
||||||
pattern = (r"(?:https?://)?(?:"
|
pattern = (r"(?:https?://)?(?:"
|
||||||
r"(?:\w+\.)?reddit\.com/(?:(?:r|u|user)/[^/?#]+"
|
r"(?:\w+\.)?reddit\.com/(?:(?:(?:r|u|user)/[^/?#]+/)?"
|
||||||
r"/comments|gallery)|redd\.it)/([a-z0-9]+)")
|
r"comments|gallery)|redd\.it)/([a-z0-9]+)")
|
||||||
example = "https://www.reddit.com/r/SUBREDDIT/comments/id/"
|
example = "https://www.reddit.com/r/SUBREDDIT/comments/id/"
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
|
|||||||
@@ -179,6 +179,15 @@ __tests__ = (
|
|||||||
"#count" : 0,
|
"#count" : 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://www.reddit.com/comments/1nz2ic5",
|
||||||
|
"#comment" : "comment share URL",
|
||||||
|
"#category": ("", "reddit", "submission"),
|
||||||
|
"#class" : reddit.RedditSubmissionExtractor,
|
||||||
|
"#pattern" : r"https://i\.redd\.it/\w+\.png",
|
||||||
|
"#count" : 2,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://www.reddit.com/r/RobloxArt/comments/15ko0qu/",
|
"#url" : "https://www.reddit.com/r/RobloxArt/comments/15ko0qu/",
|
||||||
"#comment" : "comment embeds (#5366)",
|
"#comment" : "comment embeds (#5366)",
|
||||||
|
|||||||
Reference in New Issue
Block a user