Skip to content

Commit

Permalink
[pillowfort] add 'reblogs' option (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 25, 2021
1 parent 7ca3bf7 commit cdb0b02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,16 @@ Description
Download subalbums.


extractor.pillowfort.reblogs
----------------------------
Type
``bool``
Default
``false``
Description
Extract media from reblogged posts.


extractor.pinterest.sections
----------------------------
Type
Expand Down
8 changes: 6 additions & 2 deletions gallery_dl/extractor/pillowfort.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ class PillowfortExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.item = match.group(1)
self.reblogs = self.config("reblogs", False)

def items(self):
for post in self.posts():

if "original_post" in post and not self.reblogs:
continue

files = post["media"]
del post["media"]

Expand Down Expand Up @@ -112,8 +116,8 @@ class PillowfortUserExtractor(PillowfortExtractor):
pattern = BASE_PATTERN + r"/(?!posts/)([^/?#]+)"
test = ("https://www.pillowfort.social/Pome", {
"pattern": r"https://img\d+\.pillowfort\.social/posts/",
"range": "1-25",
"count": 25,
"range": "1-15",
"count": 15,
})

def posts(self):
Expand Down

0 comments on commit cdb0b02

Please sign in to comment.