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

TypeError: argument of type 'NoneType' is not iterable #192

Closed
rohanmohapatra opened this issue Oct 24, 2018 · 3 comments
Closed

TypeError: argument of type 'NoneType' is not iterable #192

rohanmohapatra opened this issue Oct 24, 2018 · 3 comments
Labels
feature suggestion Feature suggestion

Comments

@rohanmohapatra
Copy link

While trying to download images through this
instaloader --filename-pattern={date_utc}_UTC_{profile} --post-filter="'4 letters' in caption" --no-metadata-json --no-compress-json <profile-name>

I got this error

[170/1382] Traceback (most recent call last):
File "d:\python 35\lib\runpy.py", line 184, in run_module_as_main
"main", mod_spec)
File "d:\python 35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\Python 35\Scripts\instaloader.exe_main
.py", line 9, in
File "d:\python 35\lib\site-packages\instaloader_main
.py", line 388, in main
storyitem_filter_str=args.storyitem_filter)
File "d:\python 35\lib\site-packages\instaloader_main_.py", line 171, in main
download_stories, fast_update, post_filter, storyitem_filter)
File "d:\python 35\lib\site-packages\instaloader\instaloader.py", line 850, in download_profiles
if post_filter is not None and not post_filter(post):
File "d:\python 35\lib\site-packages\instaloader_main
.py", line 54, in filterfunc
return bool(eval(compiled_filter, {'item': item, 'datetime': datetime.datetime}))
File "", line 1, in
TypeError: argument of type 'NoneType' is not iterable

Running Instaloader 4.1.1

This kind of error is not handled? or is it an issue from my end?

@aandergr
Copy link
Member

--post-filter="'4 letters' in caption" fails with a TypeError exception if caption is None. Better use --post-filter="caption and '4 letters' in caption".

@aandergr aandergr added question Question feature suggestion Feature suggestion labels Oct 29, 2018
@aandergr aandergr added this to the Version 4.2 milestone Nov 1, 2018
@rohanmohapatra
Copy link
Author

--post-filter="'4 letters' in caption" fails with a TypeError exception if caption is None. Better use --post-filter="caption and '4 letters' in caption".

Thank You

@aandergr
Copy link
Member

aandergr commented Nov 2, 2018

You're welcome :)

Anyway I want to keep this issue open since I like your suggestion of catching exceptions that are raised during evaluation of the --post-filter, instead of failing and terminating the whole program.

@aandergr aandergr reopened this Nov 2, 2018
@aandergr aandergr removed this from the Version 4.2 milestone Dec 21, 2018
@Thammus Thammus added the leave open Not closed automatically due to inactivity label Oct 19, 2019
@aandergr aandergr removed leave open Not closed automatically due to inactivity question Question labels Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

3 participants