html_encode meta variables

merge-requests/6/head
Lauren Liberda 2021-06-23 00:37:19 +02:00
parent 5d6d5d8601
commit 58a6c5ace1
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ if [[ "${get_data[v]}" ]]; then
meta[title]="${strings[title]}"
meta[description]="$(jq -r '.description' <<< "$video")"
meta[unsafe]="
<meta property='og:image' content='https://i.ytimg.com/vi/${get_data[v]}/hqdefault.jpg'>
<meta property='og:image' content='https://i.ytimg.com/vi/$(html_encode "${get_data[v]}")/hqdefault.jpg'>
<meta property='og:type' content='video.other'>
<meta property='video:duration' content='$(jq -r '.duration' <<< "$video")'>
"'<script type="application/ld+json">'"$(jq '{
@ -93,7 +93,7 @@ if [[ "${get_data[v]}" ]]; then
"description": .description,
"thumbnail": .thumbnails[-1].url,
"duration": ("PT" + (.duration | tostring) + "S"),
}' <<< "$video")"'</script>'
}' <<< "$video" | sed 's/</\&#60;/g;s/>/\&#62;/g;')"'</script>'
source templates/head.sh
fi
formats=$(jq '.formats' <<< "$video")