Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR Failed to download - Could not find part of the path, System Exception. #211

Open
bahdahbadha opened this issue Dec 17, 2023 · 2 comments

Comments

@bahdahbadha
Copy link

Downloading fails because the path to the downloaded file is unable to be found?
Below I write the entire error message for a single file (while also taking out possible personal data).

2023-12-17 18:07:12.9775 INFO Downloading...
2023-12-17 18:07:13.7679 ERROR Failed to download [LINK]: Error while downloading [LINK]: Unable to download from [LINK]: Could not find a part of the path 'C:\net6.0-win-x64-release\download[PATREON] \64669643_media_147675729_1.jpg.dwnldtmp'.. Inner Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\net6.0-win-x64-release\download[PATREON] \64669643_media_147675729_1.jpg.dwnldtmp'.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at UniversalDownloaderPlatform.DefaultImplementations.WebDownloader.DownloadFileInternal(String url, String path, String refererUrl, Int32 retry, Int32 retryTooManyRequests) in F:\Sources\BigProjects\PatreonDownloader\submodules\UniversalDownloaderPlatform\UniversalDownloaderPlatform.DefaultImplementations\WebDownloader.cs:line 218
2023-12-17 18:07:13.7679

Personally I found it weird that there was a space after the patreon name "...[PATREON NAME] \658749..." in comparison to "...[PATREON NAME]\658749..."
, but I don't know much about coding so this might not matter at all.

@bahdahbadha
Copy link
Author

bahdahbadha commented Dec 20, 2023

I've figured out the issue! The creator I was trying to download from has a space at the end of their name which tries to make it into the path when downloading. This obviously means that the download path is unable to be found since well... Windows doesn't support spaces at the end of a path!

i.e. blah/blah /blah isn't supported as a valid path and when folders or files with spaces at the end are made they automatically turn into spaceless versions.
(so a/b /c attempts to make a/b / which turns into a/b/ which then means that a/b /c is unable to be found)

I figured this out because this other patreon downloader [https://chromewebstore.google.com/detail/patreon-downloader/fmhpbbdpdhjkpbklloabkncldkmggaik] allows one to manually set the folder name. This automatic folder name (which usually is the patreon account you're downloading from) also had a space at the end of it. This implies to me that while the creator was setting their name that they accidentally left a space at the end.

However, highlighting their name in the page itself doesn't show this space at all? Further, this space isnt in the url either (because urls dont support spaces at all). I wonder why Patreon allowed their name to have a "hidden" space at the end at all, or how both tools (this and the other patreon downloader) is scraping this information whilst Patreon themselves are seemingly ignoring it (and therefore should've automatically removed it).

I am willing to share the patreon I was attempting to download from if needed (although I'd rather it be private).

@TheSonic03
Copy link

TheSonic03 commented Jan 4, 2024

Same issue.
I resolved this by adding "--download-directory c:\downloads" for download the file in a specific folder.
It's a workaround but it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants