[vipergirls] provide 'num' and 'count' metadata (#7479)
This commit is contained in:
@@ -57,17 +57,18 @@ class VipergirlsExtractor(Extractor):
|
||||
util.advance(posts, (text.parse_int(self.page[5:]) - 1) * 15)
|
||||
|
||||
for post in posts:
|
||||
images = list(post)
|
||||
|
||||
data = post.attrib
|
||||
data["thread_id"] = self.thread_id
|
||||
data["count"] = len(images)
|
||||
|
||||
yield Message.Directory, data
|
||||
|
||||
image = None
|
||||
for image in post:
|
||||
yield Message.Queue, image.attrib["main_url"], data
|
||||
|
||||
if image is not None and like:
|
||||
self.like(post, user_hash)
|
||||
if images:
|
||||
for data["num"], image in enumerate(images, 1):
|
||||
yield Message.Queue, image.attrib["main_url"], data
|
||||
if like:
|
||||
self.like(post, user_hash)
|
||||
|
||||
def login(self):
|
||||
if self.cookies_check(self.cookies_names):
|
||||
|
||||
@@ -14,6 +14,9 @@ __tests__ = (
|
||||
"#class" : vipergirls.VipergirlsThreadExtractor,
|
||||
"#count" : 225,
|
||||
"#sha1_url": "0d75cb42777f5bebc0d284d1d38cb90c750c61d9",
|
||||
|
||||
"count": {112, 113},
|
||||
"num" : range(1, 113),
|
||||
},
|
||||
|
||||
{
|
||||
@@ -49,6 +52,8 @@ __tests__ = (
|
||||
"#range" : "2-113",
|
||||
"#count" : 112,
|
||||
|
||||
"count" : 113,
|
||||
"num" : range(2, 113),
|
||||
"id" : "116038081",
|
||||
"imagecount": "113",
|
||||
"number" : "116038081",
|
||||
|
||||
Reference in New Issue
Block a user