Skip to main content

Convert youtube urls to text with speech recognition

Project description

Converts Youtube URLs to Text with Speech Recognition

project status: active supported language: english

banner

What does the library does?

  • Youtube -> Text: Translate youtube urls as text file (.csv)
  • Youtube -> Audio: Downloads youtube urls as audio file (.wav)
  • Audio -> Text: Translate audio file (.wav) to text file (.csv)

Three folders will be created to store the output files.

<Own Path> or <HOME_DIRECTORY>/youtube2text
│
├── wav/
│   └── 2022Jan02_011802.wav
|
├── audio-chunks/
│   └── 2022Jan02_011802
│       ├── chunk1.wav
│       ├── chunk2.wav
│       └── chunk3.wav
│   
└── wav/
    └── 2022Jan02_011802.csv

How to install

pip install youtube2text

How to use

from youtube2text import Youtube2Text

converter = Youtube2Text()

converter.url2text(urlpath="https://www.youtube.com/watch?v=Ad9Q8rM0Am0&t=114s")

Check out more at howtouse.ipynb

Functions

Youtube -> Text

def url2text(self, urlpath, outfilename = None):
    '''
    Convert youtube url to text

    Parameters:
        urlpath (str): Youtube url
        outfilename (str, optional): Filename of output file (.wav, *.csv)
    '''

Youtube -> Audio

def url2audio(self, urlpath, audiofilename, audiofilepath = None):
    '''
    Convert youtube url to audiofile

    Parameters:
        urlpath (str): Youtube url
        audiofilename (str): Filename of audio file (*.wav)
        audiofilepath (str, optional): Absolute / relative path to save audio file
    '''

Audio -> Text

def audio2text(self, audiofilename, audiofilepath = None, textfilename = None, textfilepath = None):
    '''
    Convert audio to csv file

    Parameters:
        audiofilename (str): Filename of audio file (*.wav)
        audiofilepath (str, optional): Absolute / relative path to save audio file
        textfilename (str, optional): Filename of text file (*.csv)
        textfilepath (str, optional): Absolute / relative path to save text file
    '''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtube2text-0.0.9a0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

youtube2text-0.0.9a0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file youtube2text-0.0.9a0.tar.gz.

File metadata

  • Download URL: youtube2text-0.0.9a0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for youtube2text-0.0.9a0.tar.gz
Algorithm Hash digest
SHA256 1e9c5857e1ea03bb5618e3ec60c31a71af203f995c87cbf0cbf89afb9ed11fbf
MD5 2a105be4a4cd8e35ac7926abb980a66b
BLAKE2b-256 ce123f01f7ff73066be99b255dac74ee64d42568d67d50c3783552a3859c654f

See more details on using hashes here.

File details

Details for the file youtube2text-0.0.9a0-py3-none-any.whl.

File metadata

  • Download URL: youtube2text-0.0.9a0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for youtube2text-0.0.9a0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f38a763b02264e70891c9d92cede1fe8bda43aa9edbfee0d467485c2132aa55
MD5 3f9f25c8c4992dc3cfd7c9b3122c73c1
BLAKE2b-256 afad08443e401fdf6b3513967185279e9a93aa80d33a296a00c083cb5e5cdda0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page