Comments (6)
Make sure to do a pip install instagrapi --upgrade
Then in extractors.py change this in line 335 :
data['timestamp'] = datetime.datetime.fromtimestamp(data['timestamp'] // 1_000_000)
to this :
data['timestamp'] = datetime.datetime.fromtimestamp(int(data['timestamp']) // 1_000_000)
Also the next line seems to have a typo so change this
data['user_id'] = str(data['user_id'])
which returns a keyerror 'user_id'
change to this :
data['user_id'] = str(data['id'])
Happy coding and good luck.
from instagrapi.
Could you provide your code that returns this error?
from instagrapi.
Hello, I'm encountering the same error. The code is quite straightforward:
from instagrapi import Client
cl = Client()
cl.login("USER", "PWD")
cl.direct_send('How are you?', user_ids=[cl.user_id])
Error:
332 if xma_media_share:
333 data["xma_share"] = extract_media_v1_xma(xma_media_share[0])
--> 335 data['timestamp'] = datetime.datetime.fromtimestamp(data['timestamp'] // 1_000_000)
336 data['user_id'] = str(data['user_id'])
338 return DirectMessage(**data)
TypeError: unsupported operand type(s) for //: 'str' and 'int'
from instagrapi.
refering to line 313 in extractor.py , function extract_reply_mesage :
wouldn't the following modification solve the problem ? int(data["timestamp"])
instead of data["timestamp"]
from instagrapi.
same problem here, this used to work now this error occurs
from instagrapi.
@instaprime, if you already have a working solution, would you mind creating a PR for this? Then, it can get integrated in the code base, properly.
from instagrapi.
Related Issues (20)
- Public method for user_info_by_username_gql throws a simplejson.errors.JSONDecodeError[BUG] HOT 2
- Direct Message (dm) HOT 1
- How to Check if a Media Item Has Already Been Liked in instagrapi? HOT 1
- search_music [BUG] HOT 1
- Pin comment [BUG]
- [BUG] login error: invalid_parameters
- [BUG] Two factor authentication not working anymore, "Invalid parameters"
- Question. How to not get blocked.
- Scheduled posts for creator (professional) accounts
- [feature request] Batch Password Modification Function
- UKNOWN response: challenge_resolve, challenge_resolve_simple, handle_challenge_result
- When Sign Up feature will be added ?
- List of current_follow_requests
- Unsend_Message Feature
- Media likers using GraphQL
- Question: user_medias() able to get range?? Are there any methods to getting ranges of media?
- [BUG] not uploaded reels in cron
- Only use the api to upload video to instagram? HOT 1
- login not working[BUG]
- [BUG] Empty response message when using `signup`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instagrapi.