Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Video OG and Cards meta tags #221

Open
iGerman00 opened this issue Jul 10, 2024 · 0 comments
Open

[Proposal] Video OG and Cards meta tags #221

iGerman00 opened this issue Jul 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@iGerman00
Copy link

Is your feature request related to a problem? Please describe.
ProxiTok is a great tool, and there are already meta tags, but I was disappointed to find that it did not return meta tags for video-specific content. It could be quite useful for platforms like Discord and Telegram

Describe the solution you'd like
Although my instance keeps erroring on subsequent requests (paradoxically with 200 and "OK" as the error) -- I doubt that is related, but do check it over.

My proposal:
In templates/components/head.latte, something like this worked pretty well for me in Discord and Telegram:

<!-- ... -->
	{if isset($og, $og_content, $og_url)}
		<!-- Using TikTok's meta config -->
		<meta property="og:title" content="{$og->title}" />
		<meta property="og:description" content="{$og->description}" />
		<meta property="og:url" content="{$og_url}" />
		<meta property="og:image" content="{url_stream($og_content)}" />
		<meta property="twitter:title" content="{$og->title}" />
		<meta property="twitter:description" content="{$og->description}" />
		<meta property="twitter:image" content="{url_stream($og_content)}" />

		<!-- For embeds on Discord -->
		<meta name="twitter:card" content="player" />
		<meta name="twitter:player:width" content="576" />
		<meta name="twitter:player:height" content="1024" />
		<meta name="twitter:player:stream" content="{url_stream($item->video->playAddr)}" />
		<meta name="twitter:player:stream:content_type" content="video/mp4" />
		<meta property="og:video" content="{url_stream($item->video->playAddr)}" />
		<meta property="og:video:secure_url" content="{url_stream($item->video->playAddr)}" />
		<meta property="og:video:type" content="video/mp4" />
		<meta property="og:video:width" content="576" />
		<meta property="og:video:height" content="1024" />

	{else}
<!-- ... -->

Describe alternatives you've considered
Alternative solutions for something like this include vxtiktok by @dylanpdx is a service specifically designed for the embeds. However, it does not always work, and as far as I know its proxy also doesn't work in
countries that banned TikTok.

In general, since you've already got the existing meta tags, I see no reason this couldn't be added. Although if the playAddr URL often expires, it might need to be a more robust getter (e.g. some additional route with URL params) of some kind to not rely on a URL that can expire, as otherwise, since Discord and Telegram both cache and store the embedded responses, they might stop working once it expires.

@iGerman00 iGerman00 added the enhancement New feature or request label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant