From 2097b8a05baec43c8410dd8171910530ba75e8d9 Mon Sep 17 00:00:00 2001 From: drunkwinter <38593134+drunkwinter@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:04:06 +0200 Subject: [PATCH] [fix] "Something went wrong" error for videos - take 2 (#206) Previous fix was applied to only one bypass, now this is applied globally --- src/components/unlocker/player.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/unlocker/player.js b/src/components/unlocker/player.js index 0b78c3c..4cc5e61 100644 --- a/src/components/unlocker/player.js +++ b/src/components/unlocker/player.js @@ -101,11 +101,11 @@ function getUnlockedPlayerResponse(videoId, reason) { * Workaround: https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/issues/191 * * YouTube checks if the `trackingParams` in the response matches the decoded `trackingParam` in `responseContext.mainAppWebResponseContext`. - * However, the `TV Embedded Player` does not include the `trackingParam` in the `responseContext`, causing the check to fail. + * However, sometimes the response does not include the `trackingParam` in the `responseContext`, causing the check to fail. * - * This workaround addresses the issue by hardcoding the `trackingParams` in the `TV Embedded Player` context. + * This workaround addresses the issue by hardcoding the `trackingParams` in the response context. */ - if (isStatusValid && strategy.name === 'TV Embedded Player') { + if (isStatusValid && !unlockedPlayerResponse.trackingParams || !unlockedPlayerResponse.responseContext?.mainAppWebResponseContext?.trackingParam) { unlockedPlayerResponse.trackingParams = 'CAAQu2kiEwjor8uHyOL_AhWOvd4KHavXCKw='; unlockedPlayerResponse.responseContext = { mainAppWebResponseContext: {