# HG changeset patch # User Beetle B. # Date 1714164239 25200 # Fri Apr 26 13:43:59 2024 -0700 # Node ID 8876f24b8e64e3b8bbbcd2702a9d892b34b42c4d # Parent 75ea764dc6fc57aa9afddab0a02fb262af3de4ab Testing index.md diff --git a/index.md b/index.md new file mode 100644 --- /dev/null +++ b/index.md @@ -0,0 +1,81 @@ + +# Table of Contents + +- [Introduction](#org103e8cd) +- [Prerequisites](#org837c730) +- [Setup](#orge2d7e3b) +- [Usage](#orgf11056f) +- [How It Works](#orgc062f69) + +-**- mode: org; eval: (add-hook 'after-save-hook #'gtts-create-index-md nil t) -**- + + + + +# Introduction + +Script to convert an online article into an audio file and add it to a +podcast feed. It utilizes Google Cloud to create the audio file. + + + + +# Prerequisites + +- [google-cloud-storage](https://pypi.org/project/google-cloud-storage/) +- [google-cloud-texttospeech](https://pypi.org/project/google-cloud-texttospeech/) +- [pydub](http://pydub.com/) +- [Jinja](https://jinja.palletsprojects.com/en/3.1.x/) +- [paramiko](https://www.paramiko.org/) +- [shot-scraper](https://github.com/simonw/shot-scraper) + + + + +# Setup + +You need to have Google Cloud set up. Unfortunately, I don't remember +all the steps I did for this. Ultimately you'll need a JSON file that +has all your credentials - I believe the Google Cloud's CLI will create +it for you on demand. + +You also need a place to host your podcast's XML file. It should be +accessible via SFTP. + +Create an `audio` directory in the same directory as this script. + +You need the following files: + +- `texttospeech.json`: This has your Google Cloud credentials. +- `config.py`: Copy `config_example.py` and populate it. + + + + +# Usage + + usage: gcloud-tts.py [-h] [-u URL] [-r] [-s] + + Convert an article into an audio entry for a podcast. + + options: + -h, --help show this help message and exit + -u URL, --url URL + -r, --readability Get text only. No uploading. + -s, --sftp Upload to FTP server + +For a typical run, it will be: + + python gcloud-tts.py -u https://paulgraham.com/hwh.html -s + +You do not need to be in the script's directory to run it. + + + + +# How It Works + +`shot-scraper` is used to extract the text of the file, which is then +sent to Google Cloud to convert into audio. The feed's XML file is +updated to point to that file. +