OAuth fix lock from web app in case Invidious instance is not Playlet backend
This commit is contained in:
1 parent
dcadb1ec17
commit
32f0477f36
1 file changed
+9
-11
@@ -67,7 +67,11 @@ namespace Invidious
|
|||||||
end function
|
end function
|
||||||
|
|
||||||
function GetInstance() as string
|
function GetInstance() as string
|
||||||
instance = m.GetInstanceFromPreferences()
|
if m.preferences = invalid
|
||||||
|
m.preferences = m.invidiousNode.preferences
|
||||||
|
end if
|
||||||
|
instance = m.preferences["invidious.instance"]
|
||||||
|
|
||||||
if not StringUtils.IsNullOrEmpty(instance)
|
if not StringUtils.IsNullOrEmpty(instance)
|
||||||
return instance
|
return instance
|
||||||
end if
|
end if
|
||||||
@@ -81,13 +85,6 @@ namespace Invidious
|
|||||||
return instance
|
return instance
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function GetInstanceFromPreferences() as string
|
|
||||||
if m.preferences = invalid
|
|
||||||
m.preferences = m.invidiousNode.preferences
|
|
||||||
end if
|
|
||||||
return m.preferences["invidious.instance"]
|
|
||||||
end function
|
|
||||||
|
|
||||||
function MarkVideoWatched(videoId as dynamic) as void
|
function MarkVideoWatched(videoId as dynamic) as void
|
||||||
if StringUtils.IsNullOrEmpty(videoId)
|
if StringUtils.IsNullOrEmpty(videoId)
|
||||||
return
|
return
|
||||||
@@ -392,12 +389,13 @@ namespace Invidious
|
|||||||
return request.Await()
|
return request.Await()
|
||||||
end if
|
end if
|
||||||
|
|
||||||
isDefaultInstance = StringUtils.IsNullOrEmpty(m.GetInstanceFromPreferences())
|
url = request.BuildUrl()
|
||||||
if not isDefaultInstance
|
isUrlToLocalServer = url.StartsWith("http://127.0.0.1:8888") or url.StartsWith(m.invidiousNode.webServer@.GetServerAddress())
|
||||||
|
if not isUrlToLocalServer
|
||||||
return request.Await()
|
return request.Await()
|
||||||
end if
|
end if
|
||||||
|
|
||||||
parsedUrl = UrlUtils.ParseUrl(request.BuildUrl())
|
parsedUrl = UrlUtils.ParseUrl(url)
|
||||||
method = request.GetMethod()
|
method = request.GetMethod()
|
||||||
uri = parsedUrl.path
|
uri = parsedUrl.path
|
||||||
headers = request.GetHeaders()
|
headers = request.GetHeaders()
|
||||||
|
|||||||
Reference in new issue
Block a user