Skip to main content

Convert HTML and text to mp3s

Project description

html2mp3

Generate mp3s from html text.

A tiny cli I made on a fling.

CLI

Basic use:

# CLI docs
html2mp3

# Generate from a file
html2mp3 file examples/test1.html test1.mp3

# Download from URL
html2mp3 url https://text.npr.org/985359064

# Download from URL, only generate voice from the text in the selector .paragraphs-container
html2mp3 url https://text.npr.org/985359064 --select ".paragraphs-container"

Multiple files at once can be done (though the CLI could be improved to make this less verbose):

html2mp3 url https://text.npr.org/985359064 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985347984 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985524494 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985032748 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985498425 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985336036 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/976385244 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985470204 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985365621 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985296354 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985594759 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985125653 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985290016 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985400141 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/984387402 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/984614649 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985143101 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/982223967 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/985421813 --select ".paragraphs-container" & html2mp3 url https://text.npr.org/984870694 --select ".paragraphs-container"

Running the above example (20 examples in total) took about 48s on my personal computer (47.72s user 0.74s system 480% cpu 10.094 total)

You can do your own tests via:

time sh -c 'html2mp3 url https://text.npr.org/985359064 & html2mp3 url https://text.npr.org/985347984'

TODO

  • Testing
  • Multiple files/urls at once
  • Voice generation settings

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

html-to-mp3-0.2.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

html_to_mp3-0.2.0-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

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