cms icon indicating copy to clipboard operation
cms copied to clipboard

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

Open Pritam12F opened this issue 1 year ago • 7 comments

PR Fixes:

  • 1 #875

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

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

Pritam12F avatar Aug 14 '24 15:08 Pritam12F

Looks good, let me test it

siinghd avatar Aug 14 '24 15:08 siinghd

Looks good, let me test it

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

Pritam12F avatar Aug 14 '24 15:08 Pritam12F

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

SujithThirumalaisamy avatar Aug 15 '24 16:08 SujithThirumalaisamy

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

SujithThirumalaisamy avatar Aug 15 '24 16:08 SujithThirumalaisamy

@SujithThirumalaisamy Will fix this

Pritam12F avatar Aug 15 '24 23:08 Pritam12F

Tested it locally?

SujithThirumalaisamy avatar Aug 16 '24 01:08 SujithThirumalaisamy

Tested it locally?

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

Pritam12F avatar Aug 20 '24 11:08 Pritam12F