From f0ecb08347395f5ab2329ef1da2bc646a926e1fe Mon Sep 17 00:00:00 2001 From: suza <73082112+tsuza@users.noreply.github.com> Date: Sun, 28 Sep 2025 22:13:37 +0200 Subject: [PATCH] fix(opengraph): video embeds (#870) --- copyparty/httpcli.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index b66a71fe..8864668d 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -7101,7 +7101,15 @@ class HttpCli(object): if zs not in ("", "-"): ogh["og:site_name"] = zs + try: + zs1, zs2 = file["tags"]["res"].split("x") + file["tags"][".resw"] = zs1 + file["tags"][".resh"] = zs2 + except: + pass + tagmap = {} + if is_au: title = str(vn.flags.get("og_title_a") or "") ogh["og:type"] = "music.song" @@ -7115,15 +7123,23 @@ class HttpCli(object): title = str(vn.flags.get("og_title_v") or "") ogh["og:type"] = "video.other" ogh["og:video"] = j2a["og_raw"] + tagmap = { "title": "og:title", ".dur": "og:video:duration", + ".resw": "og:video:width", + ".resh": "og:video:height", } elif is_pic: title = str(vn.flags.get("og_title_i") or "") ogh["twitter:card"] = "summary_large_image" ogh["twitter:image"] = ogh["og:image"] = j2a["og_raw"] + tagmap = { + ".resw": "og:image:width", + ".resh": "og:image:height", + } + try: for k, v in file["tags"].items(): zs = "{{ %s }}" % (k,)