Zitat von hoggle
Beitrag anzeigen
Gruss,
Stefan
try:
response = requests.get(url)
if response and response.status_code == 200:
with open(abs_fname, 'wb') as file:
file.write(response.content)
[B][COLOR=red]os.chmod(abs_fname, 0o660)[/COLOR][/B]
return fname
else:
raise requests.RequestException('Status code: {}'.format(response.status_code))
except requests.RequestException as e:
raise ("Couldn't obtain TTS from Google.\nError: {}".format(e.errno))
{% extends "rooms.html" %}
{% block content %}
<h1><img class="icon" src='{{ icon0 }}scene_bathroom.png' />Multimedia</h1>
<div class="block">
<div class="set-2" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
<div data-role="collapsible" data-collapsed="false">
<h3>Sonos</h3>
{% import "sonos.html" as sonos %}
{{ sonos.music('Play3_Sonos', 'Sonos.play', 'Sonos.stop', 'Sonos.previous', 'Sonos.next', 'Sonos.volume_up', 'Sonos.volume_down', 'Sonos.volume', 'Sonos.mute', 'Sonos.track_album_art', 'Sonos.track_artist', 'Sonos.track_title') }}
</div>
</div>
</div>
{% endblock %}
Sonos.track_album_art = http://192.168.1.110:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a1ZMODMeLK5x6W8r8jsmmgX%3fsid%3d9%26flags%3d32

try:
response = requests.get(url)
if response and response.status_code == 200:
with open(abs_fname, 'wb') as file:
file.write(response.content)
[B][COLOR="red"]os.chmod(abs_fname, 0o660)[/COLOR][/B]
return fname
else:
raise requests.RequestException('Status code: {}'.format(response.status_code))
except requests.RequestException as e:
raise ("Couldn't obtain TTS from Google.\nError: {}".format(e.errno))
2014-08-02 12:27:39,119 DEBUG Thread-23 arguments: rincon_000e58a910a801400, hallo, de20 | ip: 192.168.0.114 -- sonos_commands.py:speaker_play_tts:178
192.168.0.114 - - [02/Aug/2014 12:27:39] "GET /speaker/rincon_000e58a910a801400/play_tts/hallo/de20 HTTP/1.1" 200 -
2014-08-02 12:27:39,161 INFO Thread-25 Starting new HTTP connection (1): translate.google.com -- connectionpool.py:_new_conn:171
2014-08-02 12:27:39,195 ERROR Thread-24 'Command' object has no attribute 'favicon.ico' -- sonos_commands.py:do_work:44
192.168.0.114 - - [02/Aug/2014 12:27:39] "GET /favicon.ico HTTP/1.1" 400 -
2014-08-02 12:27:39,255 DEBUG Thread-25 "GET /translate_tts?ie=UTF-8&tl=de20&q=hallo HTTP/1.1" 404 0 -- connectionpool.py:_make_request:344
Exception in thread Thread-25:
Traceback (most recent call last):
File "/opt/sonos/server.sonos/lib_sonos/utils.py", line 136, in save_google_tts
raise requests.RequestException('Status code: {}'.format(response.status_code))
requests.exceptions.RequestException: Status code: 404
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.2/threading.py", line 740, in _bootstrap_inner
self.run()
File "/usr/lib/python3.2/threading.py", line 693, in run
self._target(*self._args, **self._kwargs)
File "/opt/sonos/server.sonos/lib_sonos/sonos_speaker.py", line 672, in _play_tts_thread
raise err
File "/opt/sonos/server.sonos/lib_sonos/sonos_speaker.py", line 663, in _play_tts_thread
fname = utils.save_google_tts(local_share, tts, language, quota)
File "/opt/sonos/server.sonos/lib_sonos/utils.py", line 138, in save_google_tts
raise ("Couldn't obtain TTS from Google.\nError: {}".format(e.errno))
TypeError: exceptions must derive from BaseException
^C2014-08-02 12:27:40,481 DEBUG MainThread unsubscribing from sonos speakers ... -- sonos_broker:stop:238
2014-08-02 12:27:40,512 INFO MainThread Starting new HTTP connection (1): 192.168.0.117 -- connectionpool.py:_new_conn:171
2014-08-02 12:27:40,529 DEBUG MainThread "UNSUBSCRIBE /ZoneGroupTopology/Event HTTP/1.1" 200 None -- connectionpool.py:_make_request:344
2014-08-02 12:27:40,539 DEBUG MainThread Unsubscribed from http://192.168.0.117:1400/ZoneGroupTopology/Event, sid: uuid:RINCON_B8E93752A4E001400_sub0000002367 -- events.py:unsubscribe:403
2014-08-02 12:27:40,569 INFO MainThread Starting new HTTP connection (1): 192.168.0.117 -- connectionpool.py:_new_conn:171
2014-08-02 12:27:40,585 DEBUG MainThread "UNSUBSCRIBE /MediaRenderer/AVTransport/Event HTTP/1.1" 200 None -- connectionpool.py:_make_request:344
2014-08-02 12:27:40,595 DEBUG MainThread Unsubscribed from http://192.168.0.117:1400/MediaRenderer/AVTransport/Event, sid: uuid:RINCON_B8E93752A4E001400_sub0000002368 -- events.py:unsubscribe:403
2014-08-02 12:27:40,626 INFO MainThread Starting new HTTP connection (1): 192.168.0.117 -- connectionpool.py:_new_conn:171
2014-08-02 12:27:40,643 DEBUG MainThread "UNSUBSCRIBE /MediaRenderer/RenderingControl/Event HTTP/1.1" 200 None -- connectionpool.py:_make_request:344
2014-08-02 12:27:40,653 DEBUG MainThread Unsubscribed from http://192.168.0.117:1400/MediaRenderer/RenderingControl/Event, sid: uuid:RINCON_B8E93752A4E001400_sub0000002369 -- events.py:unsubscribe:403
{% extends "rooms.html" %}
{% block content %}
<h1><img class="icon" src='{{ icon0 }}scene_bathroom.png' />Multimedia</h1>
<div class="block">
<div class="set-2" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
<div data-role="collapsible" data-collapsed="false">
<h3>Sonos</h3>
{% import "sonos.html" as sonos %}
{{ sonos.music('Play3_Sonos', 'Sonos.play', 'Sonos.stop', 'Sonos.previous', 'Sonos.next', 'Sonos.volume_up', 'Sonos.volume_down', 'Sonos.volume', 'Sonos.mute', 'Sonos.track_album_art', 'Sonos.track_artist', 'Sonos.track_title') }}
</div>
</div>
</div>
{% endblock %}
Sonos.track_album_art = http://192.168.1.110:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a1ZMODMeLK5x6W8r8jsmmgX%3fsid%3d9%26flags%3d32
//------Sonos---------
$(document).delegate('[data-widget="sonos.music"]',{update:function(e,r){if (r.toString()){document.getElementById(this.id).src=r.toString()+'?_='+new Date().getTime();}else{document.getElementById(this.id).src="pages/base/pics/trans.png";}}});
div class="block" style="width:100%">
<div class="set-2" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
<div data-role="collapsible" data-collapsed="false">
<h3>Sonos Esszimmer</h3>
<table width=100%>
<tr>
<td align=left>
{% import "sonos.html" as sonos %}
{{ sonos.music('Play3_Kueche', 'Sonos.play', 'Sonos.stop', 'Sonos.previous', 'Sonos.next', 'Sonos.volume_up', 'Sonos.volume_down', 'Sonos.volume', 'Sonos.mute', 'Sonos.track_album_art', 'Sonos.track_artist', 'Sonos.track_title') }}
</td>
</tr>
</table>
</div>
</div>
</div>
[Sonos]
[[track_album_art]]
type = str
visu_acl = rw
sonos_recv = track_album_art
Wir verarbeiten personenbezogene Daten über die Nutzer unserer Website mithilfe von Cookies und anderen Technologien, um unsere Dienste bereitzustellen. Weitere Informationen findest Du in unserer Datenschutzerklärung.
Indem Du unten auf "ICH stimme zu" klickst, stimmst Du unserer Datenschutzerklärung und unseren persönlichen Datenverarbeitungs- und Cookie-Praktiken zu, wie darin beschrieben. Du erkennst außerdem an, dass dieses Forum möglicherweise außerhalb Deines Landes gehostet wird und bist damit einverstanden, dass Deine Daten in dem Land, in dem dieses Forum gehostet wird, gesammelt, gespeichert und verarbeitet werden.


Einen Kommentar schreiben: