mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[twitter] add 'hashtag' extractor (#3783)
This commit is contained in:
parent
082d55de16
commit
197882cf12
@ -868,7 +868,7 @@ Consider all sites to be NSFW unless otherwise known.
|
||||
<tr>
|
||||
<td>Twitter</td>
|
||||
<td>https://twitter.com/</td>
|
||||
<td>Avatars, Backgrounds, Bookmarks, Events, individual Images, Likes, Lists, List Members, Media Timelines, Search Results, Timelines, Tweets</td>
|
||||
<td>Avatars, Backgrounds, Bookmarks, Events, Hashtags, individual Images, Likes, Lists, List Members, Media Timelines, Search Results, Timelines, Tweets</td>
|
||||
<td>Supported</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -649,6 +649,21 @@ class TwitterSearchExtractor(TwitterExtractor):
|
||||
return self.api.search_adaptive(query)
|
||||
|
||||
|
||||
class TwitterHashtagExtractor(TwitterExtractor):
|
||||
"""Extractor for Twitter hashtags"""
|
||||
subcategory = "hashtag"
|
||||
pattern = BASE_PATTERN + r"/hashtag/([^/?#]+)"
|
||||
test = ("https://twitter.com/hashtag/nature", {
|
||||
"pattern": TwitterSearchExtractor.pattern,
|
||||
"url": "3571c3a53b7647ea35517041fdc17f77ec5b2cb9",
|
||||
})
|
||||
|
||||
def items(self):
|
||||
url = "{}/search?q=%23{}".format(self.root, self.user)
|
||||
data = {"_extractor": TwitterSearchExtractor}
|
||||
yield Message.Queue, url, data
|
||||
|
||||
|
||||
class TwitterEventExtractor(TwitterExtractor):
|
||||
"""Extractor for Tweets from a Twitter Event"""
|
||||
subcategory = "event"
|
||||
|
Loading…
Reference in New Issue
Block a user