fix(downloader): correct logic for YouTube Premium detection #2984

Closed
franz-dc wants to merge 1 commit from fix/downloader-premium-checker into master
franz-dc commented 2025-02-16 07:50:52 +00:00 (Migrated from github.com)

Another fix to address 304 errors when downloading (#2888).

Another fix to address 304 errors when downloading (#2888).
JellyBrick (Migrated from github.com) requested changes 2025-02-16 08:28:26 +00:00
@ -59,3 +59,3 @@
win.webContents.executeJavaScript(
'!document.querySelector(\'#endpoint[href="/music_premium"]\')',
'!!document.querySelector(\'#endpoint[href="/music_premium"]\')',
) as Promise<boolean>;
JellyBrick (Migrated from github.com) commented 2025-02-16 08:28:22 +00:00

Invalid fix. If the user is using YouTube Premium, the result of document.querySelector('#endpoint[href="/music_premium"]') is null.
so !document.querySelector('#endpoint[href="/music_premium"]') is true if using YT Premium.

Invalid fix. If the user is using YouTube Premium, the result of `document.querySelector('#endpoint[href="/music_premium"]')` is null. so `!document.querySelector('#endpoint[href="/music_premium"]')` is true if using YT Premium.
franz-dc (Migrated from github.com) reviewed 2025-02-16 08:32:36 +00:00
@ -59,3 +59,3 @@
win.webContents.executeJavaScript(
'!document.querySelector(\'#endpoint[href="/music_premium"]\')',
'!!document.querySelector(\'#endpoint[href="/music_premium"]\')',
) as Promise<boolean>;
franz-dc (Migrated from github.com) commented 2025-02-16 08:32:36 +00:00

I do not have YouTube Premium, but it returns null.

I do not have YouTube Premium, but it returns null.
franz-dc commented 2025-02-16 09:02:37 +00:00 (Migrated from github.com)

My bad, it seems that this is actually caused by another bug, I'll open an issue instead.

My bad, it seems that this is actually caused by another bug, I'll open an issue instead.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#2984
No description provided.