Skip to content

Commit cc7003a

Browse files
[okporn] add support (#8575)
* Add support for ok.porn * update - adjust pattern/example/page_url - prevent unnecessary request - extract 'tags' - text.extract -> text.extr - return list comprehension result * update supportedsites name * update test results --------- Co-authored-by: Mike Fährmann <[email protected]>
1 parent 157a37b commit cc7003a

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

docs/supportedsites.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,12 @@ Consider all listed sites to potentially be NSFW.
727727
<td>individual Images, Models</td>
728728
<td></td>
729729
</tr>
730+
<tr id="okporn" title="okporn">
731+
<td>OK.PORN</td>
732+
<td>https://ok.porn/</td>
733+
<td>Galleries</td>
734+
<td></td>
735+
</tr>
730736
<tr id="patreon" title="patreon">
731737
<td>Patreon</td>
732738
<td>https://www.patreon.com/</td>

gallery_dl/extractor/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"nozomi",
143143
"nsfwalbum",
144144
"nudostar",
145+
"okporn",
145146
"paheal",
146147
"patreon",
147148
"pexels",

gallery_dl/extractor/okporn.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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://ok.porn/"""
8+
9+
from .common import GalleryExtractor
10+
from .. import text
11+
12+
13+
class OkpornGalleryExtractor(GalleryExtractor):
14+
"""Extractor for image galleries from ok.porn"""
15+
category = "okporn"
16+
root = "https://ok.porn"
17+
pattern = r"(?:https?://)?(?:www\.)?ok\.porn/albums/(\d+)"
18+
example = "https://ok.porn/albums/12345/"
19+
20+
def __init__(self, match):
21+
url = f"{self.root}/albums/{match[1]}/"
22+
GalleryExtractor.__init__(self, match, url)
23+
24+
def metadata(self, page):
25+
return {
26+
"gallery_id" : text.parse_int(self.groups[0]),
27+
"title" : text.unescape(text.extr(
28+
page, "h1 class=title>", "</h1>")),
29+
"description": text.unescape(text.extr(
30+
page, 'name="description" content="', '"')),
31+
"tags": text.extr(
32+
page, 'name="keywords" content="', '"').split(", "),
33+
}
34+
35+
def images(self, page):
36+
return [
37+
(url, None)
38+
for url in text.extract_iter(page, 'data-original="', '"')
39+
]

scripts/supportedsites.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"nozrip" : "GaryC Booru",
140140
"nsfwalbum" : "NSFWalbum.com",
141141
"nudostar" : "NudoStar.TV",
142+
"okporn" : "OK.PORN",
142143
"paheal" : "Rule 34",
143144
"photovogue" : "PhotoVogue",
144145
"picstate" : "PicState",

test/results/okporn.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 okporn
8+
9+
10+
__tests__ = (
11+
{
12+
"#url" : "https://ok.porn/albums/66141/",
13+
"#class" : okporn.OkpornGalleryExtractor,
14+
"#pattern" : r"https://pics\-storage\-1\.ok\.porn/contents/albums/main/1920x1080/66000/66141/\d+\.jpg",
15+
"#count" : 100,
16+
17+
"count" : 100,
18+
"num" : range(1, 100),
19+
"description": "When Tommy Wood catches his stepmom Slimthick Vic parading her juicy ass in a thong, he takes a few pictures to show his dad. Vic begs him not to tell him but Tommy says the only way he’ll delete the pictures is if she gives him some naughty TLC.",
20+
"extension" : "jpg",
21+
"filename" : r"re:^\d+$",
22+
"gallery_id" : 66141,
23+
"title" : "Stepmom Likes To Flaunt It",
24+
"tags" : [
25+
"milf",
26+
"big tits",
27+
"blowjob",
28+
"oral",
29+
"blonde",
30+
"doggystyle",
31+
"cowgirl",
32+
"big cock",
33+
"big ass",
34+
"missionary",
35+
"natural tits",
36+
"side fuck",
37+
"short hair",
38+
"long legs",
39+
"curvy",
40+
"straight hair",
41+
"perfect body",
42+
"bedroom",
43+
"Slimthick Vic",
44+
],
45+
},
46+
47+
)

0 commit comments

Comments
 (0)