Replies: 2 comments
-
No, but you can do something like this to fulfill this purpose: #!/usr/bin/env bash
declare -A DATA=(
["https://www.instagram.com/username1/"]="3-5"
["https://www.instagram.com/username2/"]="2,4,6"
["https://www.instagram.com/username3/"]="10"
)
for url in "${!DATA[@]}"; do
rng="${DATA[$url]}"
gallery-dl \
--cookies-from-browser firefox \
--range "$rng" \
"$url"
doneor using #!/usr/bin/env python3
import logging
from gallery_dl import job, config, output
output.initialize_logging(logging.DEBUG)
config.load()
config.set((), "cookies", ["firefox"])
data = {
"https://www.instagram.com/username1/": "3-5",
"https://www.instagram.com/username2/": "2,4,6",
"https://www.instagram.com/username3/": "10",
}
for url, range in data.items():
config.set(("extractor",), "image-range", range)
job.DownloadJob(url).run() |
Beta Was this translation helpful? Give feedback.
-
Yes, it can't work that way. Only if IG themselves would understand/support such URLs with this kind of "parameter"
Yeah, there's an easy way to apply a specific option (or options) to a certain input URL, with gallery-dl built-in input file processing: gallery-dl/gallery_dl/__init__.py Lines 408 to 436 in 866e6df |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I have a list of Instagram URLs in a txt file, gallery-dl automatically downloads all the images. But I only need to download specific images from each URL instead of scraping it all. For example, if my txt file looked like this:
https://www.instagram.com/p/Link_1/ --range 1, 3
https://www.instagram.com/p/Link_2/ -- range 2, 4, 6
https://www.instagram.com/p/Link_3/ --range 10
That doesn't work in gallery-dl, but is there a method that works to apply the "--range" option to individual URLs in a txt file?
Another option would be to list the specific URL for each image. For example:
https://www.instagram.com/p/Link_1/?img_index=1
https://www.instagram.com/p/Link_1/?img_index=3
https://www.instagram.com/p/Link_2/?img_index=2
https://www.instagram.com/p/Link_2/?img_index=4
https://www.instagram.com/p/Link_2/?img_index=6
https://www.instagram.com/p/Link_3/?img_index=10
However, gallery-dl downloads all the images instead of just the specified images.
Beta Was this translation helpful? Give feedback.
All reactions