[refactor] web server routing system (#270)
* [refactor] web server routing system * regex literal * Docs
This commit is contained in:
1 parent
a710a23444
commit
7e5b2246fa
25 files changed
+820
-656
No files matched your search
@@ -14,7 +14,7 @@ function GetLatestPlayletLibVersionFromGithubReleases() as string
|
||||
if response.StatusCode() = 200
|
||||
headers = response.Headers()
|
||||
if headers.location <> invalid
|
||||
regex = CreateObject("roRegex", "/v?(\d+\.\d+\.\d+)", "")
|
||||
regex = /\/v?(\d+\.\d+\.\d+)/
|
||||
match = regex.match(headers.location)
|
||||
if match.Count() = 2
|
||||
return match[1]
|
||||
|
||||
@@ -8,9 +8,11 @@ class DashManifest
|
||||
public invidiousInstance as dynamic
|
||||
|
||||
function new(invidiousInstance as string)
|
||||
m.utils = new Http.Utils()
|
||||
m.invidiousInstance = invidiousInstance
|
||||
|
||||
m.utils = new Http.Utils()
|
||||
m.urlRegex = /https?:\/\/\S+(\/\S+)/i
|
||||
|
||||
' https://github.com/LuanRT/YouTube.js/blob/6082b4a52ee07a622735e6e9128a0531a5ae3bfb/src/utils/StreamingInfo.ts#L332-L349
|
||||
m.colorInfo = {
|
||||
primaries: {
|
||||
@@ -35,10 +37,8 @@ class DashManifest
|
||||
adaptiveFormats.Append (metadata.adaptiveFormats)
|
||||
|
||||
if local
|
||||
urlRegex = CreateObject("roRegex", "https?:\/\/\S+(\/\S+)", "i")
|
||||
|
||||
for i = 0 to adaptiveFormats.Count() - 1
|
||||
adaptiveFormats[i].url = urlRegex.replace(adaptiveFormats[i].url, m.invidiousInstance + "\1")
|
||||
adaptiveFormats[i].url = m.urlRegex.replace(adaptiveFormats[i].url, m.invidiousInstance + "\1")
|
||||
end for
|
||||
end if
|
||||
|
||||
|
||||
Reference in new issue
Block a user