[pornpics] update 'channel' extraction & add test

change 'channel' to a list, since extracting both 'channel' and
'channels' does not really work with text.extract_from()
pull/5224/head
Mike Fährmann 7 months ago
parent 32472d7d6c
commit 1d1ffe3317
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -76,8 +76,7 @@ class PornpicsGalleryExtractor(PornpicsExtractor, GalleryExtractor):
"gallery_id": text.parse_int(self.gallery_id),
"slug" : extr("/galleries/", "/").rpartition("-")[0],
"title" : text.unescape(extr("<h1>", "<")),
"channel" : extr('>Channel:', '</a>').rpartition(">")[2],
"channels" : text.split_html(extr(">Channel:&nbsp;", '</div>')),
"channel" : text.split_html(extr(">Channel:&nbsp;", '</div>')),
"models" : text.split_html(extr(
">Models:", '<span class="suggest')),
"categories": text.split_html(extr(

@ -20,7 +20,7 @@ __tests__ = (
"Amateur",
"Sexy",
],
"channel" : "FTV MILFs",
"channel" : ["FTV MILFs"],
"count" : 17,
"gallery_id": 62610699,
"models" : ["Danielle"],
@ -46,6 +46,41 @@ __tests__ = (
"slug": "british-beauty-danielle-flashes-hot-breasts-ass-and-snatch-in-the-forest",
},
{
"#url" : "https://www.pornpics.com/galleries/four-american-hotties-in-swimsuit-showing-off-their-sexy-booty-and-bare-legs-59500405/",
"#comment" : "more than one 'channel' (#5195)",
"#category": ("", "pornpics", "gallery"),
"#class" : pornpics.PornpicsGalleryExtractor,
"count" : 16,
"num" : range(1, 16),
"gallery_id": 59500405,
"slug" : "four-american-hotties-in-swimsuit-showing-off-their-sexy-booty-and-bare-legs",
"title" : "Four American hotties in swimsuit showing off their sexy booty and bare legs",
"views" : range(50000, 100000),
"models" : [
"Kayla West",
"Layla Price",
"Marley Blaze",
"Mena Mason",
],
"categories": [
"Outdoor",
"Asian",
"Pornstar",
"Brunette",
"Blonde",
],
"channel" : [
"Adult Time",
"Fame Digital",
],
"tags" : [
"Nature",
"Asian Outdoor",
],
},
{
"#url" : "https://www.pornpics.com/tags/summer-dress/",
"#category": ("", "pornpics", "tag"),

Loading…
Cancel
Save