mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.87k stars 976 forks source link

Instagram pinned posts download first #5877

Closed FifaHeimer closed 3 months ago

FifaHeimer commented 3 months ago

When downloading an instagram user the pinned posts get detected/downloaded first no matter how old those posts are.

Therefore a filter option like this: --filter "date >= datetime(2024, 7, 1) or abort()" does not work to get new posts because often the pinned posts are months or years old.

taskhawk commented 3 months ago

That's how Instagram returns the posts. Use the skip option in your config with a value like abort:5 to skip the pinned posts and continue the download until it encounters 5 posts in a row that were already downloaded, or adjust as you see fit. In the terminal use it like this instead: -o skip='abort:5'.

mikf commented 3 months ago

There's a pinned field that can be used to check for pinned posts:

--filter "not pinned and (date >= datetime(2024, 7, 1) or abort())"
FifaHeimer commented 3 months ago

There's a pinned field that can be used to check for pinned posts:

--filter "not pinned and (date >= datetime(2024, 7, 1) or abort())"

Thank you very much, did not know that option, it really helps a lot! Just one small issue: It works great for posts & reels but doesn't detect any stories (even when there are stories in that time period).

Is there any tweak to that filter that it detects stories as well?

mikf commented 3 months ago

pinned is only defined for posts/reels, but not for stories/highlights. You can use locals().get('...') to access a potentially undefined value without error.

--filter "not locals().get('pinned') and (date >= datetime(2024, 7, 1) or abort())"
FifaHeimer commented 3 months ago

pinned is only defined for posts/reels, but not for stories/highlights. You can use locals().get('...') to access a potentially undefined value without error.

--filter "not locals().get('pinned') and (date >= datetime(2024, 7, 1) or abort())"

Thank you again, now it works perfect!