More unescaping

merge-requests/21/head
Bob Mottram 2021-03-01 19:42:55 +00:00
parent 3807077dae
commit f262e02ff1
2 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ __maintainer__ = "Bob Mottram"
__email__ = "bob@freedombone.net"
__status__ = "Production"
import html
from person import createPerson
from person import createGroup
from person import setProfileImage
@ -1940,16 +1941,17 @@ if args.speaker:
True, __version__)
if speakerJson:
if speakerJson['say'] != prevSay:
print(speakerJson['name'] + ': ' + speakerJson['say'] + '\n')
print(html.unescape(speakerJson['name']) + ': ' +
html.unescape(speakerJson['say']) + '\n')
pitch = getSpeakerPitch(speakerJson['name'])
espeak.set_parameter(espeak.Parameter.Pitch, pitch)
rate = getSpeakerRate(speakerJson['name'])
espeak.set_parameter(espeak.Parameter.Rate, 110)
srange = getSpeakerRange(speakerJson['name'])
espeak.set_parameter(espeak.Parameter.Range, srange)
espeak.synth(speakerJson['name'])
espeak.synth(html.unescape(speakerJson['name']))
time.sleep(3)
espeak.synth(speakerJson['say'])
espeak.synth(html.unescape(speakerJson['say']))
prevSay = speakerJson['say']
time.sleep(20)
sys.exit()

View File

@ -2157,12 +2157,13 @@ def _updateSpeaker(baseDir: str, nickname: str, domain: str,
content = urllib.parse.unquote_plus(postJsonObject['object']['content'])
content = html.unescape(content)
content = removeHtml(htmlReplaceQuoteMarks(content))
content = content.replace('"', '"')
content = content.replace('"', '"').replace(''', "'")
summary = ''
if postJsonObject['object'].get('summary'):
if isinstance(postJsonObject['object']['summary'], str):
summary = \
urllib.parse.unquote_plus(postJsonObject['object']['summary'])
summary = html.unescape(summary)
speakerName = \
getDisplayName(baseDir, postJsonObject['actor'], personCache)
speakerJson = {