Commits

Tobias Mueller committed 5a0f380

init

Comments (0)

Files changed (1)

+#!/usr/bin/env python
+"A simple tool to find the latest malonely and print how to play it"
+import re
+
+import requests
+
+
+url = 'http://www.srf.ch/sendungen/maloney'
+rex = '"http://www.srf.ch/player/radio/popupaudioplayer\?id=([0-9a-f-]+)"'
+
+def find_maloney_uuid():
+    'Simply fetches the website and greps for the UUID of the Maloney airings'
+    r = requests.get(url)
+    content = r.content
+    matches = re.findall(rex, content)
+    
+    for match in matches:
+        yield match
+
+if __name__ == "__main__":
+    template = ""
+    uuid = find_maloney_uuid().next() # TODO: One could have an argument to indicate the how many-th episode one wants to fetch
+    # The URL was found in the iPad version of the website. It may change very well.
+    template = 'http://srfaodorigin-vh.akamaihd.net/i/world/maloney/{uuid}.,q10,q20,.mp4.csmil/master.m3u8'
+    uuidurl = template.format(uuid=uuid)
+    mpl =  "mplayer -playlist %s" % uuidurl
+    print mpl