Commit ac88d120 authored by onny's avatar onny

added podcast plugin for srf virus & orf fm 4 la boum deluxe

parent 2d780cc2
......@@ -38,7 +38,9 @@ from plugins import brmediathek
from plugins import zdfmediathek
#from plugins import facebook
from plugins import error
from plugins import ebaykleinanzeigenapi
#from plugins import ebaykleinanzeigenapi
from plugins import podcasts
import utils
......@@ -59,8 +61,8 @@ app.mount('/feeds/brmediathek', brmediathek.app)
#app.mount('/feeds/facebook', facebook.app)
app.mount('/feeds/zdfmediathek', zdfmediathek.app)
app.mount('/feeds/error', error.app)
app.mount('/feeds/ebaykleinanzeigenapi', ebaykleinanzeigenapi.app)
#app.mount('/feeds/ebaykleinanzeigenapi', ebaykleinanzeigenapi.app)
app.mount('/feeds/podcasts', podcasts.app)
if __name__ == '__main__':
#bottle.debug(True)
......
import logging
import requests
import re
import bottle
from utils import construct_feed, checkParams
# todo
# - favicon
#logging.basicConfig(level=logging.DEBUG)
#requests_cache.install_cache(expire_after=1800)
webproxy_prefix_url = "https://www.redlukas.ch/browse.php?u="
virus_podcast_base_url = "http://www.srf.ch/feed/podcast/hd/"
app = bottle.Bottle()
@app.route('/virus/<podcastid>')
@checkParams(maxentries = int)
def feed(podcastid, maxentries = 1000):
virus_podcast_feed = requests.get(virus_podcast_base_url + podcastid + ".xml")
virus_podcast_feed.encoding = 'utf-8'
virus_podcast_feed_unblocked = virus_podcast_feed.text.replace("http://podcasts.srf.ch/ch/audio",webproxy_prefix_url+"http://podcasts.srf.ch/ch/audio")
return virus_podcast_feed_unblocked
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment