Skip to content

Commit

Permalink
[slickpic] add user extractor (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jun 14, 2019
1 parent 97ef416 commit ec3e860
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/supportedsites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Sen Manga https://raw.senmanga.com/ Chapters
Sense-Scans http://sensescans.com/reader/ Chapters, Manga
Sex.com https://www.sex.com/ Boards, Pins, Search Results
Simply Hentai https://www.simply-hentai.com/ Galleries, individual Images, Videos
SlickPic https://www.slickpic.com// Albums
SlickPic https://www.slickpic.com/ Images from Users, Albums
SlideShare https://www.slideshare.net/ Presentations
SmugMug https://www.smugmug.com/ |smugmug-C| Optional (OAuth)
The /b/ Archive https://thebarchive.com/ Threads
Expand Down
21 changes: 21 additions & 0 deletions gallery_dl/extractor/slickpic.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,24 @@ def images(self, data):
"whq" : "1",
}
return self.request(url, method="POST", data=data).json()["list"]


class SlickpicUserExtractor(SlickpicExtractor):
subcategory = "user"
pattern = BASE_PATTERN + r"(?:/gallery)?/?(?:$|[?#])"
test = (
("https://mattcrandall.slickpic.com/gallery/", {
"count": ">= 358",
"pattern": SlickpicAlbumExtractor.pattern,
}),
("https://mattcrandall.slickpic.com/"),
)

def items(self):
page = self.request(self.root + "/gallery?viewer").text
data = {"_extractor": SlickpicAlbumExtractor}
base = self.root + "/albums/"

yield Message.Version, 1
for album in text.extract_iter(page, 'href="' + base, '"'):
yield Message.Queue, base + album, data

0 comments on commit ec3e860

Please sign in to comment.