Instaloader: Crash when downloading a Highlight

Created on 10 Mar 2019  路  3Comments  路  Source: instaloader/instaloader

Instaloader crashes when I try to download a Highlight with ".." in its name.

馃敟馃敟馃敟 I tested this with multiple accounts, I get the same error. 馃敟馃敟馃敟

Steps to reproduce the behavior:
Any account with a highlight that has ".." in its name

Error messages and tracebacks

$ instaloader username --no-posts --highlights
.
Retrieving highlights "Cats.." from profile username
[  1/  4] username/Cats../2019-02-13_10-23-25_UTC.jpg Traceback (most recent call last):
  File "C:\python3\python-3.6.1.amd64\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\python3\python-3.6.1.amd64\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\python3\python-3.6.1.amd64\Scripts\instaloader.exe\__main__.py", line 9, in <module>
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\__main__.py", line 410, in main
    storyitem_filter_str=args.storyitem_filter)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\__main__.py", line 186, in _main
    download_stories, fast_update, post_filter, storyitem_filter)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 961, in download_profiles
    self.download_highlights(profile, fast_update=fast_update, storyitem_filter=storyitem_filter)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 47, in call
    return func(instaloader, *args, **kwargs)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 620, in download_highlights
    else '{}/{}'.format(name, user_highlight.title))
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 555, in download_storyitem
    downloaded = self.download_pic(filename=filename, url=url, mtime=date_local)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 65, in call
    return func(instaloader, *args, **kwargs)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloader.py", line 227, in download_pic
    self.context.get_and_write_raw(url, filename)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloadercontext.py", line 523, in get_and_write_raw
    self.write_raw(self.get_raw(url), filename)
  File "C:\python3\python-3.6.1.amd64\lib\site-packages\instaloader\instaloadercontext.py", line 489, in write_raw
    with open(filename, 'wb') as file:
FileNotFoundError: [Errno 2] No such file or directory: 'username/Cats../2019-02-13_10-23-25_UTC.jpg'

Instaloader version

$ instaloader --version
4.2.3

Edit:
Windows automatically removes final ".." when creating a folder, then it crashes when it tries to access folder "Cats" without ".." in it.

Windows bug stale

All 3 comments

I can confirm that the problem is because there's a highlight with ".. " in it. I tried creating a highlight with ".." as its name, and the script would crash.
Here's one of my recent crashes with the following user "mayatoister" , I hope you solve the problem , because its really annoying
Crash log.txt
adi.txt

Similar to #185, in that it also refers to windows filename restrictions.

There has been no activity on this issue for an extended period of time. This issue will be closed after further 14 days of inactivity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

annanny picture annanny  路  3Comments

tehgarra picture tehgarra  路  4Comments

ealgase picture ealgase  路  4Comments

alu45 picture alu45  路  4Comments

1337-Pete picture 1337-Pete  路  3Comments