Skip to content
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

Added script for adding subtitles to videos that already don't have one #885

Closed
wants to merge 7 commits into from

Conversation

Pritam12F
Copy link
Contributor

@Pritam12F Pritam12F commented Aug 14, 2024

PR Fixes:

Resolves #875

Script that will take contentId of a video, generate and upload the subtitles to bunny in .json format if it doesn't already have subtitles.
It will download the video, convert it to mp3 and generate a .json file in the temp/ folder which I have added to .gitignore and after the subtitle is successfully uploaded, the temp folder/files inside it will be deleted.

Need an OpenAI api key and some other .env variables I have added in the .env.example file

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

@siinghd
Copy link
Collaborator

siinghd commented Aug 14, 2024

Looks good, let me test it

@Pritam12F
Copy link
Contributor Author

Pritam12F commented Aug 14, 2024

Looks good, let me test it

Yeah let me know if it works as expected or needs some improvement

@SujithThirumalaisamy
Copy link
Contributor

@Pritam12F Can we optimise it? There is a way in ffmpeg to only download the .mp3 from the videoURL.

@SujithThirumalaisamy
Copy link
Contributor

And I think our videoJS requires the .srt file for the subtitles. No the JSON format

@Pritam12F
Copy link
Contributor Author

@SujithThirumalaisamy Will fix this

@SujithThirumalaisamy
Copy link
Contributor

Tested it locally?

@Pritam12F
Copy link
Contributor Author

Tested it locally?

I don't have access to an OpenAI api key, so I couldn't test

@devsargam devsargam closed this Sep 24, 2024
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.

feature: Write a script that constantly polls the DB and adds subtitles to videos
4 participants