agermanidis / SnapchatBot

[deprecated] Python library for building bots that live on Snapchat
MIT License
518 stars 105 forks source link

I want to work on a libary that works with the newest version of snapchat. #6

Open Snowlav opened 9 years ago

Snowlav commented 9 years ago

I notice this repo is still using really old endpoints such as /bq/login.

I want to create a new libary to use with the newest version of snapchat, currently 9.2.1.0. This includes all the new endpoints and a way to avoid detection.

I have both the newest endpoints and the means needed to avoid detection.

Would you like to work with me on this? Please leave a message below with your skype ID.

krissrex commented 9 years ago

I would like this. My account got locked rather quickly. (I'm not a dev here, but rather a user.) Could you just fork it and fix what you can, Snowlav? Or make a pull request.

Edit: Changing timeout from 5 to 90 (randomly selected) stopped my bot from getting blocked.

agermanidis commented 9 years ago

Is there a disclosure online on the new API like Gibsec's on the old one?

Snowlav commented 9 years ago

I am afraid not, we must make one ourselves

2015-02-22 5:51 GMT+01:00 Anastasis Germanidis notifications@github.com:

Is there a disclosure online on the new API like Gibsec's http://gibsonsec.org/snapchat/fulldisclosure/ on the old one?

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-75419682 .

Rob-- commented 9 years ago

I think there's a lot of people that would appreciate a new library. If you do host a page with documentation such as Gibsec, could you also post simple explanations on how Snapchat communicates with the API? I understand it's through POST requests and then parsing the reply, but is the actual snap data stored in the reply?

agermanidis commented 9 years ago

Using the new API is definitely worthwhile (my IP has been blocked a bunch of times too) but I'm not sure I have the time to work on it in the immediate future.

It'd be awesome if you decide to work on it @Snowlav -- you can either fork this library or make a lower-level API client library that SnapchatBot could use instead of pysnap.

Cheers, -A

Rob-- commented 9 years ago

I've just been doing some research and I believe it's possible to manipulate the chat on Snapchat with loq.

N07070 commented 9 years ago

+1

evanjhopkins commented 9 years ago

Maybe route the connections through Tor to avoid IP's getting blocked? I'll probably make a PR with that now that I think about it.

Snowlav commented 9 years ago

Evan it's not needed now that I have found a way to avoid detection :)

2015-02-23 17:34 GMT+01:00 Evan Hopkins notifications@github.com:

Maybe route the connections through Tor to avoid IP's getting blocked? I'll probably make a PR with that now that I think about it.

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-75577770 .

N07070 commented 9 years ago

@Snowlav you're working on something ? :)

Snowlav commented 9 years ago

Yes and no. I want to build a new library but my coding skills aren't great. What I can do however is reverse engineer and that besides a lot of networking is how I found out some exploits and how to avoid detection.

I got in touch with some clever minds. And if any of you want to contribute to building a library along with me and those people, again, feel free to leave your skype and I will contact you :) On Feb 24, 2015 12:27 AM, "N07070" notifications@github.com wrote:

@Snowlav https://github.com/Snowlav you're working on something ? :)

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-75660935 .

agermanidis commented 9 years ago

Even if you could even make a document with the new endpoints, that would be super helpful too!

Snowlav commented 9 years ago

/loq/gae_server_list /loq/ping /loq/all_updates /loq/conversation /loq/conversations /loq/double_post /loq/send /loq/retry /loq/login /loq/register_username /loq/friend_search /loq/clear_conversation /loq/clear_feed /loq/conversation_post_messages /loq/conversation_auth_token /loq/local_story /loq/friend_hide /loq/update_user /bq/delete_story /bq/friend /bq/get_captcha /bq/bests /bq/story_blob /bq/post_story /bq/retry_post_story /bq/set_num_best_friends /bq/upload_chat_media /bq/solve_captcha /bq/update_feature_settings /bq/update_stories /bq/chat_typing /bq/update_snaps /bq/user_exists /bq/phone_verify /bq/story_thumbnail /bq/chat_media /ph/device /ph/find_friends /ph/blob /ph/settings /ph/upload /ph/logout

these are most new ones

2015-02-24 1:29 GMT+01:00 Anastasis Germanidis notifications@github.com:

Even if you could even make a document with the new endpoints, that would be super helpful too!

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-75672232 .

evanjhopkins commented 9 years ago

I'm down to work on it. Skype: ehopki

N07070 commented 9 years ago

Do you have Telegram ?

Rob-- commented 9 years ago

To anyone interested, I don't think Snapchat sends chat messages through the API as you would've expected; the endpoint when interacting with the chat is "chat_typing". It looks something like this:

{
    "timestamp" : timestamp,
    "recipient_usernames" : [users], 
    "username" : "username",
    "req_token": token,
    "features_map" : data
}

There's no parameter for message content and thus renders chat communication impossible (from what I've seen).

N07070 commented 9 years ago

What does datacontain ?

Snowlav commented 9 years ago

@robert bq_typing is doing exactly what it says, it only indicates that you are typing, it's not holding mac / payload.

2015-02-26 0:34 GMT+01:00 N07070 notifications@github.com:

What does datacontain ?

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-76085364 .

Rob-- commented 9 years ago

Yeah I understand that, I'm just saying that chat_typing is the only endpoint I've seen so far when interacting with the chat. It's used to give a heads up notification that someone is typing (to the recipient) - when sending messages there is no interaction with the API.

Snowlav commented 9 years ago

Then you missed another endpoint completely :) /loq/conversation_post_messages is called twice after /bq/chat_typing and is triggered by the button, to post a message. (if you are talking about the latest version though, this might be different, I haven't checked the latest version yet)

But the endpoint /loq/conversation_post_messages should be working with this repo, and an updated user-agent.

2015-02-26 18:01 GMT+01:00 Robert notifications@github.com:

Yeah I understand that, I'm just saying that chat_typing is the only endpoint I've seen so far when interacting with the chat. It's used to give a heads up notification that someone is typing (to the recipient) - when sending messages there is no interaction with the API.

— Reply to this email directly or view it on GitHub https://github.com/agermanidis/SnapchatBot/issues/6#issuecomment-76217951 .

Rob-- commented 9 years ago

Ahhh, I believe I am using the latest version. I haven't seen conversation_post_messages at all and I've thoroughly tested it.

I do also agree that this library needs a bit of updating (implementation of /loq/ and it shouldn't require pysnap, it should directly implement it (with the appropriate credits).

agermanidis commented 9 years ago

I could see them moving to XMPP or a similar protocol (either over raw TCP or over WebSockets) for chat as it's more efficient than the constant polling of an HTTP endpoint.

ObjectiveTruth commented 9 years ago

@krissrex, I'm just starting to implement this library, can you explain a bit what you mean by setting the timeout from 5-90 randomly? Is it per request? or overall, adding a delay?

Sh1eld commented 9 years ago

@ObjectiveTruth I may be wrong however how I interpreted his edit is that he changed the default timeout to 90 for his bot, instead of 5, which allowed his bot to not get blocked.

I am interested in contributing to more API research and also the development of the updated library.

ObjectiveTruth commented 9 years ago

@Sh1eld, I just noticed its a constant and someone seems to have made the edit already by setting it by default to 15. Thanks for the quick reply!

Sh1eld commented 9 years ago

@ObjectiveTruth You can either change the default for yourself or you can do bot.listen(timeout=90) (I think) as shown in the reflectorbot example.

N07070 commented 9 years ago

Big up to you guys !

Rob-- commented 9 years ago

The timeout just delays how often the bot runs a check (get snaps and monitor friend activity).

If you guys are interested in working on a library leave your Reddit or Skype usernames.

ObjectiveTruth commented 9 years ago

I'm not a python expert, but looking over the code, looks like there needs to be more entropy to the calls.

The instant fire back is a pretty dead give away of a bot, same with the sleep(timeout) regularity is pretty suspicious too.

My 2 cents..

N07070 commented 9 years ago

@Rob-- @ObjectiveTruth We should add a more natural way of getting snaps. Maybe even try to simulate the function of the apps. I think more lag would be me stealth.

Rob-- commented 9 years ago

The new Snapchat implements a couple of new API endpoints that need to be called, this library doesn't implement them. If these new endpoints aren't called then Snapchat probably gets suspicious.

jczimm commented 9 years ago

+1 for new API end points support

Rob-- commented 9 years ago

I've pretty much finished implementation of the the loq endpoints - I'll look into the newer ones. I've also added the ability to register an account.

The library isn't entirely finished but it should do the job, https://github.com/Rob--/SnapWrap

N07070 commented 9 years ago

Would you fuse it with the snapchatBot lib ?

sallaben commented 9 years ago

check out mgp25's Snap-Api on here

sallaben commented 9 years ago

also, https://github.com/JorgenPhi/php-snapchat/wiki/API-v2-Research