Remove OTF DRM probe

This commit is contained in:
Brahim Hadriche committed 2026-10-18 10:12:24 -04:00
1 parent 1b0466ad44
commit d6c776fbd5
4 files changed
+14 -109

No files matched your search

@@ -1,5 +1,6 @@
import "pkg:/components/Services/Innertube/Context.bs"
import "pkg:/components/Services/Innertube/OTFDrmProbe.bs"
import "pkg:/source/services/HttpClient.bs"
import "pkg:/source/utils/UrlUtils.bs"
namespace Innertube
@@ -18,11 +19,10 @@ namespace Innertube
const OTF_MAX_REQUEST_COUNT = 8
function OTFGetSegmentInfo(adaptiveFormats as object, client as Innertube.ClientType, cancellation as object, playerResponseText as string) as void
function OTFGetSegmentInfo(adaptiveFormats as object, client as Innertube.ClientType, cancellation as object) as void
errors = {
message: ""
attachments: []
drmProbed: false
}
formatsToProcess = []
@@ -62,7 +62,7 @@ namespace Innertube
pendingFormat = pendingFormats.Shift()
' returns false if processing should stop (e.g., cancelled)
if not OTFProcessPendingFormat(pendingFormat.format, pendingFormat.pending, pendingFormat.filePath, segmentDurationsRegex, errors, requestHeaders, cancellation)
if not OTFProcessPendingFormat(pendingFormat.format, pendingFormat.pending, pendingFormat.filePath, segmentDurationsRegex, errors)
exit while
end if
end while
@@ -72,14 +72,6 @@ namespace Innertube
fs.Delete("tmp:/otf_segments")
if errors.drmProbed
errors.attachments.Push({
filename: "player_response.json"
content_type: "application/json"
data: playerResponseText
})
end if
if not StringUtils.IsNullOrEmpty(errors.message) or errors.attachments.Count() > 0
LogTelemetryEvent({
level: "error"
@@ -110,7 +102,7 @@ namespace Innertube
return request.Send()
end function
function OTFProcessPendingFormat(format as object, pending as HttpClient.PendingResponse, filePath as string, segmentDurationsRegex as object, errors as object, requestHeaders as object, cancellation as object) as boolean
function OTFProcessPendingFormat(format as object, pending as HttpClient.PendingResponse, filePath as string, segmentDurationsRegex as object, errors as object) as boolean
response = pending.Await()
if response.IsCancelled()
@@ -119,10 +111,6 @@ namespace Innertube
if not response.IsSuccess()
errors.message += `Failed to get segment info for itag ${format.itag}: ${response.ErrorMessage()}\n`
if IsArray(format.drmFamilies) and not errors.drmProbed
errors.drmProbed = true
errors.message += Innertube.ProbeOTFDrmFormat(format, requestHeaders, cancellation) + `\n`
end if
return true
end if