mirror of
https://github.com/mikf/gallery-dl.git
synced 2025-01-31 19:51:34 +01:00
[erome] extract 'date' metadata (#5796)
This commit is contained in:
parent
9329c30b41
commit
51fdfbe6fc
@ -46,18 +46,24 @@ class EromeExtractor(Extractor):
|
||||
page, 'href="https://www.erome.com/', '"', pos)
|
||||
|
||||
urls = []
|
||||
date = None
|
||||
groups = page.split('<div class="media-group"')
|
||||
for group in util.advance(groups, 1):
|
||||
url = (text.extr(group, '<source src="', '"') or
|
||||
text.extr(group, 'data-src="', '"'))
|
||||
if url:
|
||||
urls.append(url)
|
||||
if not date:
|
||||
ts = text.extr(group, '?v=', '"')
|
||||
if len(ts) > 1:
|
||||
date = text.parse_timestamp(ts)
|
||||
|
||||
data = {
|
||||
"album_id" : album_id,
|
||||
"title" : text.unescape(title),
|
||||
"user" : text.unquote(user),
|
||||
"count" : len(urls),
|
||||
"date" : date,
|
||||
"_http_headers": {"Referer": url},
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@ __tests__ = (
|
||||
"#count" : 1,
|
||||
|
||||
"album_id": "NQgdlWvk",
|
||||
"date" : None,
|
||||
"count" : 1,
|
||||
"num" : 1,
|
||||
"title" : "porn",
|
||||
@ -30,6 +31,7 @@ __tests__ = (
|
||||
"#count" : 6,
|
||||
|
||||
"album_id": "TdbZ4ogi",
|
||||
"date" : "dt:2024-03-18 00:01:56",
|
||||
"count" : 6,
|
||||
"num" : int,
|
||||
"title" : "82e78cfbb461ad87198f927fcb1fda9a1efac9ff.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user