Created
June 24, 2009 01:54
-
-
Save maop/134955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# quick and dirty script to mauropm <3 | |
# with love | |
# maop... xD | |
# | |
# Todo, parse types (mp3, youtube, etc..) and add code or perhaps | |
# feed youtube-dl with sources from here and later mencoder powa! | |
# | |
import urllib,urllib2,simplejson | |
def get_json(url, values): | |
headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'} | |
data = urllib.urlencode(values) | |
req = urllib2.Request(url, data, headers) | |
response = urllib2.urlopen(req) | |
json = response.read() | |
json = simplejson.loads(json) | |
return json | |
def get_song_src(sid): | |
values = {'SID': sid} | |
json = get_json("http://mauropm.fizy.com/fizy::getSong", values) | |
return json['source'] | |
if __name__=="__main__": | |
# Get playlist | |
#TODO: playlist and user should be passed by sysargv | |
values = {'PID': 82739} | |
json = get_json("http://mauropm.fizy.com/fizy::getSongs", values) | |
for i in json: | |
src = get_song_src(i['ID']) | |
print "TITLE: " + i['title'] + " TYPE: " + i['type'] + " PROVIDER:" + i['provider'] + " SOURCE: " + src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment