Steven Smith revised this gist . Go to revision
No changes
Steven Smith revised this gist . Go to revision
2 files changed, 17 insertions
howl-fm_download.js(file created)
| @@ -0,0 +1,9 @@ | |||
| 1 | + | a = document.getElementsByTagName("a"); | |
| 2 | + | out = ""; | |
| 3 | + | for (var i=0;i<a.length;i++) { | |
| 4 | + | if (a[i].hasAttribute("data-stream-url")) { | |
| 5 | + | out = out + " '" + a[i].getAttribute("data-stream-url") + "'" | |
| 6 | + | } | |
| 7 | + | }; | |
| 8 | + | prompt("urls:", out) | |
| 9 | + | //then use that with something like wget. you'll get a bunch of long filenames. use the below script to fix the filenames | |
howl-fm_renamer.py(file created)
| @@ -0,0 +1,8 @@ | |||
| 1 | + | #!/usr/bin/env python3 | |
| 2 | + | from glob import glob | |
| 3 | + | import os | |
| 4 | + | from urllib.parse import unquote | |
| 5 | + | for fn in glob("*.mp3?response-content-disposition*"): | |
| 6 | + | newfn = unquote(unquote(fn.split("filename=%22")[1].split("%22")[0])) | |
| 7 | + | os.rename(fn, newfn) | |
| 8 | + | print(newfn) | |