add option to set youtube to patched
This commit is contained in:
parent
ce02ade61d
commit
f7e5ec529c
|
|
@ -28,13 +28,15 @@ app.get('/save', async ({ query: { url }, set, headers, error }) => {
|
|||
if (healthStatus[process.env.METADATA!] != 'healthy') {
|
||||
websocket = process.env.ALTERNATIVE_WEBSOCKET!
|
||||
}
|
||||
const ytPatched = (process.env.YT_PATCHED || '').toLowerCase() === 'true' || process.env.YT_PATCHED === '1'
|
||||
|
||||
set.headers['Content-Type'] = 'text/html; charset=utf-8'
|
||||
return await m(eta.render('./save', {
|
||||
title: 'Save Video | PreserveTube',
|
||||
websocket,
|
||||
sitekey: process.env.SITEKEY,
|
||||
url
|
||||
url,
|
||||
ytPatched
|
||||
}))
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<% layout('./layout') %>
|
||||
<% /* <div class="sorry">
|
||||
Saving videos should be stable again. Will try some more experiments in the coming days.
|
||||
</div> */ %>
|
||||
<% if (it.ytPatched) { %>
|
||||
<div class="sorry">
|
||||
YouTube changed something, which caused saving to stop working. Will fix it ASAP.
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<div id="backdrop" style="display: none;">
|
||||
<div id="save-intro-dialog">
|
||||
|
|
@ -27,6 +29,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<% if (!it.ytPatched) { %>
|
||||
<div id="logs" class="logs">
|
||||
<h1 id="title"></h1>
|
||||
<div class="captcha" id="captcha"></div>
|
||||
|
|
@ -34,7 +37,9 @@
|
|||
<noscript>This feature doesen't function properly unless JavaScript is enabled.</noscript>
|
||||
</h3>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<% if (!it.ytPatched) { %>
|
||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||
<script>
|
||||
const url = "<%= it.url %>"
|
||||
|
|
@ -141,17 +146,17 @@
|
|||
|
||||
runFirstSaveGate()
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<style>
|
||||
.sorry {
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
background-color: #cfeeffff;
|
||||
border-top: 2px dashed #5ebbdaff;
|
||||
border-bottom: 2px dashed #5ebbdaff;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
margin: 24px auto 80px auto;
|
||||
width: min(760px, calc(100vw - 28px));
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
font-size: 1.15rem;
|
||||
font-weight: 400;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#backdrop {
|
||||
|
|
|
|||
Loading…
Reference in New Issue