Skip to main content

A tool to convert YouTube content to Kindle format

Project description

DESCRIPTION

Automates the conversion of online Youtube videos
(or offline audio files or disorganised text files) into Kindle books.
Uses OpenAI's API for transcription and redrafting of the text (for readability).
Requires OpenAI key.

GETTING STARTED

Installation:
pip install youtube-to-kindle

OpenAI:
You will need to provide you own OpenAI key.
Follow the instructions here: https://platform.openai.com/docs/quickstart

QUICKSTART

1. Convert a single Youtube video
2. Convert a single audiofile
3. Convert a Youtube Playlist
4. Convert multiple Youtube videos
5. Convert multiple audiofiles
6. Convert a text file or text files to Kindle
7. Convert without redrafting

All code below must be preceded with:
from youtube_to_kindle import YoutubeToKindle
ytk = YouTubeToKindle(openai_key="your_openai_key_here")
ytk.set_download_dir('Downloads') # set this to any location you want

1. Convert a single YouTubeVideo:
ytk.add_to_files('https://www.youtube.com/watch?v=GWCChO7znyM')
ytk.params['author'] = ''
ytk.params['redraft'] = True
ytk.params['turn_first_video_title_to_book_name'] = True
ytk.params['make_first_video_creator_author'] = True
ytk.make_ebook()

2. Convert multiple YouTubeVideos:
ytk.add_to_files('https://www.youtube.com/watch?v=GWCChO7znyM')
ytk.add_to_files('https://www.youtube.com/watch?v=EUY7Q92aK3w')
ytk.params['title'] = 'Tarantino Videos'
ytk.params['author'] = 'Various'
ytk.params['redraft'] = True
ytk.params['turn_video_title_to_chapter_name'] = True
ytk.make_ebook()

3. Convert a YouTubePlaylist:
ytk.add_to_files('https://www.youtube.com/playlist?list=PLICvGmV1_RRLH25uyKaVYXpBLpbQvlZ8e')
ytk.params['title'] = 'Test Playlist'
ytk.params['author'] = 'Me'
ytk.params['redraft'] = True
ytk.params['turn_playlist_title_to_book_title'] = True
ytk.make_ebook()

4. Convert a single audio file:
ytk.add_to_files('pitchvid.mp3')
ytk.params['title'] = 'Audio File'
ytk.params['author'] = 'Me'
ytk.params['redraft'] = True
ytk.params['turn_filename_root_to_chapter_name'] = True
ytk.make_ebook()

5. Convert a multiple audio files:
ytk.add_to_files('pitchvid.mp3')
ytk.add_to_files('How Tarantino Use Music To Start Writing 😯.mp3')
ytk.params['title'] = 'Audio File'
ytk.params['author'] = 'Me'
ytk.params['redraft'] = True
ytk.params['turn_filename_root_to_chapter_name'] = True
ytk.make_ebook()

6. Convert a multiple text files (.txt) on a Mac:
ytk.add_to_files('Commissioning Execs Session.txt')
ytk.add_to_files('Spec scripts session.txt')
ytk.params['title'] = 'Screenplays'
ytk.params['author'] = 'Writers'
ytk.params['redraft'] = True
ytk.params['turn_filename_root_to_chapter_name'] = True
ytk.params['encoding'] = 'latin-1' # mac encoding
ytk.make_ebook()



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

youtube-to-kindle-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

youtube_to_kindle-0.1.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file youtube-to-kindle-0.1.1.tar.gz.

File metadata

  • Download URL: youtube-to-kindle-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.4

File hashes

Hashes for youtube-to-kindle-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4c2a5f5e904828b155dc115e90361c360d695ce81c92eb9c6f69b014dc610ba
MD5 a9ff4609cd49c6321a19987cc11d1158
BLAKE2b-256 859bf711bbefaf4329ac17504d4d03ce274c2959139055bc977fc5dfea37a32a

See more details on using hashes here.

File details

Details for the file youtube_to_kindle-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_to_kindle-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da969d172defae8b477fba051c7af5af0985ebb2eb15fd17777b73a3f29fa24d
MD5 5fbc7d9be36551e3e32524654bb04d2a
BLAKE2b-256 688c464c2e59ae53a4c332c7f8506760f327b47801496c3edbb36586eccffa45

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