YouTube-Enhancer / extension

A browser extension to enhance YouTube
MIT License
134 stars 10 forks source link

[Feature Request] Show total length of a playlist in sidebar #542

Closed at-pyrix closed 2 months ago

at-pyrix commented 3 months ago

Is your feature request related to a problem? Please describe. Sometimes, while watching a long YouTube playlist, I need to know the total length. This is very useful for students and people watching a course on a subject through YT in estimating the time required.

Describe the solution you'd like A total duration of the playlist on the sidebar would do the trick.

It would be even better if it reacted to the playback speed, just like the remaining time does. For example, if I'm watching the current video at 2x speed, the playlist length should change to 5h:15h:18s.

image

Describe alternatives you've considered Using the following website: https://ytplaylist-len.sharats.dev/ (maybe some code can be used from here to make it easier?)

VampireChicken12 commented 3 months ago

thanks for the suggestion @at-pyrix I had this idea almost 4 months ago I just never looked into it much more than I did then.

image

VampireChicken12 commented 3 months ago

I planned on making the displayed time match the style that shows when looking at a video's length. I could do it how you showed in your screenshot it wouldn't be much more work.

VampireChicken12 commented 3 months ago

This feature will require a YouTube Data v3 API key. I think we should be able to include one in the extension but also have the option to use your own key as it is possible the included key could be rate limited

VampireChicken12 commented 3 months ago

Making the feature react to the video speed shouldn't be hard at all

at-pyrix commented 3 months ago

Amazing! Thank you for your time.

VampireChicken12 commented 3 months ago

Amazing! Thank you for your time.

you're welcome

at-pyrix commented 3 months ago

Also, can we have something like this?

image

YouTube Playlist Duration bar

VampireChicken12 commented 3 months ago

Also, can we have something like this?

image

YouTube Playlist Duration bar

I can look into doing that. I currently don't know how to get the amount watched of the videos in the playlist for the user.

at-pyrix commented 3 months ago

Wait I just found out that this extension is on gh: https://github.com/WaiShen1000/YouTube-Playlist-Duration-bar

VampireChicken12 commented 3 months ago

Wait I just found out that this extension is on gh: https://github.com/WaiShen1000/YouTube-Playlist-Duration-bar

oh nice

at-pyrix commented 3 months ago

Leave it, that would just increase your workload when there's already an extension for that. my main concern was that it wasn't open-source but now I found out it is, so no problem with that.

VampireChicken12 commented 3 months ago

I see no api is used with this extension. It must be limited to the amount of videos you load from the playlist part

at-pyrix commented 3 months ago

yeah

at-pyrix commented 3 months ago

Are you interested in implementing this feature? because now it seems unnecessary, as there is already an extension for it. It doesn't react to playback speeds though, although that is just a minor inconvenience.

VampireChicken12 commented 3 months ago

Are you interested in implementing this feature? because now it seems unnecessary, as there is already an extension for it. It doesn't react to playback speeds though, although that is just a minor inconvenience.

Yes I am

at-pyrix commented 3 months ago

Oh okay, then :) Thanks :+1:

VampireChicken12 commented 3 months ago

Oh okay, then :) Thanks 👍

no problem.

VampireChicken12 commented 3 months ago

that extension is limited to the amount of videos you load in the playlist side element. If a playlist is big enough it will show 200 videos then you have to go to the last video to load more.

VampireChicken12 commented 3 months ago

@at-pyrix do you know about the discord server for the extension? If you use discord feel free to join and discuss this suggestion and others you might have.

VampireChicken12 commented 3 months ago

Here's the invite link YouTube Enhancer Extension Discord Server

at-pyrix commented 3 months ago

I'm sorry but I don't use discord.

VampireChicken12 commented 3 months ago

I'm sorry but I don't use discord.

That's fine

VampireChicken12 commented 3 months ago

@at-pyrix I started working on this feature. I'm thinking of a way to handle fetching the playlist info and each videos duration without destroying the API thus hitting quota limit fast

at-pyrix commented 3 months ago

Have you tried looking into the extension's source code I sent you earlier?

VampireChicken12 commented 3 months ago

Have you tried looking into the extension's source code I sent you earlier?

the extension that shows the progress of the playlist and the total length If that is what you are talking about then yes. I have determined that code isn't useful, it doesn't use the api so it is limited to the amount of videos you have currently loaded on the side of the playlist menu.

VampireChicken12 commented 3 months ago

Showing the progress could be possible but it will be limited to the amount of videos loaded.

at-pyrix commented 3 months ago

I see

VampireChicken12 commented 3 months ago

I noticed the author of this extension mentions the length of the playlist only considers what is shown https://github.com/WaiShen1000/YouTube-Playlist-Duration-bar/blob/main/scripts/duration-playing.js#L44

VampireChicken12 commented 2 months ago

When analyzing the code for the extension you linked. I realized it is very rudimentary it assumes you watched all videos that occur before it fines the current video you are watching. In my code I'm getting the progress from the thumbnail shown with the red filled progress bar.

VampireChicken12 commented 2 months ago

more progress d28d19f9603e5cc033ce35324bbbc9958c615864

VampireChicken12 commented 2 months ago

(146)_Minecraft_Create_Arcane_Engineering_Ep _1_-__1rdhTkTOds this design may not be final but what do you think of it @at-pyrix

at-pyrix commented 2 months ago

Yeah it's pretty good!

As for the design, I think the background color is a bit too bright. Also, let's change the 79h22m14s to 79:22:14. And I think increasing the padding a bit would help.

Here's what I have in mind:

image

VampireChicken12 commented 2 months ago

Yeah it's pretty good!

As for the design, I think the background color is a bit too bright. Also, let's change the 79h22m14s to 79:22:14. And I think increasing the padding a bit would help.

Here's what I have in mind:

image

thanks for the input. I intended to match the design of youtube but I can do this.

VampireChicken12 commented 2 months ago

@at-pyrix can you provide the border radius and the height of the progress bar? and the percentage part

VampireChicken12 commented 2 months ago

@at-pyrix how does this look (148)_Minecraft_Create_Arcane_Engineering_Ep _2_-__AYzK1MVPs6

at-pyrix commented 2 months ago

Wow! That looks amazing! Great job

as a suggestion, maybe try making the border a bit thinner, and also don't leave out a space between the "-" and "16:07:32". It's a really small thing but triggers me lol

VampireChicken12 commented 2 months ago

Wow! That looks amazing! Great job

thanks

at-pyrix commented 2 months ago

hey btw, is is dynamic i.e., does it instantly change the progress with respect to the video? Because the original extension doesn't do this. It only changes the length once you switch to a different video.

VampireChicken12 commented 2 months ago

hey btw, is is dynamic i.e., does it instantly change the progress with respect to the video? Because the original extension doesn't do this. It only changes the length once you switch to a different video.

not right now but I do plan on doing that. https://github.com/YouTube-Enhancer/extension/commit/88e2fddca83476270191a3bf83fb534ea183e9d9#diff-fcd6cce9790db1826feed58f12c66d972e852afc2f8034b38b4ff4fd08551a11L54

VampireChicken12 commented 2 months ago

the feature isn't 100% finished I still need to do some of the coding for the logic and also add the setting for the YouTube Data API V3 key and enabling this feature itself

at-pyrix commented 2 months ago

Hmm, I understand. Good luck!

VampireChicken12 commented 2 months ago

@at-pyrix thanks for the star @all-contributors please add @at-pyrix for ideas

allcontributors[bot] commented 2 months ago

@VampireChicken12

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

I've put up a pull request to add @at-pyrix! :tada:

at-pyrix commented 2 months ago

@at-pyrix thanks for the star @all-contributors please add @at-pyrix for ideas

thanks

allcontributors[bot] commented 2 months ago

@at-pyrix

@at-pyrix already contributed before to ideas

VampireChicken12 commented 2 months ago

no problem

VampireChicken12 commented 2 months ago

https://github.com/YouTube-Enhancer/extension/assets/45531575/3ab4963e-ba51-4ee2-852e-e04aa08b0697

@at-pyrix here is a demo of the live updating progress

at-pyrix commented 2 months ago

pretty cool

at-pyrix commented 2 months ago

hey, is the progress bar working correctly though? I can see it's the second video out of 56, and the progress bar is more than half complete.

edit: oh you've yet to implement the yt api okok

VampireChicken12 commented 2 months ago

hey, is the progress bar working correctly though? I can see it's the second video out of 56, and the progress bar is more than half complete.

yes it is, I'm testing with a playlist I almost finished in the past