Preserve youtube links

merge-requests/30/head
Bob Mottram 2021-03-18 18:37:55 +00:00
parent 5d7b24d724
commit 47a6d178e0
2 changed files with 4 additions and 2 deletions

View File

@ -542,8 +542,8 @@ def _desktopShowBoxJson(boxName: str, boxJson: {},
if not postJsonObject['object'].get('content'): if not postJsonObject['object'].get('content'):
continue continue
published = postJsonObject['published'].replace('T', ' ') published = postJsonObject['published'].replace('T', ' ')
posStr = str(ctr) + '.' posStr = str(ctr)
while len(posStr) < 3: while len(posStr) < 2:
posStr += ' ' posStr += ' '
authorActor = postJsonObject['object']['attributedTo'] authorActor = postJsonObject['object']['attributedTo']
name = getNicknameFromActor(authorActor) name = getNicknameFromActor(authorActor)

View File

@ -168,8 +168,10 @@ def speakerReplaceLinks(sayText: str, translate: {},
Instead of reading out potentially very long and meaningless links Instead of reading out potentially very long and meaningless links
""" """
text = sayText text = sayText
text = text.replace('?v=', '__v=')
for ch in speakerRemoveChars: for ch in speakerRemoveChars:
text = text.replace(ch, ' ') text = text.replace(ch, ' ')
text = text.replace('__v=', '?v=')
replacements = {} replacements = {}
wordsList = text.split(' ') wordsList = text.split(' ')
if translate.get('Linked'): if translate.get('Linked'):