add simple imagehosts to list of supported sites

pull/17/head
Mike Fährmann 8 years ago
parent ec48d25afc
commit 4332694492
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -49,7 +49,6 @@ CATEGORY_MAP = {
"worldthree" : "World Three", "worldthree" : "World Three",
"yomanga" : "YoManga", "yomanga" : "YoManga",
"yonkouprod" : "Yonkou Productions", "yonkouprod" : "Yonkou Productions",
} }
SUBCATEGORY_MAP = { SUBCATEGORY_MAP = {
@ -58,6 +57,7 @@ SUBCATEGORY_MAP = {
"image" : "individual Images", "image" : "individual Images",
"issue" : "Comic-Issues", "issue" : "Comic-Issues",
"manga" : "Manga", "manga" : "Manga",
"pinit" : "pin.it Links",
"status" : "Images from Statuses", "status" : "Images from Statuses",
"tag" : "Tag-Searches", "tag" : "Tag-Searches",
"user" : "Images from Users", "user" : "Images from Users",
@ -115,35 +115,39 @@ class RstTable():
def build_list(): def build_list():
exts = [] extractors = []
sub = [] classes = []
last = None last = None
for ex in gallery_dl.extractor.extractors():
c, sc = ex.category, [ex.subcategory, ex] for extr in gallery_dl.extractor.extractors():
if c == last or not last: if extr.category == last or not last:
sub.append(sc) classes.append(extr)
elif last: elif last:
if sub[0][0] and not (len(sub) == 1 and sub[0][0] == "image"): if classes[0].subcategory:
sub.sort(key=sub_keys) extractors.append(classes)
exts.append([last, sub]) classes = [extr]
sub = [sc] last = extr.category
last = c extractors.append(classes)
exts.append([last, sorted(sub)])
for ext in exts: for extrlist in extractors:
ext[0] = map_category(ext[0]) extrlist.sort(key=subcategory_key)
for sub in ext[1]: for extr in extrlist:
sub[0] = map_subcategory(sub[0]) extr.category = map_category(extr.category)
exts.sort(key=lambda x: x[0].lower()) extr.subcat = map_subcategory(extr.subcategory)
extractors.sort(key=category_key)
return exts return extractors
def get_domain(classes): def get_domain(classes):
try: try:
url = sys.modules[classes[0].__module__].__doc__.split()[-1] cls = classes[0]
url = sys.modules[cls.__module__].__doc__.split()[-1]
if url.startswith("http"): if url.startswith("http"):
return url return url
scheme = "https" if hasattr(cls, "https") and cls.https else "http"
host = cls.__doc__.split()[-1]
return scheme + "://" + host + "/"
except (IndexError, AttributeError): except (IndexError, AttributeError):
pass pass
return "" return ""
@ -157,25 +161,32 @@ def map_subcategory(sc):
return SUBCATEGORY_MAP.get(sc, sc.capitalize() + "s") return SUBCATEGORY_MAP.get(sc, sc.capitalize() + "s")
def sub_keys(sc): def category_key(extrlist):
if sc[0] == "user": key = extrlist[0].category.lower()
if len(extrlist) == 1 and extrlist[0].subcat == "individual Images":
key = "zz" + key
return key
def subcategory_key(cls):
if cls.subcategory in ("user", "issue"):
return "A" return "A"
return sc[0] return cls.subcategory
exts = build_list() extractors = build_list()
columns = [ columns = [
RstColumn("Site", [ RstColumn("Site", [
ext[0] extrlist[0].category
for ext in exts for extrlist in extractors
]), ]),
RstColumn("URL", [ RstColumn("URL", [
get_domain([subc[1] for subc in ext[1]]) get_domain(extrlist)
for ext in exts for extrlist in extractors
]), ]),
RstColumn("Capabilities", [ RstColumn("Capabilities", [
", ".join(subc[0] for subc in ext[1]) ", ".join(extr.subcat for extr in extrlist)
for ext in exts for extrlist in extractors
]), ]),
] ]

@ -57,7 +57,7 @@ Supported Sites
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Kirei Cake |https://reader.kireicake.com/ |Chapters, Manga | |Kirei Cake |https://reader.kireicake.com/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|KissComic |http://kisscomic.us/ |Comics, Comic-Issues | |KissComic |http://kisscomic.us/ |Comic-Issues, Comics |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|KissManga |http://kissmanga.com/ |Chapters, Manga | |KissManga |http://kissmanga.com/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
@ -87,15 +87,15 @@ Supported Sites
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Pawoo |https://pawoo.net |Images from Users, Images from Statuses | |Pawoo |https://pawoo.net |Images from Users, Images from Statuses |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Pinterest |https://www.pinterest.com |Boards, Pins, Pinits | |Pinterest |https://www.pinterest.com |Boards, Pins, pin.it Links |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Pixiv |https://www.pixiv.net/ |Images from Users, Bookmarks, Favorites, Individual Images| |Pixiv |https://www.pixiv.net/ |Images from Users, Bookmarks, Favorites, Individual Images|
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|PowerManga |https://powermanga.org/ |Chapters, Manga | |PowerManga |https://powermanga.org/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Read Comic Online |http://readcomiconline.to/ |Comics, Comic-Issues | |Read Comic Online |http://readcomiconline.to/ |Comic-Issues, Comics |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Readcomics |http://readcomics.tv/ |Comics, Comic-Issues | |Readcomics |http://readcomics.tv/ |Comic-Issues, Comics |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Rule 34 |https://rule34.xxx/ |Posts, Tag-Searches | |Rule 34 |https://rule34.xxx/ |Posts, Tag-Searches |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
@ -123,3 +123,45 @@ Supported Sites
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Yonkou Productions |https://yonkouprod.com/ |Chapters, Manga | |Yonkou Productions |https://yonkouprod.com/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+ +-------------------+---------------------------------------+----------------------------------------------------------+
|Chronos |http://chronos.to/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Coreimg |http://coreimg.net/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Fapat |http://fapat.me/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Hosturimage |https://hosturimage.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imageontime |http://imageontime.org/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imagetwist |http://imagetwist.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imagevenue |http://imagevenue.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Img4ever |https://img4ever.net/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgcandy |http://imgcandy.net/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgmaid |https://imgmaid.net/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgspice |https://imgspice.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgspot |http://imgspot.org/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgtrex |http://imgtrex.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgtrial |http://imgtrial.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgupload |https://imgupload.yt/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Imgyt |https://img.yt/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Picmaniac |http://pic-maniac.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Pixhost |https://pixhost.org/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Postimg |https://postimg.org/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Rapidimg |http://rapidimg.net/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Turboimagehost |http://turboimagehost.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+

Loading…
Cancel
Save