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)
|
page, 'href="https://www.erome.com/', '"', pos)
|
||||||
|
|
||||||
urls = []
|
urls = []
|
||||||
|
date = None
|
||||||
groups = page.split('<div class="media-group"')
|
groups = page.split('<div class="media-group"')
|
||||||
for group in util.advance(groups, 1):
|
for group in util.advance(groups, 1):
|
||||||
url = (text.extr(group, '<source src="', '"') or
|
url = (text.extr(group, '<source src="', '"') or
|
||||||
text.extr(group, 'data-src="', '"'))
|
text.extr(group, 'data-src="', '"'))
|
||||||
if url:
|
if url:
|
||||||
urls.append(url)
|
urls.append(url)
|
||||||
|
if not date:
|
||||||
|
ts = text.extr(group, '?v=', '"')
|
||||||
|
if len(ts) > 1:
|
||||||
|
date = text.parse_timestamp(ts)
|
||||||
|
|
||||||
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),
|
||||||
"count" : len(urls),
|
"count" : len(urls),
|
||||||
|
"date" : date,
|
||||||
"_http_headers": {"Referer": url},
|
"_http_headers": {"Referer": url},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ __tests__ = (
|
|||||||
"#count" : 1,
|
"#count" : 1,
|
||||||
|
|
||||||
"album_id": "NQgdlWvk",
|
"album_id": "NQgdlWvk",
|
||||||
|
"date" : None,
|
||||||
"count" : 1,
|
"count" : 1,
|
||||||
"num" : 1,
|
"num" : 1,
|
||||||
"title" : "porn",
|
"title" : "porn",
|
||||||
@ -30,6 +31,7 @@ __tests__ = (
|
|||||||
"#count" : 6,
|
"#count" : 6,
|
||||||
|
|
||||||
"album_id": "TdbZ4ogi",
|
"album_id": "TdbZ4ogi",
|
||||||
|
"date" : "dt:2024-03-18 00:01:56",
|
||||||
"count" : 6,
|
"count" : 6,
|
||||||
"num" : int,
|
"num" : int,
|
||||||
"title" : "82e78cfbb461ad87198f927fcb1fda9a1efac9ff.",
|
"title" : "82e78cfbb461ad87198f927fcb1fda9a1efac9ff.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user