Open DylanVanAssche opened 8 years ago
from eyeballing it I think you want: session.post(TINDER_IMAGE_HOST + '/image?client_photo_id=ProfilePhoto' + str(int(time.time())), data={'userid': INSERT_USERID_HERE}, files={'file': open('test.jpeg', 'rb')})
also you want str(int(time.time() * 1000))
to match the JS version.
Still a HTTP 500 error :( Adding image upload would be very nice :+1:
I was able to add FB picture support with requests but I don't understand the hierarchy behind Pynder how this request is written:
ydistance_percent = 0
xdistance_percent = 0
yoffset_percent = 0
xoffset_percent = 0
data = json.dumps({"transmit": "fb", "assets": [{"ydistance_percent": ydistance_percent,"id": fb_picture_id,"xoffset_percent": xoffset_percent,"yoffset_percent": yoffset_percent,"xdistance_percent": xdistance_percent}]})
pictures = session.post(constants.TINDER_HOST + '/media', data=data)
the variable 'pictures' contains a list of all the images (including the new ones) in the account. However, uploading to Tinder directly still doesn't work.
I'm trying to add picture upload to Pynder by using this API from our friends here:
https://github.com/tinderjs/tinderjs/blob/master/tinder.js#L451
I wrote this:
However I get a HTTP 500 error while it works perfectly in NodeJS... They add this:
'.field('userId', _this.userId)'
to their request but I can't find out how I can add this to my request with Python. Anyone an idea?Dylan Van Assche