Skip to content

Commit

Permalink
Change the Proxy Videos Through Invidious setting to only apply when …
Browse files Browse the repository at this point in the history
…using the Invidious API (#5758)

* Change the Proxy Videos Through Invidious setting to only apply when using the Invidious API

* Disable Proxy Videos Through Invidious switch when it cannot be used
  • Loading branch information
absidue authored Sep 30, 2024
1 parent d12901a commit 8e34d19
Show file tree
Hide file tree
Showing 39 changed files with 48 additions and 74 deletions.
8 changes: 8 additions & 0 deletions src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export default defineComponent({
return this.$store.getters.getBackendPreference
},

backendFallback: function () {
return this.$store.getters.getBackendFallback
},

autoplayVideos: function () {
return this.$store.getters.getAutoplayVideos
},
Expand All @@ -87,6 +91,10 @@ export default defineComponent({
return this.$store.getters.getProxyVideos
},

showProxyVideosAsDisabled: function () {
return this.backendPreference !== 'invidious' && !this.backendFallback
},

defaultSkipInterval: function () {
return parseInt(this.$store.getters.getDefaultSkipInterval)
},
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/player-settings/player-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<ft-toggle-switch
:label="$t('Settings.Player Settings.Proxy Videos Through Invidious')"
:compact="true"
:default-value="proxyVideos"
:default-value="showProxyVideosAsDisabled ? false : proxyVideos"
:disabled="showProxyVideosAsDisabled"
:tooltip="$t('Tooltips.Player Settings.Proxy Videos Through Invidious')"
@change="updateProxyVideos"
/>
Expand Down
29 changes: 3 additions & 26 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,16 +518,8 @@ export default defineComponent({
// this.manifestSrc = src
// this.manifestMimeType = MANIFEST_TYPE_DASH
// } else {
let hlsManifestUrl = result.streaming_data.hls_manifest_url

if (this.proxyVideos) {
const url = new URL(hlsManifestUrl)
url.searchParams.set('local', 'true')

hlsManifestUrl = url.toString().replace(url.origin, this.currentInvidiousInstanceUrl)
}

this.manifestSrc = hlsManifestUrl
this.manifestSrc = result.streaming_data.hls_manifest_url
this.manifestMimeType = MANIFEST_TYPE_HLS
// }
}
Expand Down Expand Up @@ -595,12 +587,6 @@ export default defineComponent({

if (result.streaming_data.formats.length > 0) {
this.legacyFormats = result.streaming_data.formats.map(mapLocalLegacyFormat)

if (this.proxyVideos) {
this.legacyFormats.forEach(format => {
format.url = getProxyUrl(format.url)
})
}
}

/** @type {import('../../helpers/api/local').LocalFormat[]} */
Expand Down Expand Up @@ -700,17 +686,8 @@ export default defineComponent({
})
?.projection_type ?? null

// When `this.proxyVideos` is true
// It's possible that the Invidious instance used, only supports a subset of the formats from Local API
// i.e. the value passed into `adaptiveFormats`
// e.g. Supports 720p60, but not 720p - https://[DOMAIN_NAME]/api/manifest/dash/id/v3wm83zoSSY?local=true
if (this.proxyVideos) {
this.manifestSrc = await this.createInvidiousDashManifest()
this.manifestMimeType = MANIFEST_TYPE_DASH
} else {
this.manifestSrc = await this.createLocalDashManifest(result)
this.manifestMimeType = MANIFEST_TYPE_DASH
}
this.manifestSrc = await this.createLocalDashManifest(result)
this.manifestMimeType = MANIFEST_TYPE_DASH
} else {
this.manifestSrc = null
this.enableLegacyFormat()
Expand Down
3 changes: 1 addition & 2 deletions static/locales/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1121,8 +1121,7 @@ Tooltips:
да показват видеа с по-високо качество. Старите формати са ограничени до макс.
720р, но пък генерират по-малък трафик. Аудио форматите предават само звук.
Proxy Videos Through Invidious: Ще се свърже с Invidious, за да изтегли видеото,
вместо да прави дирекна връзка с YouTube. Пренебрегва настройките на локалния
интерфейс.
вместо да прави дирекна връзка с YouTube.
Scroll Playback Rate Over Video Player: Докато курсорът е върху видеото, натиснете
и задръжте клавиша Control (Command Key за Mac) и превъртете колелцето на мишката
напред или назад, за да контролирате скоростта на възпроизвеждане. Натиснете
Expand Down
2 changes: 1 addition & 1 deletion static/locales/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ Tooltips:
prohlížeči.\n"
Player Settings:
Proxy Videos Through Invidious: 'Připojí se k Invidious, aby poskytoval videa
namísto přímého připojení k YouTube. Toto přepíše předvolby API.'
namísto přímého připojení k YouTube.'
Default Video Format: 'Nastavte formáty použité při přehrávání videa. Formáty
DASH umožní přehrávat vyšší kvality. Starší formáty jsou omezeny na maximálně
720p, ale používají menší šířku pásma. Zvukové formáty jsou streamy obsahující
Expand Down
2 changes: 1 addition & 1 deletion static/locales/da.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ Tooltips:
kan afspille med højere kvalitet. Gamle formater er begrænsede til maks HD,
men bruger mindre båndbredde. Lydformater er lydstrømme kun med lyd.
Proxy Videos Through Invidious: Vil forbinde til Invidious for at vise videoer
i stedet for at oprette en direkte forbindelse til YouTube. Tilsidesætter API-præference.
i stedet for at oprette en direkte forbindelse til YouTube.
Scroll Playback Rate Over Video Player: Mens markøren er over videoen, tryk og
hold Control-tasten (Command-tast på Mac) nede og scroll musehjulet fremad og
bagud for at kontrollere afspilningshastigheden. Tryk og hold Control-tasten
Expand Down
3 changes: 1 addition & 2 deletions static/locales/de-DE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1188,8 +1188,7 @@ Tooltips:
sind auf maximal 720p beschränkt, verbrauchen aber weniger Bandbreite. Audioformate
sind reine Audiostreams.
Proxy Videos Through Invidious: Stellt eine Verbindung zu Invidious her, um Videos
bereitzustellen, anstatt eine direkte Verbindung zu YouTube herzustellen. Setzt
die API-Einstellung außer Kraft.
bereitzustellen, anstatt eine direkte Verbindung zu YouTube herzustellen.
Scroll Playback Rate Over Video Player: Während sich der Cursor über dem Video
befindet, halte die Strg-Taste (Befehlstaste auf dem Mac) gedrückt und bewege
das Mausrad vorwärts oder rückwärts, um die Abspielgeschwindigkeit zu steuern.
Expand Down
3 changes: 1 addition & 2 deletions static/locales/el.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,7 @@ Tooltips:
μορφές περιορίζονται σε μέγιστο ανάλυσης 720p αλλά χρησιμοποιούν λιγότερους
πόρους. Οι μορφές ήχου περιλαμβάνουν ροές μόνο ήχου.
Proxy Videos Through Invidious: Θα συνδεθεί με το Invidious για να εξυπηρετήσει
τα βίντεο αντί να κάνει μια άμεση σύνδεση με το YouTube. Παράκαμψη προτίμησης
API.
τα βίντεο αντί να κάνει μια άμεση σύνδεση με το YouTube.
Scroll Playback Rate Over Video Player: Ενώ ο δρομέας βρίσκεται πάνω από το βίντεο,
πατήστε και κρατήστε πατημένο το πλήκτρο Control (Command Key σε Mac) και μετακινηθείτε
με τον τροχό του ποντικιού προς τα εμπρός ή προς τα πίσω για να ελέγξετε το
Expand Down
2 changes: 1 addition & 1 deletion static/locales/en-GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ Tooltips:
play higher qualities. Legacy formats are limited to a max of 720p but use less
bandwidth. Audio formats are audio only streams.
Proxy Videos Through Invidious: Will connect to Invidious to serve videos instead
of making a direct connection to YouTube. Overrides API preference.
of making a direct connection to YouTube.
Scroll Playback Rate Over Video Player: While the cursor is over the video, press
and hold the Control key (Command Key on Mac) and scroll the mouse wheel forwards
or backwards to control the playback rate. Press and hold the Control key (Command
Expand Down
2 changes: 1 addition & 1 deletion static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ Tooltips:
By default FreeTube will open the clicked link in your default browser.
Player Settings:
Proxy Videos Through Invidious: Will connect to Invidious to serve videos instead
of making a direct connection to YouTube. Overrides API preference.
of making a direct connection to YouTube.
Default Video Format: Set the formats used when a video plays. DASH formats can
play higher qualities. Legacy formats are limited to a max of 720p but use less
bandwidth. Audio formats are audio only streams.
Expand Down
2 changes: 1 addition & 1 deletion static/locales/es-MX.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ Tooltips:
etc.).
Player Settings:
Proxy Videos Through Invidious: Se conectará a Invidious para obtener videos en
lugar de conectarse directamente a YouTube. Anulará la API seleccionada.
lugar de conectarse directamente a YouTube.
Default Video Format: Establezca los formatos a usar cuando reproduce un video.
Los formatos DASH pueden alcanzar mejores calidades. Los formatos heredados
están limitados a un máximo de 720 píxeles de ancho, pero usan menos ancho de
Expand Down
3 changes: 1 addition & 2 deletions static/locales/es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,7 @@ Tooltips:
a 720p, pero requiere menos ancho de banda. El formato del audio se limita al
reproducir solo audio.
Proxy Videos Through Invidious: Se conectará a Invidious para obtener vídeos en
lugar de conectar directamente con YouTube. Sobreescribirá la preferencia de
API.
lugar de conectar directamente con YouTube.
Scroll Playback Rate Over Video Player: Cuando el cursor esté sobre el vídeo,
presiona y mantén la tecla Control (Comando en Mac) y desplaza la rueda del
ratón hacia arriba o abajo para cambiar la velocidad de reproducción. Presiona
Expand Down
2 changes: 1 addition & 1 deletion static/locales/et.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ Tooltips:
parem kvaliteet. Pärandvormingute kvaliteedi ülempiir on 720p ja seetõttu kasutavad
nad vähem ribalaiust. Helivormingud kehtivad vaid helifailide jaoks.
Proxy Videos Through Invidious: Kasutab videote esitamiseks Invidious'e teenust
ega tee päringuid otse YouTube serveri pihta. Asendab API eelistuse.
ega tee päringuid otse YouTube serveri pihta.
Scroll Playback Rate Over Video Player: Kui kursor on video kohal, siis vajuta
Ctrl klahvi (Mac'is ⌘ klahvi) ja taasesituse kiiruse muutmiseks keri hiireratast
edasi ja tagasi. Tavakiiruse taastamiseks (kui sa seda seadistustest pole muutnud,
Expand Down
3 changes: 1 addition & 2 deletions static/locales/eu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ Tooltips:
nabigatazailean irekiko du klikatutako esteka.\n"
Player Settings:
Proxy Videos Through Invidious: 'Bideoak hornitzeko Invidious-era konektatuko
da, YouTube-ra zuzeneko konexioa egin beharrean. APIaren hobespena gainidazten
du.'
da, YouTube-ra zuzeneko konexioa egin beharrean.'
Default Video Format: 'Erabiliko diren formatuak ezarri bideo bat erreproduzitzerakoan.
DASH formatuek kalitate handiagoak onartzen dituzte. Bestalde, Legacy formatuak
720 puntutara mugatuta badaude ere banda zabalera gutxiago kontsumitzen dute.
Expand Down
2 changes: 1 addition & 1 deletion static/locales/fi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ Tooltips:
toistavat korkealaatuisempia videoita. Legacy-formaatit ovat rajoitettu 720p-resoluutioon,
mutta käyttävät vähemmän dataa. Audioformaatit ovat vain äänistriimeihin.
Proxy Videos Through Invidious: Yhdistää Invidious-palvelimeen suoran YouTuben-yhteyden
sijaan. Ohittaa API-valinnan.
sijaan.
Scroll Playback Rate Over Video Player: Kursorin ollessa videon päällä, paina
CTRL (Komentopainike MAC-tietokoneessa) pohjaan ja käytä hiiren rullaa muuttaaksesi
toiston nopeutta. Palataksesi alkuperäiseen toistonopeuteen (1x ellei toisin
Expand Down
3 changes: 1 addition & 2 deletions static/locales/fr-FR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,7 @@ Tooltips:
sont limités à un maximum de 720p mais utilisent moins de bande passante. Les
formats audio sont des flux audio uniquement.
Proxy Videos Through Invidious: Se connectera à Invidious pour lire des vidéos
au lieu d'établir une connexion directe avec YouTube. Remplace les préférences
de l'API.
au lieu d'établir une connexion directe avec YouTube.
Scroll Playback Rate Over Video Player: Lorsque le curseur se trouve sur la vidéo,
maintenez la touche Contrôle (touche Commande sur Mac) enfoncée et faites défiler
la molette de la souris vers l'avant ou l'arrière pour contrôler la vitesse
Expand Down
2 changes: 1 addition & 1 deletion static/locales/gl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ Tooltips:
FreeTube abrirá a ligazón na que premeches no teu navegador predeterminado.\n"
Player Settings:
Proxy Videos Through Invidious: 'Conectarase a Invidious para obter vídeos no
canto de recorrer directamente a YouTube. Sobrescribirá a preferencia de API.'
canto de recorrer directamente a YouTube.'
Default Video Format: 'Establecelos formatos utilizados cando se reproduce un
vídeo. Os formatos DASH poden reproducir calidades superiores. Os formatos legados
están limitados a un máximo de 720p pero usan menos ancho de banda. Os formatos
Expand Down
2 changes: 1 addition & 1 deletion static/locales/hr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ Tooltips:
reproducirati višu kvalitetu slike. Stari formati su ograničeni na 720 p, ali
su zato brži. Audioformati sadrže samo prijenose audiosnimaka.
Proxy Videos Through Invidious: Za reprodukciju videa povezat će se s Invidiousom
umjesto izravnog povezivanja s YouTubeom. Zanemaruje postavke sučelja.
umjesto izravnog povezivanja s YouTubeom.
Scroll Playback Rate Over Video Player: Dok se pokazivač nalazi na videu, pritisni
i drži tipku Control (Command tipka na Macu) i pomiči kotačić miša naprijed
ili natrag za upravljanje brzine reprodukcije. Pritisni i drži tipku Control
Expand Down
2 changes: 1 addition & 1 deletion static/locales/hu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ Tooltips:
csak hang-adatfolyamok.
Proxy Videos Through Invidious: Csatlakozik az Invidious szolgáltatáshoz, hogy
videókat szolgáltasson, ahelyett, hogy közvetlen kapcsolatot létesítene a YouTube
szolgáltatással. Felülbírálja az API beállítást.
szolgáltatással.
Scroll Playback Rate Over Video Player: Amíg a kurzor a videó felett van, nyomja
meg és tartsa lenyomva a Control billentyűt (Mac gépen a Command billentyű),
és görgesse az egér görgőjét előre vagy hátra a lejátszási sebesség szabályozásához.
Expand Down
1 change: 0 additions & 1 deletion static/locales/id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@ Tooltips:
lebih tinggi. Format lama terbatas ke maks 720p tetapi dengan bandwidth yang
lebih rendah. Format audio hanya berisi stream audio.
Proxy Videos Through Invidious: Akan menyambung ke Invidious daripada YouTube.
Menimpa preferensi API.
Scroll Playback Rate Over Video Player: Ketika kursor berada di atas video, tekan
dan tahan tombol Control (tombol Command di Mac) dan scroll roda mouse ke depan
atau ke belakang untuk mengontrol laju pemutaran. Tekan dan tahan tombol Control
Expand Down
2 changes: 1 addition & 1 deletion static/locales/is.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ Tooltips:
í sjálfgefna vafranum þínum.\n"
Player Settings:
Proxy Videos Through Invidious: 'Mun tengjast við Invidious til að miðla myndskeiðum
í stað þess að tengjast beint við YouTube. Tekur fram fyrir valin API-kerfisviðmót.'
í stað þess að tengjast beint við YouTube.'
Default Video Format: 'Stillu skráasniðin sem notuð eru við afspilun myndskeiða.
DASH-snið (Dynamic Adaptive Streaming over HTTP) er hægt að spila í meiri gæðum.
Eldri snið takmarkast við 720p en nota minni bandbreidd. Hljóðsnið eru streymi
Expand Down
2 changes: 1 addition & 1 deletion static/locales/it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ Tooltips:
limitati ad un massimo di 720p ma usano meno banda. I formati audio riproducono
solo l'audio.
Proxy Videos Through Invidious: Connessione a Invidious per riprodurre i video
invece di una connessione diretta a YouTube. Sovrascrive le preferenze API.
invece di una connessione diretta a YouTube.
Scroll Playback Rate Over Video Player: Mentre il cursore è sopra il video, tieni
premuto il tasto CTRL (Command su Mac) e scorri la rotella del mouse in avanti
o indietro per controllare la velocità di riproduzione. Tieni premuto il tasto
Expand Down
3 changes: 1 addition & 2 deletions static/locales/lt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,7 @@ Tooltips:
atidarys spustelėtą nuorodą numatytojoje naršyklėje.\n"
Player Settings:
Proxy Videos Through Invidious: 'Bus prisijungęs prie „Invidious“, kad galėtų
teikti vaizdo įrašus, užuot užmezgęs tiesioginį ryšį su „YouTube“. Nepaiso API
nuostatų.'
teikti vaizdo įrašus, užuot užmezgęs tiesioginį ryšį su „YouTube“.'
Default Video Format: 'Nustatykite vaizdo įrašo atkūrimo formatus. DASH formatai
gali rodyti aukštesnes kokybės vaizdo įrašus. Senieji formatai (Legacy) gali
būti ne daugiau kaip 720p kokybės, tačiau jie reikalauja mažesnių tinklo resursų.
Expand Down
2 changes: 1 addition & 1 deletion static/locales/nb-NO.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ Tooltips:
kan spille høyere kvaliteter. Foreldede formater er begrenset til maks. 720p,
men bruker mindre båndbredde. Lydformater er kun lydstrømmer.
Proxy Videos Through Invidious: Kobler til Invidious for å servere videoer istedenfor
å koble direkte til YouTube. Overstyrer API-innstillinger.
å koble direkte til YouTube.
Skip by Scrolling Over Video Player: Bruk rullehjulet for å hoppe deg gjennom
videoen i MPV-stil.
Scroll Playback Rate Over Video Player: Når pekeren er over videoen kan du trykke
Expand Down
2 changes: 1 addition & 1 deletion static/locales/nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ Tooltips:
alleen het geluid streamen.
Proxy Videos Through Invidious: FreeTube zal verbinden met Invidious en daar de
video's downloaden in de plaats van de video's rechtstreeks bij YouTube vandaan
te halen. Dit overschrijft de ingestelde API voorkeur.
te halen.
Scroll Playback Rate Over Video Player: Terwijl de muis zich over de video bevindt,
houd de Control-toets (Command-toets op Mac) ingedrukt en scroll met de muis
om de afspeelsnelheid te besturen. Houd de Control-toets (Command-toets op Mac)
Expand Down
2 changes: 1 addition & 1 deletion static/locales/nn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ Tooltips:
standardnettlesar.\n"
Player Settings:
Proxy Videos Through Invidious: 'Koplar til Invidious for å servere videoar i
staden for å kople direkte til YouTube. Overstyrar API-innstillingar.'
staden for å kople direkte til YouTube.'
Default Video Format: 'Sett format som blir brukt når ein video spelast. DASH-format
kan spele høgare kvalitet. Utdaterte format er avgrensa til maks 720p, men bruker
mindre bandbreidde. Lydformat er berre for lydstraumar.'
Expand Down
2 changes: 1 addition & 1 deletion static/locales/pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ Tooltips:
Formaty DASH obsługują wyższe rozdzielczości. Stare formaty są ograniczone do
720p, ale zużywają mniej przepustowości. Formaty audio odtwarzają tylko dźwięk.
Proxy Videos Through Invidious: Będzie dostarczał filmy, łącząc się z Invidious,
a nie bezpośrednio z YouTube. Nadpisuje ustawienia API.
a nie bezpośrednio z YouTube.
Scroll Playback Rate Over Video Player: Umieść kursor nad odtwarzaczem, przytrzymaj
klawisz „Ctrl” („Command” na Mac-u) i przewijaj kółkiem myszy w górę i w dół,
aby kontrolować szybkość odtwarzania. Przytrzymaj klawisz „Ctrl” („Command”
Expand Down
3 changes: 1 addition & 2 deletions static/locales/pt-BR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,7 @@ Tooltips:
limitados a um máximo de 720p, mas usam menos largura de banda. Formatos de
áudio são para transmissões sem vídeo.
Proxy Videos Through Invidious: Estabelece uma conexão ao Invidious para obter
vídeos em vez de fazer uma conexão direta com o YouTube. Ignora a preferência
da API.
vídeos em vez de fazer uma conexão direta com o YouTube.
Scroll Playback Rate Over Video Player: Com o cursor sobre o vídeo, pressione
e segure a tecla Ctrl (tecla Command no Mac) e role a roda do mouse para frente
ou para trás para controlar a taxa de reprodução. Pressione e segure a tecla
Expand Down
Loading

0 comments on commit 8e34d19

Please sign in to comment.