Skip to content

Commit

Permalink
[joyreactor] add extractor for search results (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 3, 2019
1 parent a303efb commit a36f52a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 10 deletions.
18 changes: 10 additions & 8 deletions docs/supportedsites.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ imgth https://imgth.com/ Galleries
imgur https://imgur.com/ Albums, individual Images
Instagram https://www.instagram.com/ Images from Users, individual Images
Jaimini's Box https://jaiminisbox.com/ Chapters, Manga
Joyreactor http://joyreactor.cc/ Images from Users, Posts, Tag-Searches
Joyreactor http://joyreactor.cc/ |Capabilities-4|
Khinsider https://downloads.khinsider.com/ Soundtracks
Kirei Cake https://reader.kireicake.com/ Chapters, Manga
KissManga http://kissmanga.com/ Chapters, Manga
Expand All @@ -59,13 +59,13 @@ Newgrounds https://www.newgrounds.com/ Images from Users, indi
Ngomik http://ngomik.in/ Chapters
nhentai https://nhentai.net/ Galleries, Search Results
Niconico Seiga http://seiga.nicovideo.jp Images from Users, individual Images Required
nijie https://nijie.info/ |Capabilities-4| Required
nijie https://nijie.info/ |Capabilities-5| Required
Nyafuu Archive https://archive.nyafuu.org/ Threads
Pawoo https://pawoo.net Images from Users, Images from Statuses
Piczel https://piczel.tv/ Images from Users, Folders, individual Images
Pinterest https://www.pinterest.com Boards, Pins, pin.it Links, related Pins
Pixiv https://www.pixiv.net/ |Capabilities-5| Required
Pornreactor http://pornreactor.cc/ Images from Users, Posts, Tag-Searches
Pixiv https://www.pixiv.net/ |Capabilities-6| Required
Pornreactor http://pornreactor.cc/ |Capabilities-7|
PowerManga https://powermanga.org/ Chapters, Manga
Read Comic Online http://readcomiconline.to/ Comic-Issues, Comics
RebeccaBlackTech https://rbt.asia/ Threads
Expand All @@ -79,7 +79,7 @@ Sen Manga http://raw.senmanga.com/ Chapters
Sense-Scans http://sensescans.com/ Chapters, Manga
Simply Hentai https://www.simply-hentai.com/ Galleries, individual Images, Videos
SlideShare https://www.slideshare.net/ Presentations
SmugMug https://www.smugmug.com/ |Capabilities-6| Optional (OAuth)
SmugMug https://www.smugmug.com/ |Capabilities-8| Optional (OAuth)
The /b/ Archive https://thebarchive.com/ Threads
Tumblr https://www.tumblr.com/ Images from Users, Likes, Posts, Tag-Searches Optional (OAuth)
Twitter https://twitter.com/ Media Timelines, Timelines, Tweets
Expand All @@ -104,6 +104,8 @@ Turboimagehost https://turboimagehost.com/ individual Images
.. |Capabilities-1| replace:: Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Sta.sh
.. |Capabilities-2| replace:: Images from Users, Albums, Favorites, Galleries, Groups, individual Images, Search Results
.. |Capabilities-3| replace:: Images from Users, Favorites, individual Images, Popular Images, Recent Images, Scraps
.. |Capabilities-4| replace:: Images from Users, Doujin, Favorites, individual Images
.. |Capabilities-5| replace:: Images from Users, Favorites, Follows, pixiv.me Links, Rankings, Search Results, Individual Images
.. |Capabilities-6| replace:: Albums, individual Images, Images from Users and Folders
.. |Capabilities-4| replace:: Images from Users, Posts, Search Results, Tag-Searches
.. |Capabilities-5| replace:: Images from Users, Doujin, Favorites, individual Images
.. |Capabilities-6| replace:: Images from Users, Favorites, Follows, pixiv.me Links, Rankings, Search Results, Individual Images
.. |Capabilities-7| replace:: Images from Users, Posts, Search Results, Tag-Searches
.. |Capabilities-8| replace:: Albums, individual Images, Images from Users and Folders
18 changes: 17 additions & 1 deletion gallery_dl/extractor/joyreactor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2018 Mike Fährmann
# Copyright 2018-2019 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -138,6 +138,22 @@ def metadata(self):
return {"search_tags": text.unescape(self.tag).replace("+", " ")}


class JoyreactorSearchExtractor(JoyreactorTagExtractor):
"""Extractor for search results on joyreactor.cc"""
subcategory = "search"
directory_fmt = ["{category}", "search", "{search_tags}"]
archive_fmt = "s_{search_tags}_{post_id}_{num}"
pattern = [BASE_PATTERN + r"/search(?:/|\?q=)([^/?&#]+)"]
test = [
("http://joyreactor.com/search?q=Cirno+Gifs", {
"count": ">= 0",
}),
("http://joyreactor.cc/search/Cirno+Gifs", {
"count": ">= 0",
}),
]


class JoyreactorUserExtractor(JoyreactorExtractor):
"""Extractor for all posts of a user on joyreactor.cc"""
subcategory = "user"
Expand Down
16 changes: 15 additions & 1 deletion gallery_dl/extractor/pornreactor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2018 Mike Fährmann
# Copyright 2018-2019 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
Expand All @@ -10,6 +10,7 @@

from .joyreactor import (
JoyreactorTagExtractor,
JoyreactorSearchExtractor,
JoyreactorUserExtractor,
JoyreactorPostExtractor,
)
Expand All @@ -30,6 +31,19 @@ class PornreactorTagExtractor(JoyreactorTagExtractor):
]


class PornreactorSearchExtractor(JoyreactorSearchExtractor):
"""Extractor for search results on pornreactor.cc"""
category = "pornreactor"
pattern = [BASE_PATTERN + r"/search(?:/|\?q=)([^/?&#]+)"]
test = [
("http://pornreactor.cc/search?q=ecchi+hentai", {
"range": "1-25",
"count": ">= 20",
}),
("http://fapreactor.com/search/ecchi+hentai", None),
]


class PornreactorUserExtractor(JoyreactorUserExtractor):
"""Extractor for all posts of a user on pornreactor.cc"""
category = "pornreactor"
Expand Down

0 comments on commit a36f52a

Please sign in to comment.