Added ability to download GIFs instead of mp4 from Luscious and Reactor (#1701)
This commit is contained in:
@@ -28,6 +28,7 @@ class ReactorExtractor(Extractor):
|
||||
Extractor.__init__(self, match)
|
||||
self.root = "http://" + match.group(1)
|
||||
self.session.headers["Referer"] = self.root
|
||||
self.gif = self.config("gif", False)
|
||||
|
||||
if not self.category:
|
||||
# set category based on domain name
|
||||
@@ -124,6 +125,12 @@ class ReactorExtractor(Extractor):
|
||||
elif "/post/webm/" not in url and "/post/mp4/" not in url:
|
||||
url = url.replace("/post/", "/post/full/")
|
||||
|
||||
if self.gif and ("/post/webm/" in url or "/post/mp4/" in url):
|
||||
gif_url = text.extract(image, '<a href="', '"')[0]
|
||||
if not gif_url:
|
||||
continue
|
||||
url = gif_url
|
||||
|
||||
yield {
|
||||
"url": url,
|
||||
"post_id": post_id,
|
||||
|
||||
Reference in New Issue
Block a user