Skip to content

Autotime - Getting SectionEnd from YouTube #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bigdale123
Copy link

I have not made many open source contributions, so I will try to describe what I have done as best I can.

Firstly, in db/init.go there is now logic to detect when SectionStart and SectionEnd are both 0, indicating that they have not been set by the user. If detected, the youtube api golang package will look up the video by it's ID, grab the duration of the video, and set that as the SectionEnd value so that the whole video plays.

Secondly, in config/env.go I have added a YOUTUBE_API_KEY key that allows a user to put in their api key for youtube so that this functionality can work.

That should be it, at a high level! I hope I haven't messed anything up.

@Michaelgathara
Copy link

@ozencb Would love to have this added

@bigdale123
Copy link
Author

bigdale123 commented Jan 16, 2025

sponge

@ozencb
Copy link
Owner

ozencb commented Feb 5, 2025

Hi, sorry for the late reply. I am afraid I don't have much time to keep working on this project but I wish to return back one day.

This looks awesome but I think it should be an optional feature. It is nice not having to create API keys.

@bigdale123
Copy link
Author

That's a good point, there should be a toggle to enable the behavior. I guess right now if you had tried it without a api key it'd just error out and probably crash couchtube.

Sadly I'm in the same situation, I don't have time to implement those changes. I'm not going to close the pull request, I'll revisit this later when I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants