Skip to content

Instantly share code, notes, and snippets.

@youminkim
Created August 19, 2012 15:40
Show Gist options
  • Save youminkim/3395504 to your computer and use it in GitHub Desktop.
Save youminkim/3395504 to your computer and use it in GitHub Desktop.
Tumblr music downloader
name = [
"youminkim",
"kyk051301",
"motives-motifs",
"slowblower",
"dogdong",
"ch11",
"tigger103music",
"nabillera",
"filmierd",
"saramdle",
"sandcat",
"vandalee",
"hanguknamja",
"leodic",
"nuthin",
"eeooi",
"flightboxrecorder",
"eunkim",
"nodamin",
"inanebox",
"rabbits89",
"reflexioneternal",
"liebebae",
"wenjun",
"musily",
"akazukin",
"leaveawill",
"berlin457",
"nammytopia",
"yong-j",
"byhosu",
"flyingstargirl",
"andreasung",
"ninaful",
"digitypo",
"djsoolee",
"yeonsukim",
"hotjun",
"brightsizelifekr",
"youminkim",
"privacyofthewind",
"generaldoctor",
"yoohyejin",
"koshnim ",
"hakang",
"hyunhak",
"naruter",
"jaehyun",
]
api_key = 'rbu3tDrR4MoZNQ3aAJgz0Vibw1WglEEQs8dNI0x1d6qmIPLIgh'
trick = '?plead=please-dont-download-this-or-our-lawyers-wont-let-us-host-audio&trick=.mp3'
import json, urllib2
from threading import Timer
i = 0
for n in name:
try:
url = "http://api.tumblr.com/v2/blog/"+n+".tumblr.com/posts?type=audio&api_key="+api_key;
response = urllib2.urlopen(url)
r = json.load(response)
for p in r['response']['posts']:
link = p['audio_url']+trick
#download
f = urllib2.urlopen(link)
local = open('music/'+i.__str__()+'.mp3', 'w')
local.write(f.read())
f.close()
local.close()
i = i + 1
print i
except:
print "error"
@youminkim
Copy link
Author

make directory 'music' before playing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment