diff --git a/docs/supportedsites.md b/docs/supportedsites.md
index 8e4c59a1..b538749b 100644
--- a/docs/supportedsites.md
+++ b/docs/supportedsites.md
@@ -679,6 +679,12 @@ Consider all listed sites to potentially be NSFW.
Posts, User Profiles |
|
+
+ | Poringa |
+ http://www.poringa.net/ |
+ Posts Images, Search Results, User Profiles |
+ |
+
| Porn Image |
https://porn-images-xxx.com/ |
diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py
index 695b8b2a..9c684bc0 100644
--- a/gallery_dl/extractor/__init__.py
+++ b/gallery_dl/extractor/__init__.py
@@ -122,6 +122,7 @@ modules = [
"pixnet",
"plurk",
"poipiku",
+ "poringa",
"pornhub",
"pornpics",
"postmill",
diff --git a/gallery_dl/extractor/poringa.py b/gallery_dl/extractor/poringa.py
new file mode 100644
index 00000000..e5e80d57
--- /dev/null
+++ b/gallery_dl/extractor/poringa.py
@@ -0,0 +1,129 @@
+# -*- coding: utf-8 -*-
+
+# 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
+# published by the Free Software Foundation.
+
+"""Extractors for http://www.poringa.net/"""
+
+from .common import Extractor, Message
+from .. import text, exception
+from ..cache import cache
+import itertools
+
+BASE_PATTERN = r"(?:https?://)?(?:www\.)?poringa\.net"
+
+
+class PoringaExtractor(Extractor):
+ category = "poringa"
+ directory_fmt = ("{category}", "{user}", "{post_id}")
+ filename_fmt = "{post_id}_{title}_{filename}.{extension}"
+ archive_fmt = "{post_id}"
+ root = "http://www.poringa.net"
+
+ def __init__(self, match):
+ Extractor.__init__(self, match)
+ self.item = match.group(1)
+ self.__cookies = True
+
+ def items(self):
+ for post_id in self.posts():
+ url = "{}/posts/imagenes/{}".format(self.root, post_id)
+
+ try:
+ page = self.request(url).text
+ except exception.HttpError as exc:
+ self.log.warning(
+ "Unable to fetch posts for '%s' (%s)", post_id, exc)
+ continue
+
+ title, pos = text.extract(
+ page, 'property="og:title" content="', '"')
+ pos = page.index('', '
')
+ for url in text.extract_iter(
+ main_post,
+ '
Please wait a few moments", 0, 600) < 0:
+ return response
+ self.sleep(5.0, "check")
+
+ def _pagination(self, url, params):
+ for params["p"] in itertools.count(1):
+ page = self.request(url, params=params).text
+
+ posts_ids = PoringaPostExtractor.pattern.findall(page)
+ posts_ids = list(dict.fromkeys(posts_ids))
+ yield from posts_ids
+
+ if len(posts_ids) < 19:
+ return
+
+
+class PoringaPostExtractor(PoringaExtractor):
+ """Extractor for posts on poringa.net"""
+ subcategory = "post"
+ pattern = BASE_PATTERN + r"/posts/imagenes/(\d+)/[a-zA-Z0-9_-]+\.html"
+ example = "http://www.poringa.net/posts/imagenes/12/TITLE.html"
+
+ def posts(self):
+ return (self.item,)
+
+
+class PoringaUserExtractor(PoringaExtractor):
+ subcategory = "user"
+ pattern = BASE_PATTERN + r"/([a-zA-Z0-9_-]+)$"
+ example = "http://www.poringa.net/USER"
+
+ def posts(self):
+ url = "{}/buscar/".format(self.root)
+ params = {"q": text.unquote(self.item)}
+ return self._pagination(url, params)
+
+
+class PoringaSearchExtractor(PoringaExtractor):
+ subcategory = "search"
+ pattern = BASE_PATTERN + r"/buscar/\?&?q=([^]+)"
+ example = "http://www.poringa.net/buscar/?q=QUERY"
+
+ def posts(self):
+ url = self.root + "/buscar/"
+ params = {"q": text.unquote(self.item)}
+ return self._pagination(url, params)
+
+
+@cache()
+def _cookie_cache():
+ return ()
diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py
index 4839660d..2995a46f 100755
--- a/scripts/supportedsites.py
+++ b/scripts/supportedsites.py
@@ -234,6 +234,9 @@ SUBCATEGORY_MAP = {
"sketch": "Sketch",
"work": "individual Images",
},
+ "poringa": {
+ "post": "Posts Images",
+ },
"pornhub": {
"gifs": "",
},
diff --git a/test/results/poringa.py b/test/results/poringa.py
new file mode 100644
index 00000000..b6c4e95d
--- /dev/null
+++ b/test/results/poringa.py
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+
+# 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
+# published by the Free Software Foundation.
+
+from gallery_dl.extractor import poringa
+
+
+__tests__ = (
+{
+ "#url" : "http://www.poringa.net/posts/imagenes/3051081/Turrita-alto-ojete.html",
+ "#category": ("", "poringa", "post"),
+ "#class" : poringa.PoringaPostExtractor,
+ "#pattern" : r"http://www\.poringa\.net/posts/imagenes/3051081/[a-zA-Z0-9_-]+\.html",
+
+ "post_id" : "3051081",
+ "title" : "turrita alto ojete...",
+ "user" : "vipower1top",
+},
+
+{
+ "#url" : "http://www.poringa.net/posts/imagenes/3095554/Otra-culona-de-instagram.html",
+ "#category": ("", "poringa", "post"),
+ "#class" : poringa.PoringaPostExtractor,
+ "#pattern" : r"http://www\.poringa\.net/posts/imagenes/3095554/[a-zA-Z0-9_-]+\.html",
+
+ "post_id" : "3095554",
+ "title" : "Otra culona de instagram",
+ "user" : "Expectro007",
+},
+
+{
+ "#url" : "http://www.poringa.net/Expectro007",
+ "#category": ("", "poringa", "user"),
+ "#class" : poringa.PoringaUserExtractor,
+ "#pattern" : r"https?://img-[0-9]\.poringa\.net/poringa/img/[a-zA-Z0-9/{2}]{12}[a-zA-Z0-9-_]+/[a-zA-Z0-9-_]+\.jpg",
+},
+
+{
+ "#url" : "http://www.poringa.net/buscar/?&q=yuslopez",
+ "#category": ("", "poringa", "search"),
+ "#class" : poringa.PoringaSearchExtractor,
+ "#pattern" : r"https?://img-[0-9]\.poringa\.net/poringa/img/[a-zA-Z0-9/{2}]{12}[a-zA-Z0-9-_]+/[a-zA-Z0-9-_]+\.jpg",
+},
+
+)