Code Monkey home page Code Monkey logo

php-snapchat's People

Contributors

bullshit avatar dstelljes avatar geczy avatar hako avatar hisham-albeik avatar jesperlindstrom avatar jorgenphi avatar kartiktalwar avatar linosuarez avatar mayankmahajan24 avatar sgneitzke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-snapchat's Issues

Download video with overlay

When I try to download a snap that contains a video and a drawing/text, only the drawing/text layer is downloaded as a video... how can I download both with one request?

Cron login fail

The script works fine but when i let the cron run overnight it ends op saying:
"get auth_token failed"
I think this is caused because it keeps relogin every time instead of saving the auth_token to a file for reuse.

Stories Decryption

I'm having issues with the stories decryption (snaps are still okay), have Snapchat's encryption methods changed or are other people experience the same issue? Any ideas as to what they're doing now?

Download my own snaps

Hi,

How can I download the photos and the videos that is taken by my self? I don't want to download my friends snaps, I just want to download the pictures and the videos that I take.

Best regards
Bryan

Error checking for Snapchat::$cache in getUpdates and getFriendStories

Snapchat::$cache can be null or not defined in getUpdates and getFriendStories, when login fails or after a logout.

Code to reproduce:

$snap = new Snapchat('gjdrglkmdr', 'gdkrweokew'); // invalid username and password combination
$snap->getUpdates();

outputs

PHP Notice:  Undefined property: Snapchat::$cache in C:\Users\Gabriel\Documents\
GitHub\php-snapchat\src\snapchat.php on line 234

Notice: Undefined property: Snapchat::$cache in C:\Users\Gabriel\Documents\GitHu
b\php-snapchat\src\snapchat.php on line 234
PHP Fatal error:  Call to a member function get() on a non-object in C:\Users\Ga
briel\Documents\GitHub\php-snapchat\snapchat.php on line 234

Fatal error: Call to a member function get() on a non-object in C:\Users\Gabriel
\Documents\GitHub\php-snapchat\src\snapchat.php on line 234

Media_type = 3??? what does that stand for

Hey :)
i have made a small local snapchat site where I can see my snaps on my computer.
And I know that media_type 0 is pictures and 1 is video.
but what does Media_type 3 stand for?

Logging in

Hi,

I've been working with this api and it's great, but for some reason I just can't login on my account anymore. The login code wasn't changed, it just didn't work anymore.

Is it possible that you arn't allowed on 2 computers to be logged in on the same time?

because that could be the problem.

when I do a login I get an 500 error

What does getSnaps() return

I found that it returns a array but it seams to be empty even though i already send a snap to the account present

Is this script still working?

I've been trying this script but am having trouble with the Login. I am passing my username and password (I verified they are working on the device) but the login keeps failing.

This is my PHP test page :

getSnaps(); echo "2" ; ?>

Any help would be appreciated. Thanks.

I fixed the upload-sending snap issue

Hello,
I changed this line:

$media_id = strtoupper($this->username) . '~' . time();

to this:

$media_id = strtoupper($this->username) . '~' . strtoupper(gen_uuid());

in snapchat.php

And the snap sending is working.
You can find the gen_uuid function here.

Token saved in session: check token and reconnect only if necessary (invalid token).

Hello,

I save the object "$snapchat" in session with this method: http://www.php.net/manual/en/oop4.serialization.php
This avoids having to redo a connection (with a new token) on Snapchat servers at each change of page.

But if I connect to Snapchat with mobile application, it makes a new connection and changes the token. So, the old token saved in PHP session (on my website) is no longer valid.

My question is the following: How to check if the token is still valid? If it is still valid, use it normally. But, if it is no longer valid, make a new connection (reconnect with the login() function).

Thank you in advance.

Best regards,
Yoann

video upload limitations

Does anyone know the limitations or prerequisites for the video upload for story board?

is there a resolution / codec / file size limitations?

New Registration with Captcha

With the current LIB Version using SnapChat 6.0.2 with iPhone user agent, it returns a response saying we need to upgrade to the new snapchat version.

Registration version

Hi, i have one problem.

When i want to register me, this error as returned :
public 'message' => string 'Please upgrade Snapchat to the latest version to create an account.' (length=67)

I have set const version to 7.0.4 and curl user adgent to 7.0.4 too, please help me...

Fatal error when getting snaps

Hi,

When i run the following code on my machine, I get an fatal error. It worked fine until two days ago.

$snapchat = new Snapchat( SNAP_USER, SNAP_PASS );
$snaps = $snapchat->getSnaps();

Fatal error: Call to a member function get() on a non-object in /www-root/lib/snapchat.php on line 234

Any help would be appreciated!

Upload and send image is always failed

Hi,

Thank for your project, it's useful for me and thank again.
I am using upload and send image from your project but the result is always failed. I don't know reason why ? Can you double check services ?

Stories media_type

Hi,
I have see recently stories have a problem, after a look, stories meda_type return :
In first, an int (0, 1 or 2), if i refresh, media_type is picture or video, and if i frefresh again, media_type is null.

What is the problem?

Issues uploading photos

Hello, it was working just perfect all the time, but yesterday after snapchat updates(I got some on my phones too) it stopped uploading photos. I not changed anything on my code so I think they changed something inside and now this feature not working...
Can you check and update this? Thank you!

media_id from snaps, can't find it.

Hello :)
I want to download snap to my computer but I can't find the media id :)
I have done a var_dump to see the array:
$snaps = $snapchat->getSnaps();
var_dump($snaps);

and the array look like this:
0 =>
object(stdClass)[83]
public 'id' => string '255300413927923884r' (length=19)
public 'media_id' => boolean false
public 'media_type' => int 0
.......
but I can't se the media_id? some idea? :)

Research:

Hey everybody! I was making great progress analyzing the new API, but my IP address was recently blocked so I figured now would be a good time to fill you all in.

(This was taken from version 5.0.2 on android && is likely missing endpoints. Snapchat refused my SSL certificate for about 25% of the connections.)

/loq is the new major endpoint. It contains:
/login - (nearly identical to /bq/login)
/all_updates
/conversation
/conversations
/conversation_post_messages
/send - (nearly identical to /ph/send)

/bq contains these new endpoints:
/chat_typing
/upload_chat_media

Now, the "chat media" has a different encryption algorithm than snaps, and I have not found a way to decrypt them. Any help on this would be useful.

Use this issue to document any findings in the new API so we can build an updated library. :)

Thanks.

Keeping user logged in throughout multiple pages?

This isn't really an issue with the API, but how would one go about keeping the use logged in throughout multiple pages? It creates an object when you login which is needed to fetch snaps, but if I pass that on using a session variable it messes the object up.

And I can't convert it to a array as the other functions like getSnaps() need it in object form! There are also sub-objects which mess up.

Anyone got any example code they would use to pass the object on or keep the user logged in? I want to use some Ajax to fetch recent snaps ect...

Detecting if users has logged into Snapchat app

I have noticed that if you log into the Snapchat app, then try and use the username and auth_token with this API you can no longer get any snapchats as the app just made a new auth_token.

What would be the best way to detect that this has happened?
If I do a check to see if any Snaps have been retrieved to see if the API auth_token is still valid I could get false results as there simply could be no new snaps.

Only way I can think of doing it is to see if the "cache" object in the Snapchat object has any contents as I noticed that it is empty if you login the app without logging back into the API.

Ideas?

Chat messages traffic encrypted.

Having looked into the app, it looks like Snapchat's new chat feature is encrypted (or at least the traffic) to an extent that HTTP Debugging tools Fiddler and Charles cannot capture requests, even with SSL debugging on.

I'm guessing that the chat system is using TCP instead of HTTP to transfer messages.

I've tried Wireshark and TCPDump but no luck.

I can:
Get the chat messages

I cannot:
Post a message.

Sending up to more than 30 recipients

I just tried in my SnapChat Android App to send a snap to all my 150+ contacts and it was only able to send up to 30 contacts. I tried twice and same result. It's odd snapchat doesn't even block the ability to send up to more than 30 contacts.

Update.. it sends to all. just don't add 30+ sent snaps in feeds.

Is there a way yet to send text messages/snaps to a user?

I was wondering if there's a way to send texts / messages / chat to a user.
What I want to do is build two forms and a button.
One for username of recipient and one for the message, and a "send" button.

Thanks in advance! Uploading stories is going great so far!

New app has defensive measures.

Hey everybody. I figured now would be a good time to start looking back at the new snapchat protocol and quickly learned that snapchat [REDACTED]. This makes it much more difficult to proxy the ssl requests. I also tried to change all instances of https:// with http:// using apktool, but the app launches the splash screen, but then crashes. Makes me wonder if the app's signature[REDACTED] or if I am just using apktool incorrectly. Has anyone been able to proxy the new snapchat app?

Story Decryption

I've noticed today that some stories aren't being decrypted properly, or something...

When a story blob has been fetched successfully and then been decrypted, it outputs data that looks "still encrypted", and that data doesn't seem to resemble any file type at all. Not a jpg, mp4 or gif/png etc.

Has anyone else noticed this lately? or...

Send a text message

Is it possible for the api to be updated to include sending a text based message on snapchat? - i.e. the text messages that are possible with the new version of the app

How to get media Id for download a picture or video ?

Hello, how to get the media id to retrieve a video or picture?
The documentation is not very clear about this, in the example ('122FAST2FURIOUS334r), the media id used comes from where?

// Download a specific snap:
$data = $snapchat->getMedia('122FAST2FURIOUS334r');
file_put_contents('/home/jorgen/snap.jpg', $data);

I get my good flow yet is there some media id empty :/

Thank you for your help

friends array only the names

Hi there,

when I do an output with print_r of the $friends array, I receive details of name, can_see_custom_stories and type.

How can I make the output with only the name?

Specific story's thumbnail

Dear,

The code for specific story's thumbnail ......
$data = $snapchat->getStoryThumb('[story_media_id]', '[story_key]', '[thumbnail_iv]');
For a common story, [story_key] is absent. I have used here media_key instead of story_key. Is this right?
But still I am not getting any results for thumbnail. It returns like this
87Á���äÿa)ß�kä„ÙEËe»eØm"Œ%JÁþó§|gÅëðâaÛdתv�„_Ó{�óPN»i� =‡ýä³X¯PŽ*ä23¾�Sr�æ��S¨}ŒI&;Å�ÈÆ\òkf¸ñ�U¬

What should I do now?

All requests returns false. Anybody else?

It's just 10 minutes ago this happened. never changed anything in my host.

Anybody else the same? I can connect using my localhost. I hope it's not my host they blocked. :( any suggestions please? or is somebody here hosting this lib that I can use please?

SnapChat API "register"

Hello i am trying to add a new snapchat user through the API

I have made my self a form with:

  • Username
  • Password
  • Birthdate
  • Email

I'm sending the form and requesting the next code
$SC = new Snapchat;
getHtml::getTagP($SC->register($_POST['gebruiker'], $_POST['wachtwoord'], $_POST['email'], $_POST['geboortedatum']));

I have puted random in that function an echo with text and found out that it stops at the next line of code (rule 190)
if (!isset($result->token))
{
return FALSE;
}

Now is my next question...

  • what do i need to configure in this script? (to let it work with the domain of my customer)
  • How can u really add a new user?

Sorry for my questions, but i couldn't find much information regarding this

Kind regards,
Martin Meijer

not able to download imagw

I was trying to download image using getMedia function but it always return false to me even though I pass correct media ID using getSnaps. When I call getSnaps then it returns me something like following.

object(stdClass)#31 (11) {
["id"]=>
string(19) "275650406800983071s"
["media_id"]=>
string(59) "HIGAURAVBHAI~893749F7-3E18-46B5-9B13-7B660DEEB458TEJMEHTA86"
["media_type"]=>
int(0)
["time"]=>
bool(false)
["sender"]=>
string(12) "xxxxxxxxxx"
["recipient"]=>
string(10) "tejmehta86"
["status"]=>
int(2)
["screenshot_count"]=>
int(0)
["sent"]=>
float(1406800983071)
["opened"]=>
float(1406801280703)
["broadcast"]=>
bool(false)
}

Then I pass "id" to function getMedia to get image. But this function always returns me false. Please let me know, what am I doing wrong. Following is my sequence.

while (1)
{
$snaps = $snapchat->getSnaps();
if ( $snaps != false)
{
var_dump($snaps[0]);
echo "Snap ID = ".$snaps[0]->id."\n";
$data = $snapchat->getMedia($snaps[0]->id);
var_dump($data);
file_put_contents('snap.jpg', $data);
break;
}
}
sleep(1);
}

Caption with media

Hello,
I actually use this API for SnapChat. It works perfectly, so thank to the creator and contributor but how we do for add a text with a media (video or image) ?

It will can be very useful to have a caption !

So, if someone can help me, thank a lot !

Some questions

Hello !
First of all, sorry for bad language, i'm french.

I have make a site with your API, It works perfectly.
But i have some questions.

If i would put my website online, can I have problems with Snapchat?
And the API is safe? Will work always? Because i don't want to remake my website...

And if you want i can post some files i have made for use this API.

Good bye,
Jean.

Does this comply with SnapChat Terms and Conditions

Hi, first off, amazing work reverse engineering this. I was looking at utilising this library for a project, then looked at the Snap Chat Terms of use and got confused, Has anyone used this library for large send outs of snaps? Or is this just an exercise in reverse engineering APIs?
I'm just concerned if I do use this commercially the account could be blacklisted. That would suck..

Can't upload / send snap

The upload and send of snaps failed: i receive nothing :/ Can you help me please? (Sorry for my english)

A notice and fatal error when fetching feed

I have successfully imported the snapchat.php file using require_once, seems to logged in successfully as it's returning an object.

But when I try and fetch my feed i'm getting the following errors:
Notice: Undefined property: Snapchat::$cache in C:\xampp\htdocs\snapchat\src\snapchat.php on line 234

Fatal error: Call to a member function get() on a non-object in C:\xampp\htdocs\snapchat\src\snapchat.php on line 234

New API

Any plans on making the library use the "new" API endpoints and formats? Using the old ones increases the speed of getting your server blocked by Snapchat, something I endure continiously.
I have tried it myself but have yet to find a good way to use their new format they send in responses.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.