Remove http prefix from peertube sites

merge-requests/8/head
Bob Mottram 2020-12-24 13:13:03 +00:00
parent 1f46af59a8
commit 00eadf8423
1 changed files with 7 additions and 1 deletions

View File

@ -139,7 +139,13 @@ def _addEmbeddedVideoFromSites(translate: {}, content: str,
'peertube.video')
for site in peerTubeSites:
siteStr = site
if not site.startswith('http'):
if site.startswith('http://'):
site = site.replace('http://', '')
elif site.startswith('https://'):
site = site.replace('https://', '')
if site.endswith('.onion') or site.endswith('.i2p'):
siteStr = 'http://' + site
else:
siteStr = 'https://' + site
siteStr = '"' + siteStr
if siteStr in content: