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

[Instagram] Support for ignoring pinned posts for extractor.*.skip #2752

Open
Infinitay opened this issue Jul 12, 2022 · 9 comments
Open

[Instagram] Support for ignoring pinned posts for extractor.*.skip #2752

Infinitay opened this issue Jul 12, 2022 · 9 comments

Comments

@Infinitay
Copy link
Contributor

Instagram recently introduced a feature that allows users to pin certain posts to their profiles. In my opinion this interferes directly with the use of the skip extractor option. Reason being is because current behavior will see the latest posts are those pinned posts. Depending on how many pinned media there is and your skip extractor option, the rest of the posts would be skipped.

For example, consider the following Instagram, https://www.instagram.com/h1ghrmusic/. At the time of this issue they have three pinned posts. Post one has one media. Post two has eight pieces of media. Post three has two pieces of media.

gallery-dl -u <username> -p <password> \
    --download-archive gallery-dl_instagram_archive \
    -o extractor.instagram.archive-prefix="{category}] {username}({owner_id})" \
    -o extractor.instagram.archive-format=" {subcategory}_{shortcode}" \
    -o extractor.instagram.skip="abort:2" -o extractor.instagram.include="posts" \
    --mtime-from-date --verbose \
    https://www.instagram.com/h1ghrmusic/

What I did was run the following command above once and stop it as soon as it downloaded the first two posts or eight pieces of media. At this point I terminated the command forcefully.

I attempted to run the same command above one more time, again with -o extractor.instagram.skip="abort:2". It automatically aborted as it should have as it found two pieces of media already in the archive. I changed the command to -o extractor.instagram.skip="abort:3" just to confirm and it also aborted. When I changed the command to -o extractor.instagram.skip="abort:10" it started downloading the remaining images.

I would like to request either a new extractor option or updated skip behavior for the Instagram module to ignore pinned posts when it comes to argument(s) passed in to skip extractor option.

@afterdelight
Copy link

why did you want to skip a pinned post?

@Infinitay
Copy link
Contributor Author

why did you want to skip a pinned post?

I am realizing now I did not clarify that in the logic this new extractor option would still download pinned posts should they not be in the archive. However, if the current media that is in a pinned post is within the archive, don't count it towards the skip extractor such as in the case of abort:n

I hope that clears up any confusion.

@afterdelight
Copy link

i still dunt undestand

mikf added a commit that referenced this issue Jul 13, 2022
'pinned' is a list of user IDs for which a post is pinned
and empty if not pinned anywhere.
@mikf
Copy link
Owner

mikf commented Jul 13, 2022

This is not entirely what you requested (integrating something like this into the whole skip/archive logic is complicated and error prone), but it at least allows you to filter by pinned status: 467a2a4.

--filter "not pinned" to ignore any pinned posts,
--filter "pinned or abort()" to only download the first few pinned posts.

@Infinitay
Copy link
Contributor Author

Infinitay commented Jul 13, 2022

It might not be what I requested but I appreciate it nonetheless. I'll go ahead and modify my current script to re-run the command but this time passing in --filter "not pinned". Probably not efficient and might result in locks/bot checks faster, but better than nothing.

Thanks again

Also, do you have a certain release schedule for chocolatey pushes?

@mikf
Copy link
Owner

mikf commented Jul 18, 2022

I do not have any control over chocolatey releases or really any listed on https://repology.org/project/gallery-dl/versions. I am only responsible for GitHub and Snap releases, everything else is handled by someone other than me.

The one in charge of chocolatey releases seems to be Starz0r here on GitHub. Maybe ping him?

@Hrxn
Copy link
Contributor

Hrxn commented Jul 18, 2022

You mean GitHub, Snap, and PyPI (the official Python Package Index)?

@mikf mikf mentioned this issue May 27, 2023
Closed
@bossanovaorca
Copy link

This is not entirely what you requested (integrating something like this into the whole skip/archive logic is complicated and error prone), but it at least allows you to filter by pinned status: 467a2a4.

--filter "not pinned" to ignore any pinned posts, --filter "pinned or abort()" to only download the first few pinned posts.

how could this be used in a JSON configuration file? I couldn't find any information on it in the docs here https://gdl-org.github.io/docs/configuration.html

@Hrxn
Copy link
Contributor

Hrxn commented Nov 17, 2024

It's "image-filter"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants