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