user234683 / youtube-local

browser-based client for watching Youtube anonymously and with greater page performance
GNU Affero General Public License v3.0
517 stars 63 forks source link

Added support for watch progress for the session #184

Open abhishek-fluidai opened 11 months ago

abhishek-fluidai commented 11 months ago

Outcome

This PR is to save the watched video duration for various videos, so that they can resume playing from where they left off. In the current implementation, I am saving time_stamps in session storage, so these persist only for the current session. I am expecting it to make persistent in future PRs.

Demo

demo video

user234683 commented 8 months ago

Since the persistent version would have to be done quite differently, would prefer we just do that first. I wrote out an implementation plan here if you or anyone else would like to give it a shot: https://github.com/user234683/youtube-local/issues/155#issuecomment-1902473320

abhishek-fluidai commented 7 months ago

@user234683 Sorry for the delay. I forgot about this. I would like to implement it. Probably start on this weekend. I'll keep you posted. Thanks!

CodiumAI-Agent commented 2 months ago

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Key issues to review

Code Robustness
The extraction of `video_id` from the URL is fragile and may fail if the URL structure changes or includes additional parameters before the video ID. Consider using URLSearchParams for a more robust solution. Error Handling
There is no error handling for cases where `sessionStorage` might be disabled or full, which could lead to unhandled exceptions. Code Duplication
The `sessionStorage.getItem(video_id)` is called twice, which is inefficient. Consider storing the result in a variable and reusing it.