Revert DRM Video Resolution
All checks were successful
Publish Docker image / Build and push Docker image to Gitea Registry (push) Successful in 3m46s
Publish release zip / build (push) Successful in 57s

This commit is contained in:
sim0n00ps 2025-05-08 17:34:58 +01:00
parent b12ef22406
commit 8578c40c20

View File

@ -604,28 +604,31 @@ public class DownloadHelper : IDownloadHelper
decKey = decryptionKey.Substring(pos1 + 1);
}
int? streamIndex = await GetVideoStreamIndexFromMpd(url, policy, signature, kvp, downloadConfig.DownloadVideoResolution);
int streamIndex = 0;
string tempFilename = $"{folder}{path}/{filename}_source.mp4";
if (streamIndex == null)
throw new Exception($"Could not find video stream for resolution {downloadConfig.DownloadVideoResolution}");
//int? streamIndex = await GetVideoStreamIndexFromMpd(url, policy, signature, kvp, downloadConfig.DownloadVideoResolution);
string tempFilename;
//if (streamIndex == null)
// throw new Exception($"Could not find video stream for resolution {downloadConfig.DownloadVideoResolution}");
switch (downloadConfig.DownloadVideoResolution)
{
case VideoResolution.source:
tempFilename = $"{folder}{path}/{filename}_source.mp4";
break;
case VideoResolution._240:
tempFilename = $"{folder}{path}/{filename}_240.mp4";
break;
case VideoResolution._720:
tempFilename = $"{folder}{path}/{filename}_720.mp4";
break;
default:
tempFilename = $"{folder}{path}/{filename}_source.mp4";
break;
}
//string tempFilename;
//switch (downloadConfig.DownloadVideoResolution)
//{
// case VideoResolution.source:
// tempFilename = $"{folder}{path}/{filename}_source.mp4";
// break;
// case VideoResolution._240:
// tempFilename = $"{folder}{path}/{filename}_240.mp4";
// break;
// case VideoResolution._720:
// tempFilename = $"{folder}{path}/{filename}_720.mp4";
// break;
// default:
// tempFilename = $"{folder}{path}/{filename}_source.mp4";
// break;
//}
string parameters = $"-cenc_decryption_key {decKey} -headers \"Cookie:CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {sess} Origin: https://onlyfans.com Referer: https://onlyfans.com User-Agent: {user_agent}\" -y -i \"{url}\" -map 0:v:{streamIndex} -map 0:a? -codec copy \"{tempFilename}\"";