Remove not needed utils
This commit is contained in:
1 parent
9848c2a31a
commit
ee29d7a4b3
5 files changed
+7
-25
No files matched your search
@@ -28,7 +28,7 @@ namespace Http
|
|||||||
|
|
||||||
path_in_route = request.route.Mid(router.route.Len())
|
path_in_route = request.route.Mid(router.route.Len())
|
||||||
|
|
||||||
decoded_path = WebUtils.UrlUnescape(path_in_route)
|
decoded_path = path_in_route.DecodeUri()
|
||||||
full_path = PathJoin(router.root, decoded_path)
|
full_path = PathJoin(router.root, decoded_path)
|
||||||
|
|
||||||
path = CreateObject("roPath", full_path)
|
path = CreateObject("roPath", full_path)
|
||||||
@@ -142,7 +142,7 @@ namespace Http
|
|||||||
listing = listing + "<title>" + response.settings.ServerName + "</title>" + UnixNL()
|
listing = listing + "<title>" + response.settings.ServerName + "</title>" + UnixNL()
|
||||||
listing = listing + "</head>" + UnixNL()
|
listing = listing + "</head>" + UnixNL()
|
||||||
listing = listing + "<body>" + UnixNL()
|
listing = listing + "<body>" + UnixNL()
|
||||||
listing = listing + "<h1>" + WebUtils.URLUnescape(request.uri) + "</h1>" + UnixNL()
|
listing = listing + "<h1>" + request.uri.DecodeUri() + "</h1>" + UnixNL()
|
||||||
listing = listing + "<tt><pre>" + UnixNL()
|
listing = listing + "<tt><pre>" + UnixNL()
|
||||||
|
|
||||||
dir = path.getString()
|
dir = path.getString()
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ namespace Http
|
|||||||
|
|
||||||
if request.query["token"] <> invalid and request.query["referer"] <> invalid
|
if request.query["token"] <> invalid and request.query["referer"] <> invalid
|
||||||
' Token is encoded twice for some reason
|
' Token is encoded twice for some reason
|
||||||
token = WebUtils.UrlUnescape(request.query["token"]).DecodeUriComponent()
|
token = request.query["token"].DecodeUri().DecodeUriComponent()
|
||||||
referer = WebUtils.UrlUnescape(request.query["referer"])
|
referer = request.query["referer"].DecodeUri()
|
||||||
InvidiousSettings.SetAuthToken(token, referer)
|
InvidiousSettings.SetAuthToken(token, referer)
|
||||||
server.task.top.login = true
|
server.task.top.login = true
|
||||||
end if
|
end if
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ namespace Invidious
|
|||||||
webServerPort = 8888
|
webServerPort = 8888
|
||||||
expire = TimeUtils.Now().AsSeconds() + 60 * 60 * 24 * 365 * 2 '2 years from now
|
expire = TimeUtils.Now().AsSeconds() + 60 * 60 * 24 * 365 * 2 '2 years from now
|
||||||
|
|
||||||
callbackUrl = WebUtils.UrlEscape(`http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?referer=${instance}`)
|
callbackUrl = `http://${localIp}:${webServerPort}${Invidious.TOKEN_CALLBACK}?referer=${instance}`.EncodeUriComponent()
|
||||||
return `${invidiousHost}/authorize_token?scopes=${Invidious.AUTH_SCOPE}&callback_url=${callbackUrl}&expire=${expire}`
|
return `${invidiousHost}/authorize_token?scopes=${Invidious.AUTH_SCOPE}&callback_url=${callbackUrl}&expire=${expire}`
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ namespace SponsorBlock
|
|||||||
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "chapter", "filler", "exclusive_access"]
|
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "chapter", "filler", "exclusive_access"]
|
||||||
actionTypes = ["skip", "mute", "chapter", "full", "poi"]
|
actionTypes = ["skip", "mute", "chapter", "full", "poi"]
|
||||||
|
|
||||||
categoriesJson = WebUtils.UrlEscape(FormatJson(categories))
|
categoriesJson = FormatJson(categories).EncodeUriComponent()
|
||||||
actionTypesJson = WebUtils.UrlEscape(FormatJson(actionTypes))
|
actionTypesJson = FormatJson(actionTypes).EncodeUriComponent()
|
||||||
|
|
||||||
' From SponsorBlock docs: It should be the first 4 - 32 characters (4 is recommended).
|
' From SponsorBlock docs: It should be the first 4 - 32 characters (4 is recommended).
|
||||||
hashPrefix = GetSha256(videoId).Left(4)
|
hashPrefix = GetSha256(videoId).Left(4)
|
||||||
|
|||||||
@@ -1,24 +1,6 @@
|
|||||||
import "pkg:/source/utils/Types.bs"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
namespace WebUtils
|
namespace WebUtils
|
||||||
function UrlEscape(url as string) as string
|
|
||||||
ue = m.UrlEncoder
|
|
||||||
if ue = invalid
|
|
||||||
ue = CreateObject("roUrlTransfer")
|
|
||||||
m.UrlEncoder = ue
|
|
||||||
end if
|
|
||||||
return ue.escape(url)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function UrlUnescape(url as string) as string
|
|
||||||
ue = m.UrlEncoder
|
|
||||||
if ue = invalid
|
|
||||||
ue = CreateObject("roUrlTransfer")
|
|
||||||
m.UrlEncoder = ue
|
|
||||||
end if
|
|
||||||
return ue.unescape(url)
|
|
||||||
end function
|
|
||||||
|
|
||||||
function UrlQueryComponents(url as string) as object
|
function UrlQueryComponents(url as string) as object
|
||||||
query = {}
|
query = {}
|
||||||
index = Instr(0, url, "?")
|
index = Instr(0, url, "?")
|
||||||
|
|||||||
Reference in new issue
Block a user