From 546dc6825a53d06044b4047583dacb50731fb6da Mon Sep 17 00:00:00 2001
From: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
Date: Thu, 2 Sep 2021 19:16:27 +0530
Subject: [PATCH] Add support to Proxy LBRY and Disable LBRY.
Closes #403
Closes #402
---
src/components/Player.vue | 10 +++++++++-
src/components/Preferences.vue | 14 ++++++++++++++
src/locales/en.json | 4 +++-
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/components/Player.vue b/src/components/Player.vue
index 8b5aad47..2185e631 100644
--- a/src/components/Player.vue
+++ b/src/components/Player.vue
@@ -95,7 +95,9 @@ export default {
const MseSupport = window.MediaSource !== undefined;
- const lbry = this.video.videoStreams.filter(stream => stream.quality === "LBRY")[0];
+ const lbry = this.getPreferenceBoolean("disableLBRY", false)
+ ? null
+ : this.video.videoStreams.filter(stream => stream.quality === "LBRY")[0];
var uri;
@@ -112,6 +114,12 @@ export default {
} else uri = this.video.dash;
} else if (lbry) {
uri = lbry.url;
+ if (this.getPreferenceBoolean("proxyLBRY", false)) {
+ const url = new URL(uri);
+ url.searchParams.set("host", url.host);
+ url.host = new URL(this.video.proxyUrl).host;
+ uri = url.toString();
+ }
} else {
uri = this.video.videoStreams.filter(stream => stream.codec == null).slice(-1)[0].url;
}
diff --git a/src/components/Preferences.vue b/src/components/Preferences.vue
index 7da2e88f..12920582 100644
--- a/src/components/Preferences.vue
+++ b/src/components/Preferences.vue
@@ -106,6 +106,14 @@
+
+
+
+
+
+
+
+