Hi,

I liked using one of the rain sounds as some white noise to help sleep,
which also uses the Sounds & Effects plugins.

As far as I can tell the DNS name for content.mysqueezebox.com
disappeared. It looks like content.mysqueezebox.com was a CNAME for
mysqueezebox.com, as the sound clips are still available at the same
path on mysqueezebox.com

Ideally someone would fix DNS but I have no idea how to get anyone's
attention.

A hacky solution might be to add one of the IP addresses for
mysqueezebox to your hosts file for content.mysqueezebox.com

I also wanted to reduce my dependency on cloud services so I've found
the Sounds & Effects plugin downloads the opml file from the
mysqueezebox server at the url path "/api/sounds/v1/opml". That file
contains the links to all the sounds. Rewriting the hostname in the opml
file let me download all the files, and I hope to hack the plugin to
point to a url on my own server instead of depending on mysqueezebox.

This chunk of python code that needs the requests & lxml modules
installed will download all the sounds to the sub-directory sounds/ from
wherever it's run. (Though I have no idea what the license on the sound
clips might be, so i don't know how OK this downloading is with the
copyright owner), also I haven't participated here before so I can't
post urls right now. So you'll have to figure out the link to the opml
file on your own.

from lxml import etree
import requests
from urllib import parse
from pathlib import Path
import shutil

url = #opml url that I can't post because i'm a newbie
tree = etree.parse(url)
root = tree.getroot()
body = root.getchildren()[1]
for headings in body:
print(headings.attrib['text'])
for loop in headings:
attribs = loop.attrib
label = attribs["text"]
url = parse.urlparse(attribs["URL"])
target = Path(url.path.replace("/static/", ""))
url = parse.urlunparse(("http", "mysqueezebox.com", url.path,
url.params, url.query, url.fragment))
if not target.exists():
print("Downloading {} {} to {}".format(label, url, target))
target.parent.mkdir(parents=True, exist_ok=True)
with open(target, "wb") as outstream:
response = requests.get(url, stream=True)
shutil.copyfileobj(response.raw, outstream)
else:
print("{} {} exists".format(label, target))


------------------------------------------------------------------------
detrout's Profile: http://forums.slimdevices.com/member.php?userid=73109
View this thread: http://forums.slimdevices.com/showthread.php?t=116982

_______________________________________________
Squeezecenter mailing list
Squeezecenter@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to