Got a litle further with escaping characters thanks to Ludeeus.
but the problem so far are the special characters inside of the Sentences
hangouts:
intents:
youtube:
sentences:
- https://www.youtube.com/watch\?v\={ytlink2}
intent_script:
youtube:
speech:
text: casting {{ ytlink2 }}
action:
- service: media_extractor.play_media
data_template:
media_content_id: "https://youtu.be/{{ytlink2}}"
entity_id: media_player.chromecast_wz
media_content_type: video
This works with links like:
https://www.youtube.com/watch?v=B5KmQm3eKcU
but not with https://www.youtube.com/watch?v=p3-pGKE9824
https://www.youtube.com/watch\?v\={\ytlink2\}
gives an error with
File "/usr/local/lib/python3.7/re.py", line 234, in compile
return _compile(pattern, flags)
File "/usr/local/lib/python3.7/re.py", line 286, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/local/lib/python3.7/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/local/lib/python3.7/sre_parse.py", line 930, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/local/lib/python3.7/sre_parse.py", line 426, in _parse_sub
not nested and not items))
File "/usr/local/lib/python3.7/sre_parse.py", line 507, in _parse
code = _escape(source, this, state)
File "/usr/local/lib/python3.7/sre_parse.py", line 402, in _escape
raise source.error("bad escape %s" % escape, len(escape))
re.error: bad escape \y at position 36
same with normal sentences
tts hello
I know hello
tts hello space 123
I know hello space 123
hello. a single dot is braking everything
Sorry, I didn't understand that