Instaloader download_profiles with post_filter example?

953 Views Asked by At

I'm trying to download a profile with posts after a certain date as a test. I have the simple code:

L = instaloader.Instaloader(save_metadata=False, download_comments=False)
L.download_profiles(Profiles, posts=True, fast_update=True, post_filter="date_utc >= datetime(2019, 1, 1)")

It works fine without the post_filter, but with the post_filter, I get:

<Post BOJaRXwhIix> skipped. Filter evaluation failed: 'str' object is not callable
<Post BOJZ6nqhpkX> skipped. Filter evaluation failed: 'str' object is not callable
<Post BHDC70ShoOs> skipped. Filter evaluation failed: 'str' object is not callable

I think I'm missing something obvious, but the documentation says that the post_filter string should be a Python-legal boolean statement, and I got this example directly from the command-line filter example in the docs. Advice?

1

There are 1 best solutions below

1
On
L.download_profiles(Profiles, posts=True, fast_update=True, post_filter=lambda post: post.date_utc >= datetime(2019, 1, 1))