merge #4812: [erome] add 'count' metadata field
This commit is contained in:
@@ -44,11 +44,15 @@ class EromeExtractor(Extractor):
|
|||||||
pos = page.index('<div class="user-profile', pos)
|
pos = page.index('<div class="user-profile', pos)
|
||||||
user, pos = text.extract(
|
user, pos = text.extract(
|
||||||
page, 'href="https://www.erome.com/', '"', pos)
|
page, 'href="https://www.erome.com/', '"', pos)
|
||||||
|
count, pos = text.extract(
|
||||||
|
page, 'fa-camera"></i>', '</span>', pos)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"album_id" : album_id,
|
"album_id" : album_id,
|
||||||
"title" : text.unescape(title),
|
"title" : text.unescape(title),
|
||||||
"user" : text.unquote(user),
|
"user" : text.unquote(user),
|
||||||
"_http_headers": {"Referer": url},
|
"_http_headers": {"Referer": url},
|
||||||
|
"count" : text.parse_int(count),
|
||||||
}
|
}
|
||||||
|
|
||||||
yield Message.Directory, data
|
yield Message.Directory, data
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ __tests__ = (
|
|||||||
"#count" : 1,
|
"#count" : 1,
|
||||||
|
|
||||||
"album_id": "NQgdlWvk",
|
"album_id": "NQgdlWvk",
|
||||||
|
"count" : 1,
|
||||||
"num" : 1,
|
"num" : 1,
|
||||||
"title" : "porn",
|
"title" : "porn",
|
||||||
"user" : "yYgWBZw8o8qsMzM",
|
"user" : "yYgWBZw8o8qsMzM",
|
||||||
@@ -29,6 +30,7 @@ __tests__ = (
|
|||||||
"#count" : 6,
|
"#count" : 6,
|
||||||
|
|
||||||
"album_id": "TdbZ4ogi",
|
"album_id": "TdbZ4ogi",
|
||||||
|
"count" : 6,
|
||||||
"num" : int,
|
"num" : int,
|
||||||
"title" : "82e78cfbb461ad87198f927fcb1fda9a1efac9ff.",
|
"title" : "82e78cfbb461ad87198f927fcb1fda9a1efac9ff.",
|
||||||
"user" : "yYgWBZw8o8qsMzM",
|
"user" : "yYgWBZw8o8qsMzM",
|
||||||
|
|||||||
Reference in New Issue
Block a user