Metadata-Version: 2.1
Name: html-to-mp3
Version: 0.2.0
Summary: Convert HTML and text to mp3s
Home-page: https://github.com/michaelwooley/html-to-mp3
License: MIT
Author: Michael Wooley
Author-email: wm.wooley@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: beautifulsoup4 (>=4.9.3,<5.0.0)
Requires-Dist: click (>=7.1.2,<8.0.0)
Requires-Dist: requests (>=2.25.1,<3.0.0)
Project-URL: Repository, https://github.com/michaelwooley/html-to-mp3
Description-Content-Type: text/markdown

# `html2mp3`

> Generate `mp3`s from html text.

A tiny cli I made on a fling.

## CLI

Basic use:

```bash
# 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):


```bash
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:

```bash
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

