优化文件名获取
This commit is contained in:
parent
4cc5fd6d35
commit
bbc59e9904
|
@ -584,7 +584,7 @@ namespace N_m3u8DL_RE.DownloadManager
|
||||||
|
|
||||||
private string GetPath(string url)
|
private string GetPath(string url)
|
||||||
{
|
{
|
||||||
return new Uri(url).GetLeftPart(UriPartial.Path);
|
return url.Split('?').First();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> StartRecordAsync()
|
public async Task<bool> StartRecordAsync()
|
||||||
|
|
|
@ -82,9 +82,8 @@ namespace N_m3u8DL_RE.Util
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var uri = new Uri(input);
|
var uri = new Uri(input.Split('?').First());
|
||||||
var name = uri.GetLeftPart(UriPartial.Path).Split('/').Last();
|
var name = Path.GetFileNameWithoutExtension(uri.LocalPath);
|
||||||
name = string.Join(".", name.Split('.').SkipLast(1)).Trim('.');
|
|
||||||
saveName = GetValidFileName(name) + "_" + saveName;
|
saveName = GetValidFileName(name) + "_" + saveName;
|
||||||
}
|
}
|
||||||
return saveName;
|
return saveName;
|
||||||
|
|
Loading…
Reference in New Issue