Comments (6)
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.
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.
Can you provide a sample of what the new message format is?
from facebook-message-converter.
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.
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.
Thanks a lot! Your script works perfectly now
from facebook-message-converter.
Related Issues (1)
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 facebook-message-converter.