Don't decipher urls on live videos
This commit is contained in:
1 parent
638ce18aa8
commit
f16681adeb
1 file changed
+7
-4
@@ -85,6 +85,7 @@ namespace Innertube
|
|||||||
end if
|
end if
|
||||||
|
|
||||||
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
|
lengthSeconds = videoDetails["lengthSeconds"].ToInt()
|
||||||
|
isLive = ValidBool(videoDetails["isLive"])
|
||||||
|
|
||||||
videoInfo = {
|
videoInfo = {
|
||||||
"type": "video"
|
"type": "video"
|
||||||
@@ -95,10 +96,10 @@ namespace Innertube
|
|||||||
"author": videoDetails["author"]
|
"author": videoDetails["author"]
|
||||||
"authorId": videoDetails["channelId"]
|
"authorId": videoDetails["channelId"]
|
||||||
"lengthSeconds": lengthSeconds
|
"lengthSeconds": lengthSeconds
|
||||||
"liveNow": ValidBool(videoDetails["isLive"])
|
"liveNow": isLive
|
||||||
"hlsUrl": streamingData["hlsManifestUrl"]
|
"hlsUrl": streamingData["hlsManifestUrl"]
|
||||||
"dashUrl": streamingData["dashManifestUrl"]
|
"dashUrl": streamingData["dashManifestUrl"]
|
||||||
"adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, cancellation)
|
"adaptiveFormats": ParseAdaptiveFormats(payload, signatureTimestamp, isLive, cancellation)
|
||||||
"hasDecodedDashUrls": true
|
"hasDecodedDashUrls": true
|
||||||
"formatStreams": []
|
"formatStreams": []
|
||||||
"captions": ParseCaptions(payload)
|
"captions": ParseCaptions(payload)
|
||||||
@@ -288,13 +289,15 @@ namespace Innertube
|
|||||||
return captions
|
return captions
|
||||||
end function
|
end function
|
||||||
|
|
||||||
function ParseAdaptiveFormats(payload as object, signatureTimestamp as dynamic, cancellation as object) as object
|
function ParseAdaptiveFormats(payload as object, signatureTimestamp as dynamic, isLive as boolean, cancellation as object) as object
|
||||||
adaptiveFormats = ObjectUtils.Dig(payload, ["streamingData", "adaptiveFormats"])
|
adaptiveFormats = ObjectUtils.Dig(payload, ["streamingData", "adaptiveFormats"])
|
||||||
if not IsArray(adaptiveFormats)
|
if not IsArray(adaptiveFormats)
|
||||||
return []
|
return []
|
||||||
end if
|
end if
|
||||||
|
|
||||||
adaptiveFormats = DecipherUrls(adaptiveFormats, signatureTimestamp, cancellation)
|
if not isLive
|
||||||
|
adaptiveFormats = DecipherUrls(adaptiveFormats, signatureTimestamp, cancellation)
|
||||||
|
end if
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for each fmt in adaptiveFormats
|
for each fmt in adaptiveFormats
|
||||||
|
|||||||
Reference in new issue
Block a user