Comments (17)
@Bravo111 try this instead of the offending line.. should work.
return json.loads(r._content[9:].decode('utf-8'))['payload']['metadata'][0]
from fbchat.
@thekindlyone always catch "TypeError: the JSON object must be str, not 'bytes'" exception. Even when use your example (and image url)
from fbchat.
@Bravo111 which example? which python are you using? Show test code please.
from fbchat.
I run this code with python3.5:
imgurl = "http://i.imgur.com/LDQ2ITV.jpg"
client.sendRemoteImage(friend.uid, image=imgurl)
and get an error.
I guess there is a problem in this line return json.loads(r._content[9:])['payload']['metadata'][0]['image_id']
.
from fbchat.
@Bravo111 this is the reception of images thread. You are talking about sending images.
But this is not happening in 2.7. Let me check.
from fbchat.
There are too many pulls right now, and a little bit of a mess due to my inexperience with git. I am pausing sending any more PRs unless the ones already sent are merged. Clone the project and try what I said. Lemme know if it works.
from fbchat.
@thekindlyone, yes, it works great. Don't forget ['image_id']
in the end of this line!
Is it possible to receive images with Echobot now?
from fbchat.
Yes, image receiving works, but I havent tested it with python3. Please test and tell.
from fbchat.
@thekindlyone, unfortunately it receives empty message with 'has_attachment': False
.
from fbchat.
@Bravo111 , receiving , right? Check the metadata.. the urls for the images are in there.
from fbchat.
@thekindlyone, is image_ids[0]
what I need? Because there are nothing else in output but timestamps and ids.
from fbchat.
@Bravo111 , no , in the on_message method, that you overrode, you get a metadata argument. The url is in there.
from fbchat.
Think we have different output
from fbchat.
@Bravo111 are you sending or receiving? this output looks like you have debug=True and are sending. Show test code.
from fbchat.
from fbchat.
@Bravo111 do you see the metadata
argument in the on_message
method? That is where the url is. Instead of printing message
, print metadata
. The output you showed me is generated while sending the echo. Turn debug=False
if the output is confusing you.
from fbchat.
@thekindlyone, yes, now all works perfect. Thanks for tips.
from fbchat.
Related Issues (20)
- File loading progress
- Can't listen() Error #1357005 HOT 3
- Login not work
- FBchatException solution HOT 1
- Could not find fb_dtsg
- Could not find any ServerJSDefine. Please report this, along with the data below HOT 1
- Note for others unable to login HOT 4
- Failed parsing MQTT data on /t_trace as JSON HOT 3
- Sending AudioAttachments doesn't work HOT 4
- Trouble Logging in Error and info included
- Can't Log in HOT 7
- Search contact by mobile phone number
- Module not found Error!
- Error when sending request: Got 500 response.
- Closed
- Screenshot (Mar 25, 2023 6:10:08 AM)
- how can it get all feeds and comments
- GraphQL error #3252001: Rate limit exceeded / None HOT 3
- Sendlocalfile isn't working
- Is fbchat dead? HOT 2
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 fbchat.