* better compacting format data
This commit is contained in:
parent
c0370c8309
commit
9f6a8c15f6
|
@ -225,8 +225,9 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFormatSupported(fmt) {
|
function isFormatSupported(fmt) {
|
||||||
if (!['http', 'https'].includes(fmt.protocol))
|
//// currently, we remove other formats in the backend
|
||||||
return false;
|
//if (!['http', 'https'].includes(fmt.protocol))
|
||||||
|
// return false;
|
||||||
|
|
||||||
// must be very old: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported#browser_compatibility
|
// must be very old: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported#browser_compatibility
|
||||||
if (!('MediaSource' in window)) {
|
if (!('MediaSource' in window)) {
|
||||||
|
@ -304,4 +305,19 @@ window.addEventListener('DOMContentLoaded', (event) => {
|
||||||
document.querySelector('#autoplayInput').checked = true;
|
document.querySelector('#autoplayInput').checked = true;
|
||||||
playbackWait();
|
playbackWait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// formats
|
||||||
|
|
||||||
|
console.log("w dzisiejszym menu")
|
||||||
|
|
||||||
|
formats.forEach((e) => {
|
||||||
|
if (e.acodec == "none") {
|
||||||
|
console.log(`- ${e.format_id}, czyli ${e.height}p`)
|
||||||
|
} else if (e.vcodec == "none") {
|
||||||
|
console.log(`- ${e.format_id}, czyli ${e.acodec} ${e.abr}kbps`)
|
||||||
|
} else {
|
||||||
|
console.log(`A TAKŻE SPECJALNEGO GOŚCIA ${e.format_id}, czyli ${e.height}p WRAZ Z RODZINĄ`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,16 +29,7 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
"width": 640,
|
"width": 640,
|
||||||
"ext": "webm",
|
"ext": "webm",
|
||||||
"vcodec": "vp8",
|
"vcodec": "vp8",
|
||||||
"acodec": "vorbis",
|
"acodec": "vorbis"
|
||||||
"format": "44 - 640x480 (480p)",
|
|
||||||
"protocol": "https",
|
|
||||||
"http_headers": {
|
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.54 Safari/537.36",
|
|
||||||
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
|
||||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
|
||||||
"Accept-Encoding": "gzip, deflate",
|
|
||||||
"Accept-Language": "en-us,en;q=0.5"
|
|
||||||
}
|
|
||||||
}]'
|
}]'
|
||||||
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
|
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
|
||||||
url='http://f.sakamoto.pl/videoplayback_.flv'
|
url='http://f.sakamoto.pl/videoplayback_.flv'
|
||||||
|
@ -85,7 +76,7 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
<meta property='og:image' content='https://i.ytimg.com/vi/$(html_encode "${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='og:type' content='video.other'>
|
||||||
<meta property='video:duration' content='$(jq -r '.duration' <<< "$video")'>
|
<meta property='video:duration' content='$(jq -r '.duration' <<< "$video")'>
|
||||||
"'<script type="application/ld+json">'"$(jq '{
|
"'<script type="application/ld+json">'"$(jq -c '{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "VideoObject",
|
"@type": "VideoObject",
|
||||||
"name": .title,
|
"name": .title,
|
||||||
|
@ -96,7 +87,7 @@ if [[ "${get_data[v]}" ]]; then
|
||||||
}' <<< "$video" | sed 's/</\</g;s/>/\>/g;')"'</script>'
|
}' <<< "$video" | sed 's/</\</g;s/>/\>/g;')"'</script>'
|
||||||
source templates/head.sh
|
source templates/head.sh
|
||||||
fi
|
fi
|
||||||
formats=$(jq '.formats' <<< "$video")
|
formats=$(jq -c '[.formats[] | select(.protocol == "https") | {"format_id":.format_id,"url":.url,"ext":.ext,"width":.width,"height":.height,"acodec":.acodec,"vcodec":.vcodec,"abr":.abr,"fps":.fps}]' <<< "$video")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
|
if [[ "${r[host]}" == "${cfg[flash_host]}" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue