Instaloader: Download stories in python module

Created on 7 Apr 2020  路  3Comments  路  Source: instaloader/instaloader

I need to download all stories from a lot of profiles. How can I do it?
I try to run example from the documentation like this

for story in L.get_stories():
for item in story.get_items():
L.download_storyitem(item, ':stories')

but I get error "TypeError: expected str, got bool"

And if I am right to understand in this case I'll get all stories from my profile, but I want to get stories from any profile if it is open.

I use the last version of Instaloader

question stale

All 3 comments

L = instaloader.Instaloader()
L.login(USER, PASSWORD)

for story in L.get_stories():
    for item in story.get_items():
        L.download_storyitem(item, ':stories')

This following code from docs will download all stories you can see on your friends profile and it works just fine for me.

_Python 3.6.9
Instaloader 4.3.2_

You can download stories from specific user like this

L = instaloader.Instaloader()
L.login(USER, PASSWORD)
L.download_stories(userids=[460563723])
# You can pass multiple ids like [460563723, 460563723, 460563723]

To get profile ID you can use

L = instaloader.Instaloader()
profile = L.check_profile_id("SelenaGomez")
>>> profile.userid
460563723

There has been no activity on this question for an extended period of time. This issue will be closed after further 14 days of inactivity.

Is there any possibility to pass the "dirname_pattern" to
L.download_stories(userids=[])
?
If i download it, all content goes in the : Stories folder and not in the {target} folder.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clublek picture clublek  路  3Comments

kurttian picture kurttian  路  3Comments

Zachary24 picture Zachary24  路  3Comments

WaseemRakab picture WaseemRakab  路  3Comments

remlap picture remlap  路  3Comments