-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
_PostPathFormatter breaks Windows-style path #529
Comments
Also, I feel like full-width colon (U+FF1A) would be a better substitution for ":" than what we were using now (MODIFIER LETTER COLON, "U+A789"). It would be more consistent will others (we use full-width backslash, pipe, etc. already). |
Updated the description and title to reflect some new information. This problem is more prominent than I think; it happens all the time when you download highlights (which by default saved to a subdir in the main dir). |
Theres a trick that I use for quite a while and it works wonders. Simple put a 1 at the end of line 671. Of course this is just a fix for this isolated issue. By the way, this issue of folder formatting doesnt bug on linux, only on windows.
|
This doesn't seem to work. From the look of it, it would just change the folder name to {title}1, has no effect on (And I just tried, it indeed didn't work.: ) |
I really hope that this gets patched soon or somebody finds a workaround. It's stopping me from downloading highlights. |
Just remove instaloader/instaloader/instaloader.py Line 111 in 819426e
will fix it. |
…matter This fixes issues of path problem on Windows such as instaloader#304, instaloader#529, etc. Also made the following change: 1. Changes substitution of colon to full-width colon (U+FF1A) instead of MODIFIER LETTER COLON (U+A789) to be consistent with others (we use full-width backslash, pipe, etc. already). 1. Also replaces `\r` on Windows with space, just like `\n`.
Only substitute characters from auto generated fields in _PostPathFormatter This fixes issues of path problem on Windows such as #304, #529, etc. Also made the following changes: 1. Changes substitution of colon to full-width colon (U+FF1A) instead of MODIFIER LETTER COLON (U+A789) to be consistent with others (we use full-width backslash, pipe, etc. already). 2. Also replaces `\r` on Windows with space, just like `\n`.
Thanks for reporting! This bug has been fixed with Version 4.4.3. |
Describe the bug
_PostPathFormatter is used too aggressively in multiple places, which results in wrong folder name and structure.
Example no.1:
in command line on Windows, it will download files to
.D꞉﹨test
, instead of properD:\test
(because both:
and\
are substituted).Example no.2:
When downloading highlights, it by default download to a subfolder
Path(name) / Path(user_highlight.title)
:instaloader/instaloader/instaloader.py
Line 671 in 819426e
However, this Path-object later is butchered by
_PostPathFormatter
atinstaloader/instaloader/instaloader.py
Line 597 in 819426e
which broke all the
\
s on Windows.My suggestion is to re-think where we want to substitute the invalid characters. Maybe only do it against filename/foldername (and should also replace "/" there for any OS, if we want to avoid unexpected subdirectory creation), not fullpath. Probably only against automatically generated fields, too.
Version: 4.3a1
The text was updated successfully, but these errors were encountered: