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
8. Estimate the cost of converting all the mp3s in the Download directory
9. Estimate the cost of redrafting all the text files in the Download directory
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()
7. Convert without redrafting:
ytk.add_to_files('https://www.youtube.com/watch?v=GWCChO7znyM')
ytk.params['author'] = ''
ytk.params['redraft'] = False
ytk.params['turn_first_video_title_to_book_name'] = True
ytk.params['make_first_video_creator_author'] = True
ytk.make_ebook()
8. Estimate the cost of converting all the mp3s in the Download directory:
print(ytk.estimate_cost(file_type=".mp3"))
9. Estimate the cost of redrafting all the text files in the Download directory:
print(ytk.estimate_cost(file_type=".txt"))
Metadata
Release files for youtube-to-kindle 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| youtube-to-kindle-1.0.0.tar.gz | 11.1 kB | Without provenance | Details for youtube-to-kindle-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| youtube_to_kindle-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for youtube_to_kindle-1.0.0-py3-none-any.whl |
Total release size: 21.6 kB
Release files / youtube-to-kindle-1.0.0.tar.gz
| Download URL | youtube-to-kindle-1.0.0.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5ec538c156e38961500caae0c7b8fe2229160bd7c3b0240b78e44557a6f88c9
|
|
BLAKE2b-256 checksum How to use checksums |
2d3ea664f15f2fddd3452496d8eeea444154da9fe940c47a1e0e1a71d879ffac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.4
|
Release files / youtube_to_kindle-1.0.0-py3-none-any.whl
| Download URL | youtube_to_kindle-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c0dce84d5d8763605e3cf9ba519e58a0cd5c79e0bbbc83a1ff73dd2cbc90b5b
|
|
BLAKE2b-256 checksum How to use checksums |
b34c743db1beddbf1bbe9d77195059be665b77b4ce6edbf138eda8da18d01d62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.10.4
|
Security for youtube-to-kindle 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.