mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Possible fix for some extras having wrong path names
(for example: URL as path or NUL bytes in path)
This commit is contained in:
parent
cae29a1c1d
commit
66bd53b714
@ -1462,8 +1462,16 @@ std::vector<gameFile> Downloader::getExtras(const std::string& gamename, const s
|
||||
|
||||
// Get path from download link
|
||||
std::string url = gogAPI->getExtraLink(gamename, id);
|
||||
if (url.find("/extras/") != std::string::npos)
|
||||
{
|
||||
path.assign(url.begin()+url.find("/extras/"), url.begin()+url.find_first_of("?"));
|
||||
path = "/" + gamename + path;
|
||||
}
|
||||
else
|
||||
{
|
||||
path.assign(url.begin()+url.find_last_of("/")+1, url.begin()+url.find_first_of("?"));
|
||||
path = "/" + gamename + "/extras/" + path;
|
||||
}
|
||||
|
||||
// Get name from path
|
||||
name.assign(path.begin()+path.find_last_of("/")+1,path.end());
|
||||
|
Loading…
Reference in New Issue
Block a user