1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 11:41:35 +01:00

[erome] extract 'date' metadata (#5796)

This commit is contained in:
Mike Fährmann 2024-06-27 21:07:23 +02:00
parent 9329c30b41
commit 51fdfbe6fc
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 8 additions and 0 deletions

View File

@ -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},
}

View File

@ -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.",