Skip to content

Commit a9687d2

Browse files
[pornstarstube] add support (#8576)
* Add support for pornstars.tube * update - adjust pattern/example/page_url - extract '' & '' metadata - prevent unnecessary request - fix result URLs - return list comprehension result * update supportedsites * update test results * fix extractor name --------- Co-authored-by: Mike Fährmann <[email protected]>
1 parent cc7003a commit a9687d2

File tree

5 files changed

+109
-0
lines changed

5 files changed

+109
-0
lines changed

docs/supportedsites.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,12 @@ Consider all listed sites to potentially be NSFW.
841841
<td>Galleries, Search Results, Tag Searches</td>
842842
<td></td>
843843
</tr>
844+
<tr id="pornstarstube" title="pornstarstube">
845+
<td>PORNSTARS.TUBE</td>
846+
<td>https://pornstars.tube/</td>
847+
<td>Galleries</td>
848+
<td></td>
849+
</tr>
844850
<tr id="rule34vault" title="rule34vault">
845851
<td>R34 Vault</td>
846852
<td>https://rule34vault.com/</td>

gallery_dl/extractor/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
"poringa",
162162
"pornhub",
163163
"pornpics",
164+
"pornstarstube",
164165
"postmill",
165166
"rawkuma",
166167
"reactor",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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://pornstars.tube/"""
8+
9+
from .common import GalleryExtractor
10+
from .. import text
11+
12+
13+
class PornstarstubeGalleryExtractor(GalleryExtractor):
14+
"""Extractor for image galleries from pornstars.tube"""
15+
category = "pornstarstube"
16+
root = "https://pornstars.tube"
17+
pattern = (r"(?:https?://)?(?:www\.)?pornstars\.tube"
18+
r"/albums/(\d+)(?:/([\w-]+))?")
19+
example = "https://pornstars.tube/albums/12345/SLUG/"
20+
21+
def __init__(self, match):
22+
url = f"{self.root}/albums/{match[1]}/{match[2] or 'a'}/"
23+
GalleryExtractor.__init__(self, match, url)
24+
25+
def metadata(self, page):
26+
gid, slug = self.groups
27+
return {
28+
"gallery_id": text.parse_int(gid),
29+
"slug" : slug or "",
30+
"title" : text.unescape(text.extr(
31+
page, "<title>", " - PORNSTARS.TUBE</title>")),
32+
"description": text.unescape(text.extr(
33+
page, 'name="description" content="', '"')),
34+
"tags": text.extr(
35+
page, 'name="keywords" content="', '"').split(", "),
36+
}
37+
38+
def images(self, page):
39+
album = text.extr(page, 'class="block-album"', "\n</div>")
40+
return [
41+
(url, None)
42+
for url in text.extract_iter(album, ' href="', '"')
43+
]

scripts/supportedsites.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
"pornimage" : "Porn Image",
152152
"pornpics" : "PornPics.com",
153153
"pornreactor" : "PornReactor",
154+
"pornstarstube" : "PORNSTARS.TUBE",
154155
"postimg" : "Postimages",
155156
"readcomiconline": "Read Comic Online",
156157
"redbust" : "RedBust",

test/results/pornstarstube.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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 pornstarstube
8+
9+
10+
__tests__ = (
11+
{
12+
"#url" : "https://pornstars.tube/albums/40771/cleaning-leads-to-delicious-mess/",
13+
"#class" : pornstarstube.PornstarstubeGalleryExtractor,
14+
"#pattern" : r"https://pics\-storage\-1\.pornhat\.com/contents/albums/main/1920x1080/40000/40771/\d+\.jpg",
15+
"#count" : 100,
16+
17+
"count" : 100,
18+
"num" : range(1, 100),
19+
"description": "When stepson Brad Sterling decides to help out his stepmom Cali Lee and do a deep clean of the kitchen, he wasn’t expecting her to be so grateful for it. Cali offers to reward him for all his hard work in a much devious way. Who knew that a little bit of cleaning would lead to such messy results!",
20+
"extension" : "jpg",
21+
"filename" : r"re:^\d+$",
22+
"gallery_id" : 40771,
23+
"slug" : "cleaning-leads-to-delicious-mess",
24+
"title" : "Cleaning Leads To Delicious Mess",
25+
"tags" : [
26+
"blowjob",
27+
"oral",
28+
"brunette",
29+
"teen (18+)",
30+
"cowgirl",
31+
"latina",
32+
"missionary",
33+
"handjob",
34+
"babe",
35+
"standing doggystyle",
36+
"side fuck",
37+
"reverse cowgirl",
38+
"deep throat",
39+
"kitchen",
40+
"posing",
41+
"stripping",
42+
"firm ass",
43+
"legs on shoulders",
44+
"Cali Lee",
45+
],
46+
},
47+
48+
{
49+
"#url" : "https://pornstars.tube/albums/40771/cleaning",
50+
"#class" : pornstarstube.PornstarstubeGalleryExtractor,
51+
},
52+
53+
{
54+
"#url" : "https://pornstars.tube/albums/40771-O",
55+
"#class" : pornstarstube.PornstarstubeGalleryExtractor,
56+
},
57+
58+
)

0 commit comments

Comments
 (0)