Skip to content

Commit d74809c

Browse files
[eporner] add support (#8581)
* [eporner] Add support * Line-length <80 chars * Fix flake8 indentation * update - generalize example URL - strip "Photo Gallery" from 'title' - extract 'id' * update supportedsites * update test results
1 parent 2bff682 commit d74809c

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

docs/supportedsites.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ Consider all listed sites to potentially be NSFW.
283283
<td>Favorites, Galleries, Posts, Search Results, Tag Searches</td>
284284
<td>Supported</td>
285285
</tr>
286+
<tr id="eporner" title="eporner">
287+
<td>EPORNER</td>
288+
<td>https://www.eporner.com/</td>
289+
<td>Galleries</td>
290+
<td></td>
291+
</tr>
286292
<tr id="erome" title="erome">
287293
<td>EroMe</td>
288294
<td>https://www.erome.com/</td>

gallery_dl/extractor/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"discord",
5757
"dynastyscans",
5858
"e621",
59+
"eporner",
5960
"erome",
6061
"everia",
6162
"exhentai",

gallery_dl/extractor/eporner.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2 as
5+
# published by the Free Software Foundation.
6+
7+
"""Extractors for https://www.eporner.com/"""
8+
9+
from .common import GalleryExtractor
10+
from .. import text
11+
12+
13+
class EpornerGalleryExtractor(GalleryExtractor):
14+
"""Extractor for image galleries from eporner.com"""
15+
category = "eporner"
16+
root = "https://eporner.com"
17+
pattern = (r"(?:https?://)?(?:www\.)?eporner\.com"
18+
r"/gallery/(\w+)(?:/([\w-]+))?")
19+
example = "https://www.eporner.com/gallery/GID/SLUG/"
20+
21+
def __init__(self, match):
22+
url = f"{self.root}/gallery/{match[1]}/{match[2]}/"
23+
GalleryExtractor.__init__(self, match, url)
24+
25+
def metadata(self, page):
26+
title = text.extr(page, "<title>", " - EPORNER</title>")
27+
if title.endswith(" Photo Gallery"):
28+
title = title[:-14]
29+
30+
return {
31+
"gallery_id": self.groups[0],
32+
"title" : text.unescape(title),
33+
"slug" : text.extr(
34+
page, "/gallery/", '/"').rpartition("/")[2],
35+
"description": text.unescape(text.extr(
36+
page, 'name="description" content="', '"')),
37+
"tags": text.extr(
38+
page, 'EP.ads.keywords = "', '"').split(","),
39+
}
40+
41+
def images(self, page):
42+
album = text.extr(
43+
page, 'class="photosgrid gallerygrid"', "id='gallerySlideBox'")
44+
45+
results = []
46+
for url in text.extract_iter(album, ' src="', '"'):
47+
url, _, ext = url.rpartition(".")
48+
# Preview images have a resolution suffix.
49+
# E.g. "11208293-image-3_296x1000.jpg".
50+
# The same name, but without the suffix, leads to the full image.
51+
url = url[:url.rfind("_")]
52+
name = url[url.rfind("/")+1:]
53+
results.append((f"{url}.{ext}", {"id": name[:name.find("-")]}))
54+
return results

scripts/supportedsites.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"e926" : "e926",
5454
"e6ai" : "e6AI",
5555
"erome" : "EroMe",
56+
"eporner" : "EPORNER",
5657
"everia" : "EVERIA.CLUB",
5758
"e-hentai" : "E-Hentai",
5859
"exhentai" : "ExHentai",

test/results/eporner.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License version 2 as
5+
# published by the Free Software Foundation.
6+
7+
from gallery_dl.extractor import eporner
8+
9+
10+
__tests__ = (
11+
{
12+
"#url" : "https://www.eporner.com/gallery/mHNhErACQFE/NaughtyAmerica-Lolly-Dames-My-Wife-s-Hot-Friend-Big-Booty-Big-Tits-Lolly-Dames-Gets-Her-Pussy-Slammed-Hard/",
13+
"#class" : eporner.EpornerGalleryExtractor,
14+
"#pattern" : r"https://static\-eu\-cdn\.eporner\.com/gallery/FE/CQ/mHNhErACQFE/\d+\-image\-\d+\.jpg",
15+
"#count" : 261,
16+
17+
"count" : 261,
18+
"num" : range(1, 261),
19+
"description": "NaughtyAmerica Lolly Dames - My Wife's Hot Friend - Big Booty Big Tits Lolly Dames Gets Her Pussy Slammed Hard sexy gallery with 261 pics. Eporner is the largest hd porn source.",
20+
"extension" : "jpg",
21+
"filename" : r"re:^\d+\-image\-\d+$",
22+
"gallery_id" : "mHNhErACQFE",
23+
"id" : r"re:^\d+$",
24+
"slug" : "NaughtyAmerica-Lolly-Dames-My-Wife-s-Hot-Friend-Big-Booty-Big-Tits-Lolly-Dames-Gets-Her-Pussy-Slammed-Hard",
25+
"title" : "NaughtyAmerica Lolly Dames - My Wife's Hot Friend - Big Booty Big Tits Lolly Dames Gets Her Pussy Slammed Hard",
26+
"tags" : [
27+
"cumshot",
28+
"hardcore",
29+
"blowjob",
30+
"mature",
31+
"housewives",
32+
"big tits",
33+
"blonde",
34+
"big ass",
35+
"milf",
36+
],
37+
},
38+
39+
{
40+
"#url" : "https://www.eporner.com/gallery/mHNhErACQFE",
41+
"#class" : eporner.EpornerGalleryExtractor,
42+
},
43+
44+
)

0 commit comments

Comments
 (0)