Handle youtube links

merge-requests/30/head
Bob Mottram 2021-03-11 11:35:03 +00:00
parent 7b67d50296
commit 677b68c6ea
1 changed files with 3 additions and 1 deletions

View File

@ -168,12 +168,14 @@ def speakerReplaceLinks(sayText: str, translate: {},
linkedStr = 'Linked' linkedStr = 'Linked'
prevWord = '' prevWord = ''
for word in wordsList: for word in wordsList:
if word.startswith('v='):
replacements[word] = ''
if word.startswith(':'): if word.startswith(':'):
if word.endswith(':'): if word.endswith(':'):
replacements[word] = ', emowji ' + word.replace(':', '') + ',' replacements[word] = ', emowji ' + word.replace(':', '') + ','
continue continue
# replace mentions, but not re-tweets
if word.startswith('@') and not prevWord.endswith('RT'): if word.startswith('@') and not prevWord.endswith('RT'):
# replace mentions, but not re-tweets
if translate.get('mentioning'): if translate.get('mentioning'):
replacements[word] = \ replacements[word] = \
translate['mentioning'] + ' ' + word[1:] + ', ' translate['mentioning'] + ' ' + word[1:] + ', '