avi12 / youtube-auto-hd

A simple browser extension for changing YouTube videos' quality based on FPS.
https://avi12.com/youtube-auto-hd
GNU General Public License v3.0
222 stars 26 forks source link

[Feature request] Premium bitrate opt-out #107

Closed janvernieuwe closed 1 year ago

janvernieuwe commented 1 year ago

Is your feature request related to a problem? Please describe

Make it possible to opt-out of the new 1080p enhanced bitrate. I use youtube premium light, and don't get the updated bitrate, but still the 4K option.

But selection this option will cause a promt to show up on each video that does not have 4k available. This prompt has to be clicked away manually every time.

Is it a change to the extension's functionality or to the pop-up settings page?

Extension's functionality

If the latter, please propose a new design on Figma or describe it as detailed as possible

Add a checkbox for full-premium resolutions or some kind of option that some options can be excluded.

Additional context

image

avi12 commented 1 year ago

Wait, so you're not a Premium customer, and yet the ext auto-selects the 1080p Premium quality? :\

Apparently, this code doesn't fix it... https://github.com/avi12/youtube-auto-hd/blob/300ad654db7311b64952fa324dfbdbe73430a50a/src/cs-helpers/desktop/content-script-desktop.ts#L56-L62

P.S. sounds like a duplicate of #80

janvernieuwe commented 1 year ago

I have premium-lite, wich is cheaper. it doesn't show ads (or have yt music), but it seems the higher bitrate is not included. Premium-lite shows the premium logo as well.

avi12 commented 1 year ago

Oh I see, that makes it more annoying to detect whether the user has premium What tiers does YouTube offer you?

janvernieuwe commented 1 year ago

Just premium-lite and full premium.

janvernieuwe commented 1 year ago

image

janvernieuwe commented 1 year ago

image I don't know if you see the same if you have full premium here...

avi12 commented 1 year ago

What video is it? I'll have to think of a solution, how to approach it from the code

janvernieuwe commented 1 year ago

watching this one (it is one many tho) https://www.youtube.com/watch?v=EV7W0uRuPso

avi12 commented 1 year ago

I don't know if you see the same if you have full premium here...

Sadly YouTube rolls out the premium quality only to some users Despite me being a premium customer fro the past 4 years, I don't see the 1080p Premium quality

avi12 commented 1 year ago

Sadly I don't see it, so it'll be harder to debug image

janvernieuwe commented 1 year ago

If i can help you somehow, let me know, I know my way around the chrome dev console...

avi12 commented 1 year ago

Thanks! I'll definitely need some help lol

avi12 commented 1 year ago

I try to make the ext auto-select 1080p Premium when the user can pick it, i.e. the user has YouTube Premium, the selected quality is >=1080 and the video has 1080p Premium

avi12 commented 1 year ago

image

Where do you see this table?

janvernieuwe commented 1 year ago

There is very little info to find on it, i don't even know if they still offer it to new premium users... Source is from: https://tweakers.net/nieuws/185168/youtube-test-goedkoper-premium-lite-abonnement-zonder-advertenties.html (Dutch). Its a reputable tech news site.

avi12 commented 1 year ago

Oh, I thought it was on YouTube

avi12 commented 1 year ago

If I have no other option, I'll make a "Prefer 1080p Premium" option

janvernieuwe commented 1 year ago

image I do have the premium lite tho! lol

Can't find much about it on yt itself 👀

avi12 commented 1 year ago

image

avi12 commented 1 year ago

I'll have to experiment with HTTPS requests and see what I can dig out of it

janvernieuwe commented 1 year ago

Alright, just let me know if i can be of help. Thanks for looking into it

avi12 commented 1 year ago

Unfortunately, the time is too late to start a serious debug session, but tomorrow I'll try my best

avi12 commented 1 year ago

In the past day or so I've been thinking of a different approach: instead of "trying to detect Premium Lite", my mind has been approaching it from the other way around - let the user set his preferences Right now, I'm thinking of:

So now the biggest challenge is how to craft a convenient user interface

janvernieuwe commented 1 year ago

I think selecting the high bit-rate for premium members is not bad tho, since I don't think that a lot of ppl have premium lite (in comparison to full premium). Having a default checked checkbox, that I could opt-out of the higher bitrates would be more than good enough for me personally.

This way it will work out of the box for full premium and non premium users, and the lite users can just uncheck the premium bitrate checkbox.

avi12 commented 1 year ago

Right, but what if in the future YouTube will introduce high bit rate options for 2K, 4K and even 8K? This is why I'm looking for a broader solution

janvernieuwe commented 1 year ago

Wouldn't they also be marked as "enhanced bitrate"? idk if you can detect that?

avi12 commented 1 year ago

The way I detect whether the player has enhanced retreat option is purely based on the option in the UI image

I have no idea whether YouTube supports a higher bitrate version of 4K, but it's safe to assume that it's only a matter of time until it will

fizzfaldt commented 1 year ago

Enhanced Bitrate 1080p premium feature is broken for me as well (it won't play the premium high bitrate anymore ... was working for a short period of time previously) I don't think Youtube is staying stable with how you detect whether premium is there or not. Personally I'd prefer having a toggle.

avi12 commented 1 year ago

Personally I'd prefer having a toggle.

I agree, a toggle will definitely make it better The question is how to make a convenient UI around it, which I was yet to figure

avi12 commented 1 year ago

Imagine, for example, if the user toggles on a one-size-fits-all "Prefer high bit rate" Then, he stumbles upon a video that has both 1080p enhanced and 4K In that case, the 4K will provide a higher quality than the "1080p enhanced bitrate", but the ext will force-select the "1080p enhanced bitrate", AKA not select the optimal choice for that video

avi12 commented 1 year ago

This is why so far I have approached this problem by first trying to select the highest quality; and If it's unavailable, select the enhanced bitrate version if the user has premium

avi12 commented 1 year ago

Ok, after talking to a friend, we came to the conclusion that the right approach would be to add a switch: "Use enhanced bitrate when it's the highest quality" This way, when 1080p Premium is the highest quality, it will be selected; however, if 4K is the highest, 1080p Premium will not be selected

avi12 commented 1 year ago

I could barely fit these switches 🙈 image

dnmTX commented 1 year ago

Just an idea. You can hide it under "Suport developer" until gets out of beta and offered to every premium member.

avi12 commented 1 year ago

The issue here is that the ext is of type "install and forget", i.e. the ext "stays silent" in the background If I were to introduce it under "Support developer", the majority of users won't know about it

avi12 commented 1 year ago

@janvernieuwe @fizzfaldt Can you try out this version? Note how in the popup you have the enhanced-bitrate-related options chrome-mv3-prod.zip

janvernieuwe commented 1 year ago

Hmmm i'm still getting the popup every time i seek in the video 🤔

avi12 commented 1 year ago

So if I understand correctly, despite keeping the switch disabled for 30FPS and selecting quality 1080p, the extension selects the enhanced-bitrate-version

avi12 commented 1 year ago

Please sideload this version (make sure to set the settings), and when entering the video - open up the Chrome Devtools (Ctrl+Shift+J and take a screenshot): chrome-mv3-prod.zip

janvernieuwe commented 1 year ago

I noticed that once i manually select 1080 (non enhanced) it stays on it when seeking. I'll install the debug version now and let you know.

janvernieuwe commented 1 year ago

This is from the first plugin, before uninstalling. image After loading a video image after seeking (popup) image seeking after manually setting it to 1080p (no popup) image settings image

edit: forgot an img edit 2: popup also appears when video is loaded

avi12 commented 1 year ago

Hmm, interesting I added some more console messages: chrome-mv3-prod.zip

janvernieuwe commented 1 year ago

load image seek image seek after setting to 1080 manually image

avi12 commented 1 year ago

I believe it should work now chrome-mv3-prod.zip

janvernieuwe commented 1 year ago

Unfortunately it still wants to take 1080ebr, load image seek image

avi12 commented 1 year ago

I'm not sure if you have sideloaded correctly, considering that I removed the console logs Please try sideloading: chrome-mv3-prod.zip

janvernieuwe commented 1 year ago

Oh i'm sorry. Last one does indeed seems to work! Nice 🎉

avi12 commented 1 year ago

If you explicitly enable the enhanced bitrate setting, does the popup appear?

janvernieuwe commented 1 year ago

If you explicitly enable the enhanced bitrate setting, does the popup appear?

yes it also works fine disabling it again

avi12 commented 1 year ago

The ext's goal is to serve as many users as possible, and the code logic can get tricky 😅