PatreonDownloader icon indicating copy to clipboard operation
PatreonDownloader copied to clipboard

Could not find a part of the path...

Open shinji257 opened this issue 2 years ago • 1 comments

Seems that it fails to download if part of the path ends with a space. This happens randomly at the start when I use the --json option. I worked around this by defining a download location however if the post itself has no title then it also fails in that case as well. Here is an example:

https://www.patreon.com/posts/13404620

2022-02-11 12:09:08.8478 ERROR Failed to download https://c10.patreonusercontent.com/4/patreon-media/p/post/13404620/b98a999fe56d4d9382e88fe57d8a1da2/eyJwIjoxfQ%3D%3D/1.jpg?token-time=1645833600&token-hash=01Zp_kXURHMujWCOaPqmiHkvPFQJTlER1zqO5GYm5I0%3D: Error while downloading https://c10.patreonusercontent.com/4/patreon-media/p/post/13404620/b98a999fe56d4d9382e88fe57d8a1da2/eyJwIjoxfQ%3D%3D/1.jpg?token-time=1645833600&token-hash=01Zp_kXURHMujWCOaPqmiHkvPFQJTlER1zqO5GYm5I0%3D: Unable to download from https://c10.patreonusercontent.com/4/patreon-media/p/post/13404620/b98a999fe56d4d9382e88fe57d8a1da2/eyJwIjoxfQ%3D%3D/1.jpg?token-time=1645833600&token-hash=01Zp_kXURHMujWCOaPqmiHkvPFQJTlER1zqO5GYm5I0%3D: Could not find a part of the path 'Z:\PatreonDownloader\FoxyArt\[13404620] 2017-07-26 \post_11_noviembre.jpg'.. Inner Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'Z:\PatreonDownloader\FoxyArt\[13404620] 2017-07-26 \post_11_noviembre.jpg'.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at UniversalDownloaderPlatform.DefaultImplementations.WebDownloader.DownloadFileInternal(String url, String path, Boolean overwrite, Int32 retry, Int32 retryTooManyRequests) in F:\Sources\BigProjects\PatreonDownloader\submodules\UniversalDownloaderPlatform\UniversalDownloaderPlatform.DefaultImplementations\WebDownloader.cs:line 253

shinji257 avatar Feb 11 '22 20:02 shinji257

Oddly enough looking over the code this function should prevent this scenario

https://github.com/AlexCSDev/PatreonDownloader/blob/6516f73fdc2a06d6b2b96bab01cc879305931124/PatreonDownloader.Implementation/Helpers/PostSubdirectoryHelper.cs

shinji257 avatar Feb 11 '22 21:02 shinji257

I think this should be fixed in latest build, feel free to reopen if it's not.

AlexCSDev avatar Feb 01 '23 01:02 AlexCSDev