diff --git a/docs/configuration.rst b/docs/configuration.rst
index aa58af9c..a98ea518 100644
--- a/docs/configuration.rst
+++ b/docs/configuration.rst
@@ -395,6 +395,7 @@ Description
* ``tapas``
* ``tsumino``
* ``twitter``
+ * ``vipergirls``
* ``zerochan``
These values can also be specified via the
diff --git a/docs/supportedsites.md b/docs/supportedsites.md
index 93e01211..444e4db5 100644
--- a/docs/supportedsites.md
+++ b/docs/supportedsites.md
@@ -712,7 +712,7 @@ Consider all sites to be NSFW unless otherwise known.
| Postimg |
https://postimages.org/ |
- individual Images |
+ Galleries, individual Images |
|
@@ -899,7 +899,7 @@ Consider all sites to be NSFW unless otherwise known.
| Vipergirls |
https://vipergirls.to/ |
Posts, Threads |
- |
+ Supported |
| Vipr |
@@ -995,7 +995,7 @@ Consider all sites to be NSFW unless otherwise known.
Zerochan |
https://www.zerochan.net/ |
individual Images, Tag Searches |
- |
+ Supported |
| かべうち |
diff --git a/gallery_dl/extractor/vipergirls.py b/gallery_dl/extractor/vipergirls.py
index 5a20c67f..6dff01c8 100644
--- a/gallery_dl/extractor/vipergirls.py
+++ b/gallery_dl/extractor/vipergirls.py
@@ -9,7 +9,8 @@
"""Extractors for https://vipergirls.to/"""
from .common import Extractor, Message
-from .. import text, util
+from .. import text, util, exception
+from ..cache import cache
from xml.etree import ElementTree
@@ -30,6 +31,8 @@ class VipergirlsExtractor(Extractor):
self.session.headers["Referer"] = self.root
def items(self):
+ self.login()
+
for post in self.posts():
data = post.attrib
data["thread_id"] = self.thread_id
@@ -38,6 +41,31 @@ class VipergirlsExtractor(Extractor):
for image in post:
yield Message.Queue, image.attrib["main_url"], data
+ def login(self):
+ if not self._check_cookies(self.cookienames):
+ username, password = self._get_auth_info()
+ if username:
+ self._update_cookies(self._login_impl(username, password))
+
+ @cache(maxage=90*24*3600, keyarg=1)
+ def _login_impl(self, username, password):
+ self.log.info("Logging in as %s", username)
+
+ url = "{}/login.php?do=login".format(self.root)
+ data = {
+ "vb_login_username": username,
+ "vb_login_password": password,
+ "do" : "login",
+ "cookieuser" : "1",
+ }
+
+ response = self.request(url, method="POST", data=data)
+ if not response.cookies.get("vg_password"):
+ raise exception.AuthenticationError()
+
+ return {cookie.name: cookie.value
+ for cookie in response.cookies}
+
class VipergirlsThreadExtractor(VipergirlsExtractor):
"""Extractor for vipergirls threads"""
diff --git a/scripts/supportedsites.py b/scripts/supportedsites.py
index e1bce2c4..78e6843e 100755
--- a/scripts/supportedsites.py
+++ b/scripts/supportedsites.py
@@ -340,8 +340,10 @@ AUTH_MAP = {
"tsumino" : "Supported",
"tumblr" : _OAUTH,
"twitter" : "Supported",
+ "vipergirls" : "Supported",
"wallhaven" : _APIKEY_WH,
"weasyl" : _APIKEY_WY,
+ "zerochan" : "Supported",
}
IGNORE_LIST = (
diff --git a/test/test_results.py b/test/test_results.py
index d28496b3..03a17c40 100644
--- a/test/test_results.py
+++ b/test/test_results.py
@@ -324,7 +324,8 @@ def setup_test_config():
for category in ("danbooru", "atfbooru", "aibooru", "e621", "e926",
"instagram", "twitter", "subscribestar", "deviantart",
- "inkbunny", "tapas", "pillowfort", "mangadex"):
+ "inkbunny", "tapas", "pillowfort", "mangadex",
+ "vipergirls"):
config.set(("extractor", category), "username", None)
config.set(("extractor", "mastodon.social"), "access-token",