Last active
June 10, 2017 17:06
-
-
Save blha303/7819440a820f865911d8de92d599e067 to your computer and use it in GitHub Desktop.
howl.fm playlist downloader. I just don't like paywalls, sorry
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
a = document.getElementsByTagName("a"); | |
out = ""; | |
for (var i=0;i<a.length;i++) { | |
if (a[i].hasAttribute("data-stream-url")) { | |
out = out + " '" + a[i].getAttribute("data-stream-url") + "'" | |
} | |
}; | |
prompt("urls:", out) | |
//then use that with something like wget. you'll get a bunch of long filenames. use the below script to fix the filenames |
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/env python3 | |
from glob import glob | |
import os | |
from urllib.parse import unquote | |
for fn in glob("*.mp3?response-content-disposition*"): | |
newfn = unquote(unquote(fn.split("filename=%22")[1].split("%22")[0])) | |
os.rename(fn, newfn) | |
print(newfn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment