Skip to content

Conversation

@exwm
Copy link
Contributor

@exwm exwm commented Aug 31, 2024

Fixes #812.

Uses doc_id-based graphql queries identified from the IG web client. Requires fetching additional metadata for each reel which can eventually exhaust IG rate limits.

@exwm exwm marked this pull request as draft August 31, 2024 18:39
@exwm exwm changed the base branch from master to upcoming/v4.14 August 31, 2024 18:53
@exwm exwm marked this pull request as ready for review August 31, 2024 18:53
@sapphirepro
Copy link

Needed feature. Please merge it

@MonkeyKingViper
Copy link

Very needed feature. The current wave of content creators are using IG similarly to Tiktok and have only a few hundred posts but multiple hundreds to thousands of reels

@MonkeyKingViper
Copy link

MonkeyKingViper commented Sep 9, 2024

@exwm A quick note as I just tested your update: When downloading reels vs stories or posts, the total count isn't functioning as expected.

For example, I just downloaded the reels for a certain profile. Instead of [1/22], [2/22], [3/22]...[22/22], it was just [1], [2], [3]...[22] then done. Could this be a bug, or just that IG doesn't give a total for reels like posts? Is that what you meant in your notes on structures.py?

Also could be user error as I didn't update to your branch, but edited my library to match your update. I can restore to my backup and reupdate if you think I'm wrong.

@Today20092
Copy link

Today20092 commented Sep 10, 2024

using --reels is not working for me, not sure why tbh. It only downloaded one reel.

Edit: it looks like --fast-update was causing an issue.

@exwm
Copy link
Contributor Author

exwm commented Sep 12, 2024

@exwm A quick note as I just tested your update: When downloading reels vs stories or posts, the total count isn't functioning as expected.

For example, I just downloaded the reels for a certain profile. Instead of [1/22], [2/22], [3/22]...[22/22], it was just [1], [2], [3]...[22] then done. Could this be a bug, or just that IG doesn't give a total for reels like posts? Is that what you meant in your notes on structures.py?

Yes, I wasn't able to find a total count for reels so that is expected.

Copy link
Member

@aandergr aandergr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for figuring this out! This is a well-desired feature. I have only some very minor suggestions and then we are happy to merge :)

@exwm exwm requested a review from aandergr September 27, 2024 20:52
@Arche151
Copy link

@exwm I installed your fork, but unfortunately, I am unable to download reels.

I get the error KeyError: 'edge_felix_video_timeline'

Do you maybe have an idea on how to fix it?

I tried to download the reels by running instaloader --reels accountname --load-cookies Chrome and I'm on Ubuntu 22.04.

Thank you :)

@exwm
Copy link
Contributor Author

exwm commented Sep 28, 2024

@Arche151

edge_felix_video_timeline is only referenced when --igtv is enabled I think. IGTV was removed from IG as far as I know. Are you sure you didn't add --igtv somewhere?

EDIT: Nvm, I actually broke profile downloading because I didn't update callers when I reordered function parameters. Should be fixed now.

…rds compat

* fixes doc uses of igtv instead of reels for reels-related features
* ensure versionadded and versionchanged directives are added for new reels-related features
@Arche151
Copy link

@exwm With the new version, the reels-download works now! Thanks a lot for the fix :)

@MonkeyKingViper
Copy link

MonkeyKingViper commented Sep 30, 2024

@exwm Hmmm. I seem to be running into an error and not sure why, because I thought references to "rhx_gis" this were removed.

For this example, I'm currently scraping only stories. I use an arg file that has about 12 profiles in it. Then I run it from the CL. One of the 12 profiles is one that goes active and inactive every few days, so I keep it in the list just to let me know when she's back. Essentially, if I gat a message about the profile not existing and having to look it up by ID, I know the page is inactive. If it scrapes her, then it's back up. But after updating my setup to the files you've updated for the reels downloads, I've started getting the folowing:

Using latest stamps from C:\Users\XXXX\AppData\Local\Instaloader\latest-stamps.ini.
Loaded session from C:\Users\XXXX\AppData\Local\Instaloader\session-XXXX.
Logged in as XXXX.
Trying to find profile laurenhamden using its unique ID 807863763.
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Scripts\instaloader.exe_main
.py", line 7, in
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\instaloader_main
.py", line 584, in main
exit_code = main(loader,
^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\instaloader_main
.py", line 264, in _main
profile = instaloader.check_profile_id(target, latest_stamps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\instaloader\instaloader.py", line 1396, in check_profile_id
profile_from_id = Profile.from_id(self.context, profile_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\instaloader\structures.py", line 912, in from_id
rhx_gis=context.root_rhx_gis)['data']['user']
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'InstaloaderContext' object has no attribute 'root_rhx_gis'

So it seems something in your code is breaking when we hit a profile we have to look up by ID. And calling something that I thought had been removed in a previous release? If I revert back to the previous, then I don't get the error. And yes, I could just delete the profile from my list, but that's just a workaround

@exwm
Copy link
Contributor Author

exwm commented Sep 30, 2024

@MonkeyKingViper I think that's because this PR is against the upcoming v4.14 release and branch. This branch (https://github.com/instaloader/instaloader/tree/upcoming/v4.14) is based on v4.13 and has not incorporated v4.13.1 which removed rhx_gis.

You could rebase onto 4.13.1 or master until this is sorted out by the maintainers.

@MonkeyKingViper
Copy link

@MonkeyKingViper I think that's because this PR is against the upcoming v4.14 release and branch. This branch (https://github.com/instaloader/instaloader/tree/upcoming/v4.14) is based on v4.13 and has not incorporated v4.13.1 which removed rhx_gis.

You could rebase onto 4.13.1 or master until this is sorted out by the maintainers.

Ah, interesting. I didn't realize that but it makes total sense. Thank you.

@aandergr aandergr merged commit b0c42a2 into instaloader:upcoming/v4.14 Oct 2, 2024
@aandergr
Copy link
Member

aandergr commented Oct 2, 2024

Thanks a lot! We merged it and created a pre-release v4.14rc1 with it included.

@a3nk17
Copy link

a3nk17 commented Oct 29, 2024

showing error like this instaloader: error: unrecognized arguments: --reels

image

PedroAzuos pushed a commit to PedroAzuos/instaloader that referenced this pull request Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for the downloading of reels

7 participants