Rob-- / SnapWrap

Wrapper for the unofficial and undocumented Snapchat API (using Snapchat's latest endpoints).
MIT License
57 stars 7 forks source link

Error 500 - Snap send #5

Closed ricoxor closed 9 years ago

ricoxor commented 9 years ago

My Code :

def on_friend_delete(self, friend):
        self.delete_friend(friend)
        self.send_snap(self.from_file("jo_270027425924003898r.jpg"), friend)

Error :

[03/10/15 11:41:13] user1 has deleted me.
[03/10/15 11:41:14] Status: uploading, id: 718ba8ca81dc4b69b44726bf4b48ac0a.
[03/10/15 11:41:16] Status: sending snap to 718ba8ca81dc4b69b44726bf4b48ac0a, id: user1.

Traceback (most recent call last):
  File "C:\Users\root\Desktop\FeedMySnap\FMS-SEXY.py", line 21, in <module>
    bot.begin()
  File "C:\Users\root\Desktop\FeedMySnap\SnapWrap\snapchat.py", line 60, in begin
    self.on_friend_delete(friend)
  File "C:\Users\root\Desktop\FeedMySnap\FMS-SEXY.py", line 16, in on_friend_delete
    self.send_snap(self.from_file("user1_270027425924003898r.jpg"), friend)
  File "C:\Users\root\Desktop\FeedMySnap\SnapWrap\snapchat.py", line 85, in send_snap
    self.client.send(snap.media_id, recipients, snap.duration)
  File "C:\Users\root\Desktop\FeedMySnap\SnapWrap\Client\__init__.py", line 431, in send
    'recipients': recipients,
  File "C:\Users\root\Desktop\FeedMySnap\SnapWrap\Client\__init__.py", line 64, in _request
    return request(endpoint, self.auth_token, data, files,  raise_for_status, req_type)
  File "C:\Users\root\Desktop\FeedMySnap\SnapWrap\Client\utils.py", line 85, in request
    r.raise_for_status()
  File "C:\Python27\lib\site-packages\requests-2.5.3-py2.7.egg\requests\models.py", line 831, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 500 Server Error: Internal Server Error
Rob-- commented 9 years ago

Haha, this error is hilarious. The id of the snap and the recipients have switched. I'll look into it when I'm home.

Rob-- commented 9 years ago

Fixed in commit 7b4bbfc.