diff options
| author | 2015-10-11 17:54:06 +0200 | |
|---|---|---|
| committer | 2015-10-11 17:54:56 +0200 | |
| commit | a7fe15b99d64904855ba2bd3649b1a3642824a75 (patch) | |
| tree | 35c2da4777ffcbd1b6fb661227af8a6528646030 /youtube_podcaster/__init__.py | |
| parent | f1ddf104809017784aa136ebb8ff7e2cfb96d5f4 (diff) | |
| download | youtube-podcaster-a7fe15b99d64904855ba2bd3649b1a3642824a75.tar.gz youtube-podcaster-a7fe15b99d64904855ba2bd3649b1a3642824a75.tar.bz2 youtube-podcaster-a7fe15b99d64904855ba2bd3649b1a3642824a75.zip | |
Can actually be installed with setup.py now
Diffstat (limited to 'youtube_podcaster/__init__.py')
| -rw-r--r-- | youtube_podcaster/__init__.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/youtube_podcaster/__init__.py b/youtube_podcaster/__init__.py new file mode 100644 index 0000000..32aee7c --- /dev/null +++ b/youtube_podcaster/__init__.py | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | |||
| 3 | import json | ||
| 4 | |||
| 5 | from http.server import ( | ||
| 6 | HTTPServer, | ||
| 7 | ) | ||
| 8 | |||
| 9 | from . import ( | ||
| 10 | youtube, | ||
| 11 | ) | ||
| 12 | |||
| 13 | from .podcastfeeder import ( | ||
| 14 | create_feeder | ||
| 15 | ) | ||
| 16 | |||
| 17 | |||
| 18 | def main(): | ||
| 19 | config = json.load(open("youtube-podcaster.json")) | ||
| 20 | |||
| 21 | try: | ||
| 22 | PodcastFeeder = create_feeder(config["youtube"], config["podcasts"]) | ||
| 23 | server = HTTPServer(("", 8888), PodcastFeeder) | ||
| 24 | server.serve_forever() | ||
| 25 | except KeyboardInterrupt: | ||
| 26 | server.socket.close() | ||
| 27 | |||
| 28 | # vim: set ts=8 sw=4 tw=0 et : | ||
