ynshung / better-yt-shorts

Playback, volume, timestamp controls and more on YouTube Shorts.
GNU General Public License v3.0
240 stars 43 forks source link

show views above title #140

Closed SamiSuleiman closed 1 year ago

SamiSuleiman commented 1 year ago

this is how it looks: image

ynshung commented 1 year ago

This looks awesome! I never thought it is possible to obtain the view count solely from the client's browser. Could you explain how it is obtained? You can leave the comment below or in the PR description

SamiSuleiman commented 1 year ago

@ynshung youtube only shows and hides the description element (where the views element is located) this means that the elements are available and can be queried just like normal elements (with the query selector).

so I just queried the hidden description element and got the views that way :)

ynshung commented 1 year ago

I think we can present the number of views directly from the label instead of converting to integer since there might be issue on conversion for international users i.e. those that uses dot as separator. Assuming that YouTube automatically uses user's own localization to present the number. In this way we can avoid any potential conflict for other users

SamiSuleiman commented 1 year ago

That's a good idea, I will commit the changes as soon as I get to my computer :)

GitAcc53 commented 1 year ago

thank you so much guys, I wanted this change so badly