mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-26 08:41:27 +00:00
commit a5acddefa92c454fced4a9176df10dc85efdb516 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Dec 30 22:25:13 2024 +0100 missing , commit 84b87bedadbd4d35190b1f4d6b3e4fc1abf2440a Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Dec 30 22:19:45 2024 +0100 fixing format commit bfaf72b3038c3c8cad6d5e68f9f2ad3a49c2a9fc Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Dec 30 21:52:34 2024 +0100 skip proxy for invidious companion commit f550359ae941d84cdaee0a966ed332354ef18f42 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Dec 30 21:52:07 2024 +0100 !empty? to present? commit e9c354d5a34df636306b1819dd17fff9e01b1a1e Author: Émilien (perso) <4016501+unixfox@users.noreply.github.com> Date: Tue Dec 24 17:43:54 2024 +0000 Better doc for invidious_companion_key commit 0dba7675a2c1d51988b3f2911a9fb3a1f91bae52 Author: Émilien (perso) <4016501+unixfox@users.noreply.github.com> Date: Tue Dec 24 16:18:58 2024 +0000 Better document private_url and public_url commit 1de20546182421e1280ec2b68c6d347abead7c54 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri Dec 13 20:08:57 2024 +0100 add ability for invidious companion to check request from invidious commit ab72bbad7afb7d143883a7d0610145f68c06bac8 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun Dec 8 22:24:57 2024 +0100 fix ameba Redundant use of `Object#to_s` in interpolation commit a571eeaa381523f5efb29dea0f5fe097f4f1252c Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun Dec 8 22:22:08 2024 +0100 format watch.cr commit f710dd37bf4327748b43067d75025cc915b5639c Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun Dec 8 22:21:10 2024 +0100 apply all the suggestions + rework invidious_companion parameter commit 7a070fa710b7807cdda061d413ca9369a0962353 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Nov 18 12:30:37 2024 +0100 invidious companion always used so always add CSP and redirect latest_version commit 1f51edd0b915ca64df7f195aa271f74c7ef093cb Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon Nov 18 12:22:23 2024 +0100 fix linting commit 734e72503f88f9741279ab385e86f5d2b340c71b Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun Nov 17 19:18:29 2024 +0100 fix download function when invidious companion used commit bb2e3b2a3e5f53610b9dd602f8507303ec641450 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun Nov 17 12:26:35 2024 +0100 crystal handle decompression already by itself commit b51770dbdbdcca04d04849d37e5f11ce20948c73 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat Nov 16 23:00:48 2024 +0100 fix linting + use .empty? commit 9f846127aea9b4f392acb062d662fff2cc58d1d0 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat Nov 16 22:38:00 2024 +0100 fixing "end" misplacement commit 1aa154b9787eddcdee960d06aed4c1c91f17c1c3 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sat Nov 16 22:33:28 2024 +0100 separate invidious_companion logic + better config.yaml config commit ff3305d52175c517b035d79b3c0c6a84809cbd0f Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri Nov 8 21:05:17 2024 +0100 move config checks for invidious companion commit 409df4cff3cc69c5565a12feb307441eed36f937 Author: Émilien (perso) <4016501+unixfox@users.noreply.github.com> Date: Tue Nov 5 15:50:59 2024 +0100 modify the description for config.example.yaml about invidious companion commit 27b24f51abcccd1c68f4dc1c29c0c62ca26e604c Author: Émilien (perso) <4016501+unixfox@users.noreply.github.com> Date: Tue Nov 5 15:31:45 2024 +0100 Remove debug puts functions Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> commit 1c9f5b0a2b38ad94fb8972764ffae98df1e41dc9 Author: Émilien (perso) <4016501+unixfox@users.noreply.github.com> Date: Tue Nov 5 15:31:21 2024 +0100 Use sample instead of Random.rand Co-authored-by: syeopite <70992037+syeopite@users.noreply.github.com> commit 2cc204a0457665f8e334970d7e54b1843a667ab6 Author: Emilien <4016501+unixfox@users.noreply.github.com> Date: Fri Nov 1 21:30:58 2024 +0100 throw error if inv_sig_helper and invidious_companion used same time commit c612423a4d64f0adbef135074fc55dcc1c362f84 Author: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Mon Oct 21 01:20:16 2024 +0200 fixing condition for Content-Security-Policy commit 195446337159d2cb92b48510af7311fe0cc0f5bb Author: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Sun Oct 20 23:53:08 2024 +0200 fix Shadowing outer local variable `response` commit 73c84baf9fa6eaf9c5d4981bc199f81306ebe5a2 Author: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Sun Oct 20 23:51:00 2024 +0200 redirect latest_version and dash manifest to invidious companion commit 3dff7a76cf9f64ec70aac0a057a3b0bfa1edfc82 Author: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Sun Oct 20 02:10:55 2024 +0200 add support for invidious companion
90 lines
4.3 KiB
Plaintext
90 lines
4.3 KiB
Plaintext
<video style="outline:none;width:100%;background-color:#000" playsinline poster="<%= thumbnail %>"
|
|
id="player" class="on-video_player video-js player-style-<%= params.player_style %>"
|
|
preload="<% if params.preload %>auto<% else %>none<% end %>"
|
|
<% if params.autoplay %>autoplay<% end %>
|
|
<% if params.video_loop %>loop<% end %>
|
|
<% if params.controls %>controls<% end %>>
|
|
<% if (hlsvp = video.hls_manifest_url) && !CONFIG.disabled?("livestreams") %>
|
|
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream">
|
|
<% else %>
|
|
<% if params.listen %>
|
|
<% # default to 128k m4a stream
|
|
best_m4a_stream_index = 0
|
|
best_m4a_stream_bitrate = 0
|
|
audio_streams.each_with_index do |fmt, i|
|
|
bandwidth = fmt["bitrate"].as_i
|
|
if (fmt["mimeType"].as_s.starts_with?("audio/mp4") && bandwidth > best_m4a_stream_bitrate)
|
|
best_m4a_stream_bitrate = bandwidth
|
|
best_m4a_stream_index = i
|
|
end
|
|
end
|
|
|
|
audio_streams.each_with_index do |fmt, i|
|
|
src_url = "/latest_version?id=#{video.id}&itag=#{fmt["itag"]}"
|
|
src_url += "&local=true" if params.local
|
|
src_url = video.invidious_companion["baseUrl"].as_s + src_url +
|
|
"&check=#{invidious_companion_encrypt(video.id)}" if (CONFIG.invidious_companion.present?)
|
|
|
|
bitrate = fmt["bitrate"]
|
|
mimetype = HTML.escape(fmt["mimeType"].as_s)
|
|
|
|
selected = (i == best_m4a_stream_index)
|
|
%>
|
|
<source src="<%= src_url %>" type='<%= mimetype %>' label="<%= bitrate %>k" selected="<%= selected %>">
|
|
<% if !params.local && !CONFIG.disabled?("local") %>
|
|
<source src="<%= src_url %>&local=true" type='<%= mimetype %>' hidequalityoption="true">
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<% if params.quality == "dash"
|
|
src_url = "/api/manifest/dash/id/" + video.id + "?local=true&unique_res=1"
|
|
src_url = video.invidious_companion["baseUrl"].as_s + src_url +
|
|
"&check=#{invidious_companion_encrypt(video.id)}" if (CONFIG.invidious_companion.present?)
|
|
%>
|
|
<source src="<%= src_url %>" type='application/dash+xml' label="dash">
|
|
<% end %>
|
|
|
|
<%
|
|
fmt_stream.reject! { |f| f["itag"] == 17 }
|
|
fmt_stream.sort_by! {|f| params.quality == f["quality"] ? 0 : 1 }
|
|
fmt_stream.each_with_index do |fmt, i|
|
|
src_url = "/latest_version?id=#{video.id}&itag=#{fmt["itag"]}"
|
|
src_url += "&local=true" if params.local
|
|
src_url = video.invidious_companion["baseUrl"].as_s + src_url +
|
|
"&check=#{invidious_companion_encrypt(video.id)}" if (CONFIG.invidious_companion.present?)
|
|
|
|
quality = fmt["quality"]
|
|
mimetype = HTML.escape(fmt["mimeType"].as_s)
|
|
|
|
selected = params.quality ? (params.quality == quality) : (i == 0)
|
|
%>
|
|
<source src="<%= src_url %>" type="<%= mimetype %>" label="<%= quality %>" selected="<%= selected %>">
|
|
<% if !params.local && !CONFIG.disabled?("local") %>
|
|
<source src="<%= src_url %>&local=true" type="<%= mimetype %>" hidequalityoption="true">
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% preferred_captions.each do |caption| %>
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name %>" label="<%= caption.name %>">
|
|
<% end %>
|
|
|
|
<% captions.each do |caption| %>
|
|
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption.name %>" label="<%= caption.name %>">
|
|
<% end %>
|
|
<% end %>
|
|
</video>
|
|
|
|
<script id="player_data" type="application/json">
|
|
<%=
|
|
{
|
|
"aspect_ratio" => aspect_ratio,
|
|
"title" => video.title,
|
|
"description" => HTML.escape(video.short_description),
|
|
"thumbnail" => thumbnail,
|
|
"preferred_caption_found" => !preferred_captions.empty?
|
|
}.to_pretty_json
|
|
%>
|
|
</script>
|
|
<script src="/js/player.js?v=<%= ASSET_COMMIT %>"></script>
|