修复多次添加参数的bug

This commit is contained in:
nilaoda 2022-11-11 01:04:36 +08:00
parent 03fa68b90b
commit 6c9c3e1c62
1 changed files with 6 additions and 3 deletions

View File

@ -21,10 +21,13 @@ namespace N_m3u8DL_RE.Parser.Processor
var uriFromConfig = new Uri(paserConfig.Url);
var newUri = new Uri(oriUrl);
var newQuery = (newUri.Query.TrimStart('?') + "&" + uriFromConfig.Query.TrimStart('?')).Trim('&');
if (!oriUrl.Contains(uriFromConfig.Query))
{
Logger.Debug("Before: " + oriUrl);
oriUrl = (newUri.GetLeftPart(UriPartial.Path) + "?" + newQuery).TrimEnd('?');
Logger.Debug("After: " + oriUrl);
}
}
return oriUrl;
}