Git Product home page Git Product logo

Comments (6)

landalex avatar landalex commented on August 19, 2024

I've just added some error handling in case the message doesn't have a timestamp for any reason. Grab the latest version of the script and give it a try :)

from facebook-message-converter.

maciejopalinski avatar maciejopalinski commented on August 19, 2024

When I run script that error occured:

Traceback (most recent call last):
  File ".\facebook-message-converter.py", line 29, in <module>
    message_datetime = datetime.fromtimestamp(int(message['timestamp']))
KeyError: 'timestamp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".\facebook-message-converter.py", line 52, in <module>
    print(e, file=sys.stderr)
NameError: name 'sys' is not defined

I think that this script is dedicated to older format of facebook messages. Please, look at actual format and fix it bruh ;)

from facebook-message-converter.

landalex avatar landalex commented on August 19, 2024

Can you provide a sample of what the new message format is?

from facebook-message-converter.

maciejopalinski avatar maciejopalinski commented on August 19, 2024

test.zip
This is a file with example conversation in json. I don't know how the video or voice message is saved but you can just download your data from facebook and try it yourself

from facebook-message-converter.

landalex avatar landalex commented on August 19, 2024

Thanks! I've pushed a change that tries to read timestamp_ms if it exists and parse that instead of relying on timestamp.

from facebook-message-converter.

maciejopalinski avatar maciejopalinski commented on August 19, 2024

Thanks a lot! Your script works perfectly now

from facebook-message-converter.

Related Issues (1)

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.