Coder Social home page Coder Social logo

platput / pysubs Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 166 KB

api to get audio transcription for video files from youtube, aws s3 and such. using OpenAI Whisper

License: MIT License

Python 97.65% JavaScript 1.71% Dockerfile 0.53% Shell 0.12%
openai whisper

pysubs's Introduction

PySubs API - OpenAI powered subtitle generator API

MIT License CodeCov GitHub Release

PySubs API is a subtitle generator API powered by OpenAI's Whisper framework.

And we are currently in beta stage. This tool currently supports YouTube video links which means if you input a video url from YouTube, it will generate subtitles and let you download the subtitle in SRT format.

I will be fixing the bugs and keep on adding more features to it until it becomes a good enough tool to go into production stage. If you have any thoughts on the tool like feedback, feature requests etc. feel free to create an issue here.

Dependencies

Firebase Dependencies

  • Setup firebase project with Firestore
  • Set the GOOGLE_APPLICATION_CREDENTIALS env variable with the Google service account key filepath so that PySubs can authenticate with Firebase.
  • Use the CloudFunctions from pysubs-cloud-functions directory to sync the users between Firebase Users and Firestore users Collection
    • Users collection users need to have at least one credit for the users to be able to generate subtitles.
    • Currently seconds to credit ratio is based on the constant SECONDS_PER_ONE_CREDIT

Run using docker

  • If running from GCP Cloudrun, add the role of Firebase Firestore Admin
  • Or set the GOOGLE_APPLICATION_CREDENTIALS env variable with the Google service account key filepath so that PySubs can authenticate with Firebase
docker build -t pysubs .
docker create --name pysubs pysubs
docker start

Run using poetry

sudo apt udpate
sudo apt install ffmpeg curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
python3 -m poetry install
uvicorn pysubs.main:app --host="0.0.0.0" --port=8080 --log-level="info"

Testing

python3.10 -m pytest
coverage run -m pytest -v tests/ && coverage report -m

Environment

GOOGLE_APPLICATION_CREDENTIALS="pysubs.json"

Features

  • Add YouTube video support
  • Add firestore as the datastore to store the history of subtitle generations
  • Add firebase bearer token authentication
  • Add support for detecting language
  • API endpoint for checking subtitle generation status
  • Basic URL verification as a security measure, to be improved later
  • Add api endpoint to get history
  • Add credits feature
  • Add firebase cloud functions to automate user sync to firestore
  • Reduce credit by one for each subtitle generation
  • Add limits to video duration based on available credits
  • Show error message when video url is invalid and user clicks the generate button
  • Add support for uploading videos
  • Feature to show the details of the subtitle which is being generated
  • Feature to disallow user to generate subtitles if one is being generated
  • Check if the video id already exists before starting to generate the subtitle
  • Add api endpoints support for subtitle translate option to different languages
  • Add support for direct links of videos
  • Change SECONDS_PER_ONE_CREDIT from pysubs_manager.py to use an ENV variable
  • Increase test coverage

pysubs's People

Contributors

platput avatar

Stargazers

 avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

Forkers

thethao133

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.