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'): if fields.get('ytdomain'):
currYTDomain = self.server.YTReplacementDomain currYTDomain = self.server.YTReplacementDomain
if fields['ytdomain'] != currYTDomain: 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, setConfigParam(self.server.baseDir,
'youtubedomain', 'youtubedomain', newYTDomain)
fields['ytdomain']) self.server.YTReplacementDomain = newYTDomain
self.server.YTReplacementDomain = \
fields['ytdomain']
currInstanceDescriptionShort = \ currInstanceDescriptionShort = \
getConfigParam(self.server.baseDir, getConfigParam(self.server.baseDir,

View File

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