streamrecord/Readme.md

65 lines
1.5 KiB
Markdown
Raw Normal View History

2014-08-26 19:06:23 -07:00
# Streamrecord
***
A python3 web app to record internet radio streams and present them in a podcast
### Requirements
- python3
- sqlite3
- jinja2
- cherrypy
- uwsgi
- mkvmerge
2014-08-29 20:11:58 -07:00
- avconv
2014-08-30 10:45:21 -07:00
### Installation
2014-08-30 10:50:53 -07:00
- Checkout the source to somewhere on your system. In the examples below, the path to the root of the source is /home/streamrecord/app/. Cd to here.
2014-08-30 10:45:21 -07:00
- Write the config for uwsgi, start that daemon
- Write the config for nginx, and view the page.
2014-08-30 10:52:02 -07:00
- Create a symbolic link in static/ pointing to files/output/. Command: `mkdir files/ ; mkdir files/output/ ; mkdir files/temp/ ; ln -s ../files/output static/test `
- Add a cron job to call http://my.server/api/tick every minute.
2014-08-30 10:45:21 -07:00
2014-08-30 10:50:53 -07:00
Podcast usage: each schedule has a numerical id. To view the podcast, http://my.server/api/getPodcast?id=[number]
2014-08-30 10:45:21 -07:00
2014-08-29 20:11:58 -07:00
### Uwsgi config
Something like:
2014-08-29 20:12:58 -07:00
```
2014-08-29 20:11:58 -07:00
[uwsgi]
uid = streamrecord
pid = streamrecord
plugins = python3
touch-reload = /home/streamrecord/app/app.py
chdir = /home/streamrecord/app/
wsgi-file = /home/streamrecord/app/app.py
callable = application
master = true
processes = 1
socket = 127.0.0.1:3330
pidfile = /tmp/streamrecord.pid
enable-threads = true
no-threads-wait = true
die-on-term = true
2014-08-29 20:12:58 -07:00
```
2014-08-29 20:11:58 -07:00
### Nginx config
Something like:
2014-08-29 20:12:58 -07:00
```
2014-08-29 20:11:58 -07:00
server {
listen 30000;
listen [::]:30000 ipv6only=on;
include uwsgi_params;
access_log /var/log/nginx/stremrecord.log;
location / {
uwsgi_pass 127.0.0.1:3330;
}
location /streamrecord/static/ {
2014-08-30 10:50:53 -07:00
autoindex off;
2014-08-29 20:11:58 -07:00
alias /home/streamrecord/app/static/;
}
}
2014-08-29 20:12:58 -07:00
```