[vk] parse 'date' metadata (#8029)

This commit is contained in:
Mike Fährmann
2025-09-05 18:04:34 +02:00
parent b9fd9103d4
commit 89e1c785a6
2 changed files with 7 additions and 1 deletions

View File

@@ -72,6 +72,8 @@ class VkExtractor(Extractor):
photo["width"] = photo["height"] = 0
photo["id"] = photo["id"].rpartition("_")[2]
photo["date"] = text.parse_timestamp(text.extr(
photo["date"], 'data-date="', '"'))
photo.update(data)
text.nameext_from_url(url, photo)

View File

@@ -17,6 +17,7 @@ __tests__ = (
"#count" : ">= 35",
"id" : r"re:\d+",
"date": "type:datetime",
"user": {
"group": False,
"id" : "398982326",
@@ -33,6 +34,7 @@ __tests__ = (
"#range" : "15-25",
"id" : r"re:\d+",
"date": "type:datetime",
"user": {
"group": True,
"id" : "-165740836",
@@ -50,6 +52,8 @@ __tests__ = (
"#pattern" : r"https://sun\d+-\d+\.userapi\.com/",
"#range" : "1-9",
"#count" : 9,
"date": "type:datetime",
},
{
@@ -96,7 +100,7 @@ __tests__ = (
"#url" : "https://vk.com/tag304303884",
"#category": ("", "vk", "tagged"),
"#class" : vk.VkTaggedExtractor,
"#count" : 44,
"#exception": exception.AuthorizationError,
},
{