Giter VIP home page Giter VIP logo

sermon-api's Introduction

Python for PCC

This is a custom API to download, process, and upload sermons automagically with minimal user input.

Manual Deployment

If you would like to run the uploading scripts manually, you can clone this repo, cd into the directory, and

pip3 install -r requirements.txt

Generate an API key with

python3 main.py -key

or simply edit data/api.txt.

Then run the API with

python3 main.py -a

You can find an example of a frontend for the API we actually use in upload.vue.

To authenticate with Google and upload to Youtube, you'll need to generate OAuth2 credentials here with Youtube API access. Download the client_secrets.json file to data/client_secrets.json, then run

python3 main.py -auth

This will open a webpage where you can authenticate your channel, which will generate an oauth2.json file you need to bind to /app/data/oauth2.json on your Docker container. This will keep the container permenantly authenticated.

Finally, rename .env_example to .env and fill the variables in there, then run python3 main.py -a.

Docker Deployment (recommended)

The easiest way to run this API is by pulling the Docker image from coventrypca/sermon-api:latest, or you could clone this repository and build it yourself with docker build ..

If you would like to run the API on bare metal, rename .env_example to .env and fill the variables in there, then run python3 main.py -a.

Use the Docker Compose File as a guide for filling in all the nessecary environment variables. See the chart below for further descriptions:

Env Variable Comment
SA_API_KEY Your SermonAudio API Key. You can find it by signing in and going here
S3_ACCESS_KEY Get your access token for your S3 storage if you have it. If not, don't supply it and this part won't run
S3_SECRET Same as above, but use your secret token here. You could also use Docker secrets as this is sensitive
CHANNEL_ID Supply the ID of the channel you would like to scrape for latest video to scrub through on the web interface.

Google Authentication

To authenticate with Google and upload to Youtube, you'll need to generate OAuth2 credentials here with Youtube API access. Download the client_secrets.json file and bind the file to /app/data/client_secrets.json. First, though, you must run

python3 main.py -auth

This will open a webpage where you can authenticate your channel, which will generate an oauth2.json file you need to bind to /app/data/oauth2.json on your Docker container. This will keep the container permenantly authenticated.

Enjoy! If anyone else ever tries to use this it'll need to be customized a great deal, but the upload pipelines should be ironed out at the very least. Shoot me a message if you have any problems, although the only person who will probably have any issues will be me ;)

sermon-api's People

Contributors

benonymity avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

sermon-api's Issues

Remove Git Authentication

Up till now I've required a Git repo's URL, as well as a username and password/GPG key to access it. However, now that the pcc-website is on Github publicly, the speaker scraping that required authentication can be replaced with a simple call to Github's delightful API.

Improve status reporting

Add direct logging to /status endpoint instead of the current solution which doesn't provide any sort of progress.

Better status/logging

Write custom logging module to expose logs at https://api.exaple.com/pcc/v1/status

Improve documentation

Improve documentation and comments for future maintainers so other people can host and debug this mess!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.