Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[erooups] add support #4721

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/supportedsites.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ Consider all sites to be NSFW unless otherwise known.
<td>Albums, Search Results, User Profiles</td>
<td></td>
</tr>
<tr>
<td>Erooups</td>
<td>http://erooups.com/</td>
<td>Albums, Search Results, User Profiles</td>
<td></td>
</tr>
<tr>
<td>ExHentai</td>
<td>https://exhentai.org/</td>
Expand Down
1 change: 1 addition & 0 deletions gallery_dl/extractor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"dynastyscans",
"e621",
"erome",
"erooups",
"exhentai",
"fallenangels",
"fanbox",
Expand Down
49 changes: 49 additions & 0 deletions gallery_dl/extractor/erooups.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- 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://erooups.com/"""

from .common import GalleryExtractor
from .. import text


class ErooupsGalleryExtractor(GalleryExtractor):
category = "erooups"
directory_fmt = ("{category}", "{title}")
archive_fmt = "{date}_{filename}"
pattern = (r"(?:http?://)?(?:www\.)?erooups\.com"
r"/(\d+)/(\d+)/(\d+)/([^/?#]+)")
root = "http://erooups.com"
example = "http://erooups.com/2023/10/25/page-title-11-pics.html"

def __init__(self, match):
self.year = match.group(1)
self.month = match.group(2)
self.day = match.group(3)
self.slug = match.group(4)
url = "{}/{}/{}/{}/{}".format(
self.root, self.year, self.month, self.day, self.slug)
GalleryExtractor.__init__(self, match, url)

def images(self, page):
extr = text.extr(page, 'class="imgs">', "</section>")
return [
(self.root + i if "erooups" not in i else i, None) for i in
text.extract_iter(extr, 'img src="', '"')
]

def metadata(self, page):
return {
"pageurl": self.url,
"date": text.parse_datetime(
"{}-{}-{}".format(self.year, self.month, self.day)),
"title": text.extr(
page, '<h1 class="title">', "</h1>"),
"tag": text.extr(
page, '"><strong>', "</strong></a>"),
"count": text.parse_int(text.extr(
page, '<div class="pics">', "</div>")),
}
1 change: 1 addition & 0 deletions scripts/supportedsites.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"e926" : "e926",
"e6ai" : "e6AI",
"erome" : "EroMe",
"erooups" : "erooups",
"e-hentai" : "E-Hentai",
"exhentai" : "ExHentai",
"fallenangels" : "Fallen Angels Scans",
Expand Down
Loading