Giter Site home page Giter Site logo

Comments (6)

instaprime avatar instaprime commented on May 27, 2024 3

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.

uw935 avatar uw935 commented on May 27, 2024

Hi @alirezaevil81

Could you provide your code that returns this error?

from instagrapi.

caiopedroso avatar caiopedroso commented on May 27, 2024

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.

Maherstad avatar Maherstad commented on May 27, 2024

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.

ospr420 avatar ospr420 commented on May 27, 2024

same problem here, this used to work now this error occurs

from instagrapi.

claell avatar claell commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.