mirror of
https://github.com/9001/copyparty.git
synced 2025-09-30 13:42:27 -06:00
fix(opengraph): video embeds (#870)
This commit is contained in:
parent
1193f9ba6c
commit
f0ecb08347
|
@ -7101,7 +7101,15 @@ class HttpCli(object):
|
||||||
if zs not in ("", "-"):
|
if zs not in ("", "-"):
|
||||||
ogh["og:site_name"] = zs
|
ogh["og:site_name"] = zs
|
||||||
|
|
||||||
|
try:
|
||||||
|
zs1, zs2 = file["tags"]["res"].split("x")
|
||||||
|
file["tags"][".resw"] = zs1
|
||||||
|
file["tags"][".resh"] = zs2
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
tagmap = {}
|
tagmap = {}
|
||||||
|
|
||||||
if is_au:
|
if is_au:
|
||||||
title = str(vn.flags.get("og_title_a") or "")
|
title = str(vn.flags.get("og_title_a") or "")
|
||||||
ogh["og:type"] = "music.song"
|
ogh["og:type"] = "music.song"
|
||||||
|
@ -7115,15 +7123,23 @@ class HttpCli(object):
|
||||||
title = str(vn.flags.get("og_title_v") or "")
|
title = str(vn.flags.get("og_title_v") or "")
|
||||||
ogh["og:type"] = "video.other"
|
ogh["og:type"] = "video.other"
|
||||||
ogh["og:video"] = j2a["og_raw"]
|
ogh["og:video"] = j2a["og_raw"]
|
||||||
|
|
||||||
tagmap = {
|
tagmap = {
|
||||||
"title": "og:title",
|
"title": "og:title",
|
||||||
".dur": "og:video:duration",
|
".dur": "og:video:duration",
|
||||||
|
".resw": "og:video:width",
|
||||||
|
".resh": "og:video:height",
|
||||||
}
|
}
|
||||||
elif is_pic:
|
elif is_pic:
|
||||||
title = str(vn.flags.get("og_title_i") or "")
|
title = str(vn.flags.get("og_title_i") or "")
|
||||||
ogh["twitter:card"] = "summary_large_image"
|
ogh["twitter:card"] = "summary_large_image"
|
||||||
ogh["twitter:image"] = ogh["og:image"] = j2a["og_raw"]
|
ogh["twitter:image"] = ogh["og:image"] = j2a["og_raw"]
|
||||||
|
|
||||||
|
tagmap = {
|
||||||
|
".resw": "og:image:width",
|
||||||
|
".resh": "og:image:height",
|
||||||
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for k, v in file["tags"].items():
|
for k, v in file["tags"].items():
|
||||||
zs = "{{ %s }}" % (k,)
|
zs = "{{ %s }}" % (k,)
|
||||||
|
|
Loading…
Reference in a new issue