Remove formatting from youtube replacement domain

main
Bob Mottram 2020-08-02 12:14:30 +01:00
parent 041f6b8a63
commit 3d3bcda6db
2 changed files with 11 additions and 4 deletions

View File

@ -6311,11 +6311,14 @@ class PubServer(BaseHTTPRequestHandler):
if fields.get('ytdomain'):
currYTDomain = self.server.YTReplacementDomain
if fields['ytdomain'] != currYTDomain:
newYTDomain = fields['ytdomain']
if '://' in newYTDomain:
newYTDomain = newYTDomain.split('://')[1]
if '/' in newYTDomain:
newYTDomain = newYTDomain.split('/')[0]
setConfigParam(self.server.baseDir,
'youtubedomain',
fields['ytdomain'])
self.server.YTReplacementDomain = \
fields['ytdomain']
'youtubedomain', newYTDomain)
self.server.YTReplacementDomain = newYTDomain
currInstanceDescriptionShort = \
getConfigParam(self.server.baseDir,

View File

@ -1796,6 +1796,10 @@ if not registration:
YTDomain = getConfigParam(baseDir, 'youtubedomain')
if YTDomain:
if '://' in YTDomain:
YTDomain = YTDomain.split('://')[1]
if '/' in YTDomain:
YTDomain = YTDomain.split('/')[0]
args.YTReplacementDomain = YTDomain
if setTheme(baseDir, themeName):