mgp25 / sc-api Goto Github PK
View Code? Open in Web Editor NEWSnapchat’s private API
License: MIT License
Snapchat’s private API
License: MIT License
I was thinking about creating a private Gitter or Slack chat for this repo.
A similar group chat that was started at JorgenPhi/php-snapchat#89 using Skype but I have no idea what's going on there.
Feel free to voice your opinions on this if you're interested.
Hello, when I use the getSnaps() function, I get that :
Notice: Trying to get property of non-object in /public_html/test/src/snapchat.php on line 927
Warning: Invalid argument supplied for foreach() in /public_html/test/src/snapchat.php on line 928
array(0) { }
My code is :
require_once("src/snapchat.php");
$username = "name";
$password = "pass";
$debug = false;
$snapchat = new Snapchat($username,$debug);
$snapchat->login($username,$password);
$snaps = $snapchat->getSnaps();
var_dump($snaps);
Thanks for helping me !
i am trying this :
$snapchat = new Snapchat($username, $auth_token, $debug);
$snapchat->login($username, $password);
$snapchat->addFriend('hamad251');
print_r($snapchat->getSnaps());
in terminal :
curl #LINK#
and i got :
HAMADs-MacBook-Pro:~ hamadalshahrani$ curl http://localhost:8888/ew/examples/exampleFunctional.php
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id
Sent Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Content-Length: 102
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1.42661722573E+12&req_token=9305ff58e4d1f2a86e22bbe6f4a0b2f416e54d8419d99a8909b46614d2c51d2b
RESULT: <html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>401 UNAUTHORIZED</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: UNAUTHORIZED</h1>
</body></html>
REQUEST TO: https://android.clients.google.com/c2dm/register3
Array
(
[X-GOOG.USER_AID] => 3538080729494335741
[app] => com.snapchat.android
[sender] => 191410808405
[cert] => 49f6badb81d89a9e38d65de76f09355071bd67e7
[device] => 3538080729494335741
[app_ver] => 545
[info] =>
)
DATA: 1
RESULT: token=APA91bHIZx1BPqZbdKuNzRqybGIkPKSuxVvKzIyYfznoM3OdbCIO2emEY0W2or2RhdzQVFZCId7Cc5BTX4pVFcHwtH-qq1cmhTDXoCTRhVdv-O9W1-qJJU7q5pkKVjGAV77zMfRSrlK-by1CtWbStEh6i49h8qSO3g
REQUEST TO: https://android.clients.google.com/auth
Array
(
[device_country] => nl
[operatorCountry] => nl
[lang] => en_US
[sdk_version] => 16
[google_play_services_version] => 6599036
[accountType] => HOSTED_OR_GOOGLE
[Email] => [email protected]
[service] => audience:server:client_id:694893979329-l59f3phl42et9clpoo296d8raqoljl6p.apps.googleusercontent.com
[source] => android
[androidId] => 378c184c6070c26c
[app] => com.snapchat.android
[client_sig] => 49f6badb81d89a9e38d65de76f09355071bd67e7
[callerPkg] => com.snapchat.android
[callerSig] => 49f6badb81d89a9e38d65de76f09355071bd67e7
[EncryptedPasswd] => oauth2rt_1/6YQ6444lgGwYt3zB5DbnCI6rqZq2wo6PszKF8RjGa74
)
DATA: 1
RESULT: issueAdvice=auto
Auth=eyJhbGciOiJSUzI1NiIsImtpZCI6IjRhZmM4MGZjMzRlMzMyMDE1ZmI5MjZlMDg2NjdhZWM0ZDZhMGI3NTgifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA2OTMwMzczMzM2MzY0NzAzMjQ0IiwiYXpwIjoiNjk0ODkzOTc5MzI5LXFnMGkwdTg4dDBobThrNmsxbWJyYm5zdWoxMDFoNzN2LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJ0ZXN0Njc4Njc4NjlAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF1ZCI6IjY5NDg5Mzk3OTMyOS1sNTlmM3BobDQyZXQ5Y2xwb28yOTZkOHJhcW9samw2cC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImlhdCI6MTQyNjYxNzA1MCwiZXhwIjoxNDI2NjIwODMwfQ.elXU8EfDBJawoaM8YnxEVtXoDGuaGSpKOh7bfrMvYqR-Hfnm6Qnv_DQDqfOd6LJikopbTSVnj36BeTk0678T_yI41LTWiQM0sT06emkgi7ezYukmJEqFi6XMQdNq49PbNL6-MAadxSvYx2PdBnvGI9Rozt2ZKMeE4n1SNZMZQTU
Expiry=1426620830
storeConsentRemotely=1
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/login
Sent Request info: POST /loq/login HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjRhZmM4MGZjMzRlMzMyMDE1ZmI5MjZlMDg2NjdhZWM0ZDZhMGI3NTgifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwic3ViIjoiMTA2OTMwMzczMzM2MzY0NzAzMjQ0IiwiYXpwIjoiNjk0ODkzOTc5MzI5LXFnMGkwdTg4dDBobThrNmsxbWJyYm5zdWoxMDFoNzN2LmFwcHMuZ29vZ2xldXNlcmNvbnRlbnQuY29tIiwiZW1haWwiOiJ0ZXN0Njc4Njc4NjlAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWUsImF1ZCI6IjY5NDg5Mzk3OTMyOS1sNTlmM3BobDQyZXQ5Y2xwb28yOTZkOHJhcW9samw2cC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsImlhdCI6MTQyNjYxNzA1MCwiZXhwIjoxNDI2NjIwODMwfQ.elXU8EfDBJawoaM8YnxEVtXoDGuaGSpKOh7bfrMvYqR-Hfnm6Qnv_DQDqfOd6LJikopbTSVnj36BeTk0678T_yI41LTWiQM0sT06emkgi7ezYukmJEqFi6XMQdNq49PbNL6-MAadxSvYx2PdBnvGI9Rozt2ZKMeE4n1SNZMZQTU
Content-Length: 404
Content-Type: application/x-www-form-urlencoded
DATA: username=tootev&password=toot556102002toot&height=1280&width=720&max_video_height=640&max_video_width=480&dsig=709bb772cd541db5344a&ptoken=APA91bHIZx1BPqZbdKuNzRqybGIkPKSuxVvKzIyYfznoM3OdbCIO2emEY0W2or2RhdzQVFZCId7Cc5BTX4pVFcHwtH-qq1cmhTDXoCTRhVdv-O9W1-qJJU7q5pkKVjGAV77zMfRSrlK-by1CtWbStEh6i49h8qSO3g×tamp=1.42661723003E+12&req_token=9302285b8141b4d86e2bb7e7fca129346fe24d8c1947aa8669b41a14dbc517db
RESULT: 1
how can i fix this please
Hi, I'm getting a 401 when posting to /loq/device_id. Normally this would indicate an IP address ban, but I wanted to get your thoughts on it:
I was using an older version of the API (my own code) a few hours ago, and it was setting stories using my auth-token that I've had for about 2 months. I tried logging into another account, but it seems that they now require you to update the app to create new sessions. I didn't feel like reversing the new auth method, so I stumbled upon your library (great work by the way). All of my requests were routed through a VPN which changes the IP address every time I connect to it. Snapchat returns a 401 using your library, but the same IP addresses were working a few hours ago using the old API. Either they have a separate banned IP list for clients connecting to the new API or it was simply a coincidence?
I've tried connecting with 10+ IP addresses, and they all don't work.
Does this have anything to do with the Google authentication that they added?
Thanks guys.
Debug output:
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id
Sent Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.3.1.0 (HTC One; Android 4.4.2#302626.7#19; gzip
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en
Accept-Locale: en_US
Content-Length: 98
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1428362053031&req_token=930706578f71cba86eae11ebfcafa27433e04d86195bba8429b49214dec51f8b
RESULT: <html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>401 UNAUTHORIZED</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: UNAUTHORIZED</h1>
</body></html>
I'm currently using an old commit from your repository before the dynamic password authentication was implemented.
Today I thought to update my scripts while using your newest commit but I'm only getting a Oh no! Your login temporarily failed, so please try again later. If your login continues to fail, please visit https://support.snapchat.com/a/failed-login :)
I tried to change line 199
on snapchat.php
from:
'EncryptedPasswd' => $password
to:
'EncryptedPasswd' => 'oauth2rt_1/evzrOtQ2qaGBrmz4VkJG-KMyIOsASmhluoocbXeDVhM'
and since I'm able to login and to get my results again.
My server seems to receive the values from https://tekno.pw/snapchat_password.php
since I did some debug outputs and received email and encryptedPassword
in the JSON file.
Is there anyone with some thoughts on that? And is it possible to provide the snapchat_password.php
script to host it locally without calling the external server?
Thanks to you all! :-)
Hello, I have just downloaded this and tried to get it working, I have debugging enabled, I get the following errors:
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id Sent
Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Content-Length: 102
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1.42771170908E+12&req_token=930b1f549f6196986eff8de7fea6c184b5eb4d8019e3ba84c9b43d14d3c5106b RESULT:
Error: UNAUTHORIZED
Notice: Undefined index: error in /Applications/MAMP/htdocs/yer/snapchat.php on line 333
REQUEST TO: https://android.clients.google.com/auth Array ( [device_country] => us [operatorCountry] => us [lang] => en_US [sdk_version] => 19 [google_play_services_version] => 7097038 [accountType] => HOSTED_OR_GOOGLE [system_partition] => 1 [has_permission] => 1 [add_account] => 1 [service] => ac2dm [source] => android [androidId] => 356663c3e9de45ef [get_accountid] => 1 [Email] => [app] => com.google.android.gms [client_sig] => 38918a453d07199354f8b19af05ec6562ced5788 [EncryptedPasswd] => )
DATA: 1
RESULT:`
This morning I'm getting this error at google auth step when loggin in:
Error=NeedsBrowser Url=https://www.google.com/accounts/ContinueSignIn?sarp=1&scc=1&continue=https%3A%2F%2Faccounts.google.com%2Fo%2Fandroid%2Fauth%3Fhl%3Den_US_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=AKgnsbvECfHQkXJl6WvcAFxYUwOXx6Xw6l55ZaFZ7deTvp_68ITZAnn_bwJc6BVkps_HNZnfcfY31tOev0ET-DzhA4E2iZsnTtMmIsq8c3P5dXBcyGx7wSzu2jVwNoBMFXAnzKKGSdXJ0IAyFWPUenyDcfUGt1DNzrris0nJR12zJ_B0_zCmHx2RaWjfIBN6HEC6wV0wGiSLjeR6gyHvuHLZxx38A554jaijwWNBF69kGGlPMoR3UC0 ErrorDetail=To access your account, you must sign in on the web. Touch Next to start browser sign-in.
--Boundary+0xAbCdEfGbOuNdArY--
RESULT: <html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>415 UNSUPPORTED_MEDIA_TYPE</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: UNSUPPORTED_MEDIA_TYPE</h1>
</body></html>
I fed it a jpg in the exampleFunction.php
but not sure if its being sent, it gives me this higher up in the log
PHP Warning: unlink(/home/objectivetruth/Snap-API/src/cache/image.jpg):
No such file or directory in /home/objectivetruth/Snap-API/src/snapchat.php on line 1188
Sorry if this is a simple issue, I'm not an expert in PHP and I can't find what the error is failing on
Warning: gzdecode(): data error in snapchat_agent.php on line 388
I can login fine, that all works, no unauthorized errors, and I know I'm not blocked. What's up though with getSnaps? Whenever I call it I don't see any outgoing requests displayed even if $debug=true
, and when I var_dump
the $snaps
variable (which is set to $snapchat->getSnaps()
), I just get bool(false)
.
what's up?
I made a comment on the commit but this might be better,
does getUnconfirmedFriends()
return those you haven't accepted yet?
If it is, maybe changing it to getNewFriendRequest might be better, semantically?
Unconfirmed makes me think they have been confirmed by Snapchat
Whenever i do something i get this error:
Notice: Undefined index: request_header in C:\xampp\htdocs\snap\api\snapchat_agent.php on line 386
And it pulls no valid information or any information at all.
EDIT:
created a new folder without changing any names uploading all the content from the zip as it is, still get the same error:
Notice: Undefined index: request_header in C:\xampp\htdocs\snapchat\src\snapchat_agent.php on line 386
Problems with getMedia
Sent Request info: GET /bq/blob?id=587233427638810729r×tamp=1427638816009&username=USERNAME&req_token=6661badb986447fd94785cd146fe55756f04a98907ce5ad73481bb5b95bb0484 HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
X-Timestamp: 1427638816009
DATA: id=587233427638810729r×tamp=1427638816009&username=USERNAME&req_token=6661badb986447fd94785cd146fe55756f04a98907ce5ad73481bb5b95bb0484
RESULT:
<br />
<b>Warning</b>: substr() expects parameter 1 to be string, array given in <b>/src/snapchat.php</b> on line <b>1118</b><br />
<br />
<b>Warning</b>: strlen() expects parameter 1 to be string, array given in <b>/src/snapchat_agent.php</b> on line <b>89</b><br />
<br />
REQUEST TO: https://feelinsonice-hrd.appspot.com/ph/clear
Sent Request info: POST /ph/clear HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Content-Length: 113
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1427638816301&username=USERNAME&req_token=666971d234541f5d94c105d549f4a3d5250ea98507759ada5481365b9bbb0234
RESULT:
REQUEST TO: https://feelinsonice-hrd.appspot.com/logout
Sent Request info: POST /logout HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Content-Length: 113
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1427638816722&username=USERNAME&req_token=6667cfdda5940a9d94fd03d843f3e725430fa9850701badd9481ea5b96bb0574
RESULT: <html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>404 NOT_FOUND</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: NOT_FOUND</h1>
</body></html>
At the beginning i want to thank you for this API and searching a friend with phone number is not working can you give us example and be sure that searching a friend with phone number is still working
It worked yesterday. But just now login returns error. Has something changed?
`REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id Sent Request info: POST /loq/device_id HTTP/1.1 User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip) Host: feelinsonice-hrd.appspot.com Accept: / Accept-Language: en;q=1 Accept-Locale: en Content-Length: 102 Content-Type: application/x-www-form-urlencoded DATA: timestamp=1.42754578431E+12&req_token=93014a575691fec86e6e9ee2f5abb7a43fec4d8119bd7a8139b4c214dbc51d6b RESULT:
Error: UNAUTHORIZED
RESULT:
Error: UNAUTHORIZED
REQUEST TO: https://android.clients.google.com/c2dm/register3 Array ( [device] => 3847872624728098287 [sender] => 191410808405 [app_ver] => 564 [gcm_ver] => 7097038 [app] => com.snapchat.android [iat] => 1427545785 [cert] => 49f6badb81d89a9e38d65de76f09355071bd67e7 ) DATA: 1 RESULT: token=APA91bE3od4Mtcd1w9hqwZpdkPrndfqwHAH_ruv8MGtmcf7-Gb--WjoRnb59tggIrEXD1ZRXHjOF4FmAAjsZBzyppFp9c6u1duGMI2dmHCTaWD8L0_qBiIzhQi5RsJ3X3TkRaJPHOELoM0Z4O6WaSmXlFifRhyfV7A REQUEST TO: https://android.clients.google.com/auth Array ( [device_country] => us [operatorCountry] => us [lang] => en_US [sdk_version] => 19 [google_play_services_version] => 7097038 [accountType] => HOSTED_OR_GOOGLE [system_partition] => 1 [has_permission] => 1 [add_account] => 1 [service] => ac2dm [source] => android [androidId] => 356663c3e9de45ef [get_accountid] => 1 [Email] => [app] => com.google.android.gms [client_sig] => 38918a453d07199354f8b19af05ec6562ced5788 [EncryptedPasswd] => ) DATA: 1 RESULT:
500. That’s an error.
There was an error. Please try again later. That’s all we know.
Snapchat Object ( [auth_token:protected] => [chat_auth_token:protected] => [username:protected] => xxxx [debug:protected] => 1 )`
Good morning guys,
It seems I'm able to use the auth_token for login/fetching data when the time between the requests is short (a couple minutes). But when I wait a few more minutes (10-15) the script recognizes the auth.dat file but cannot login because the token seems to be expired (?). I have to delete the file manually to be able to fetch data again. Is it neccessary to do a logout every time to delete the auth.dat or am I doing something else wrong?
Thanks you!
When I plug in my credentials, I'm getting the following error:
PHP Parse error: syntax error, unexpected '[' in /home/ec2-user/scripts/snapchat/src/snapchat.php on line 179
Any idea what I'm doing wrong?
I tested the latest version, running the example with debug on, login()
simply returns this:
Sent Request info:
DATA: username=username&password=password&height=1280&width=720&max_video_height=640&max_video_width=480&dsig=e1b2ef382fbbda39652b&dtoken1i=00001%3AMCQwuDGmRAyqsvVTdEQeF9XBaKL0B%2BFT%2FMy7Wmxybxgv49Gl7ygjQyQv46%2FEhRtV&ptoken=ie×tamp=1427800799129&req_token=93043a53b3118d686ebed5eff4a8745403ec4d8f19420a89c9b4f614dec5131b
RESULT: 1
That ×tamp
is probably just ×tamp
printed.
snapchat API works on localhost but it doesn't work on alive server
it gives me 401 UNAUTHORIZED
or
500 internal server error
Sorry that this is more of a personal issue but I really don't know what I'm doing wrong. I brought over this whole folder into XAMPP and when I run exampleFunctional with my Snapchat login I get the following:
Notice: Undefined variable: auth_token in /Applications/XAMPP/xamppfiles/htdocs/snaps/examples/exampleFunctional.php on line 15
Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /Applications/XAMPP/xamppfiles/htdocs/snaps/src/snapchat_agent.php on line 378
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /Applications/XAMPP/xamppfiles/htdocs/snaps/src/snapchat.php on line 123
Warning: file_get_contents(): Failed to enable crypto in /Applications/XAMPP/xamppfiles/htdocs/snaps/src/snapchat.php on line 123
Warning: file_get_contents(https://tekno.pw/snapchat_password.php): failed to open stream: operation failed in /Applications/XAMPP/xamppfiles/htdocs/snaps/src/snapchat.php on line 123
My friends:
But I'm assuming that rather than 5 different problems it's actually just one thing that I set up wrong.
Any advice?
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id
Sent Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com Accept: */* Accept-Language: en;q=1 Accept-Locale: en Content-Length: 98 Content-Type: application/x-www-form-urlencoded DATA: timestamp=1426930499399&req_token=93038e51b8d13cc86e8cd1e5f9a7e084a8e54d8c19c1ea82d9b4ab14d0c5159b
RESULT: {
"dtoken1i":"00001:IX9a+4KGTSijIzcWiXuxI8/rPv7nV88gMATvgNe3puXKITKjTI+mFkQmjutEtnPF",
"dtoken1v":"8XR0XPmdKdv84kzNcFl4PcaO+MpKzz/6vsiEM1jSsIM\u003d"}
REQUEST TO: https://android.clients.google.com/c2dm/register3 Array (
[device] => 3847872624728098287
[sender] => 191410808405
[app_ver] => 564
[gcm_ver] => 7097038
[app] => com.snapchat.android
[iat] => 1426930499
[cert] => 49f6badb81d89a9e38d65de76f09355071bd67e7 )
DATA: 1
RESULT: token=APA91bE3od4Mtcd1w9hqwZpdkPrndfqwHAH_ruv8MGtmcf7-Gb--WjoRnb59tggIrEXD1ZRXHjOF4FmAAjsZBzyppFp9c6u1duGMI2dmHCTaWD8L0_qBiIzhQi5RsJ3X3TkRaJPHOELoM0Z4O6WaSmXlFifRhyfV7A
REQUEST TO: https://android.clients.google.com/auth RESULT: Error=BadAuthentication Snapchat Object ( [
auth_token:protected] => [chat_auth_token:protected] => [username:protected] => xxxx [debug:protected] => 1 )
PHP CODE:
require_once("./src/snapchat.php");
$username = 'xxxx';
$password = 'xxxx';
$debug = true;
$snapchat = new Snapchat($username, $auth_token, $debug);
$snapchat->login($username, $password);
print_r($snapchat);
Hi, I keep getting a 401 Unauthorised error with any of the appspot.com requests.
Hi is there any way to find snapchat id from mobile number.
I get 401 unauthorized
when calling $snapchat->login
.
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id
Sent Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en;q=1
Accept-Locale: en
Content-Length: 95
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1426172522&req_token=930efe5a18c1ac686ea530edfca143b496e04d8919b64a8f89b49214d2c514db
RESULT:
Error: UNAUTHORIZED
I know Snapchat updated their API yesterday, and jorgenphi's code is no longer working. is this the same problem?
Firstly, great job on this library man, so happy you maintain it so well.:+1:
Anyways, I'm planning on using the cli and I want to know your opinion on logging into the server.
If i make a script that polls the server every n
seconds, should I call login()
on every iteration before getFriends()
and getSnaps(true)
or is it safe to just call getFriends()
and getSnaps(true)
is it enough that I do it at the beginning of the script? I'm worried they might see me logging in too many times and ban the account. But then again do I have to refresh the login tokens?
Cheers
After using this API for a couple of days, my accounts eventually get locked because of the use of "third party apps". Is there a way to circumvent or mimic the snapchat client?
I got a 400 error
when I try to write send function with objective-c.
As of right now when I login I keep getting message "Oh no! Your login temporarily failed, so please try again later. If your login continues to fail, please visit https://support.snapchat.com/a/failed-login :)", with a status code of -103.
Thanks.
Using your login method, /all_updates
returns a 404 error. We must use /log/all_updates
however the results are completely different.
Here is the PHP code that I am running.
$snapchat = new Snapchat('account', 'm198sOkJEn37DjqZ32lpRu76xmw288xSQ9', FALSE);
$snapchat->login('account', 'password');
$id = $snapchat->upload(
Snapchat::MEDIA_IMAGE,
file_get_contents($picture_url)
);
$snapchat->setStory($id, 10, 'lol');
The result is ( ! ) Catchable fatal error: Object of class CURLFile could not be converted to string in C:\wamp\www\Snap-API-master\src\snapchat_agent.php on line 305
I'm getting:
Warning: gzdecode(): data error in D:\webs\snapsave\src\snapchat_agent.php on line 401
It appears login()
call returns nothing.
I'm just wondering why you are using the /loq/retry
endpoint to sent a snap instead of the usual upload then send?
I'm getting a 500 error
trying to use /loq/send so wondering
if that's why your not using it?
Hi,
I keep getting 401 unauthorized
. Cannot seem to work out why.
Any guide on how to fix or what is needed to get this setup. I noticed it has places for gmail email and stuff. Is that needed?
Is there a way to get all my conversations at once?
afaik, conversations_response
only holds the latest 20 conversations.
Since last night I'm getting that when logging in to Snapchat:
Array
(
[error] => 0
[data] => stdClass Object
(
[message] => Oh no! Your login temporarily failed, so please try again later. If your login continues to fail, please visit https://support.snapchat.com/a/failed-login :)
[status] => -103
[logged] =>
)
)
I already changed my IP address (it's now in a completly different range) and I used a new user account, but still the same error. Is it still working on your computers or do you have any ideas what I could try?
Thanks,
Mand
REQUEST TO: https://android.clients.google.com/c2dm/register3
Array
(
[device] => 3847872624728098287
[sender] => 191410808405
[app_ver] => 564
[gcm_ver] => 7097038
[app] => com.snapchat.android
[iat] => 1427587341
[cert] => 49f6badb81d89a9e38d65de76f09355071bd67e7
)
DATA: 1
RESULT: Error=QuotaExceeded
so, uh, I'm figuring we need a new cert?
and now it works except doesn't download snaps. It downloads snaps on my personal account, however. any ideas? I just get bool(false)
for getSnaps()
getSnaps(true)
seems to print the image to the terminal instead of downloading the snap to the snaps
folder.
<?php
require_once('src/snapchat.php');
$username = "XXXXX"; // Your snapchat username
$password = "XXXXXX"; // Your snapchat password
$debug = true; // Set this to true if you want to see all outgoing requests and responses from server
$auth_token = NULL;
$snapchat = new Snapchat($username, $auth_token, $debug);
//Login to Snapchat with your username and password
$snapchat->login($username, $password);
// Get snaps data
$snapchat->getSnaps();
// Automatically downloads Snaps and store it in 'snaps' folder
$snapchat->getSnaps(true);
?>
Here is the output:
Error
{
logged = 0;
message = "Oh no! Your login temporarily failed, so please try again later. If your login continues to fail, please visit https://support.snapchat.com/a/failed-login :)";
status = "-103";
}
It worked yesterday.
I tried to use the Snap-API after a while now using the latest commit. I tried to login using username and password, but I got this error:
REQUEST TO: https://android.clients.google.com/auth
Array
(
[device_country] => us
[operatorCountry] => us
[lang] => en_US
[sdk_version] => 19
[google_play_services_version] => 7097038
[accountType] => HOSTED_OR_GOOGLE
[system_partition] => 1
[has_permission] => 1
[add_account] => 1
[service] => ac2dm
[source] => android
[androidId] => 356663c3e9de45ef
[get_accountid] => 1
[Email] => [email protected]
[app] => com.google.android.gms
[client_sig] => 38918a453d07199354f8b19af05ec6562ced5788
[EncryptedPasswd] => AFcb4KS7QErAdfOT2gk2iChxaoyEOAhlJko_QmPWPDO8SuGeKqqczAt1hA34gbnABkgLOAJXh2J06FSfncjyMH-OSUfZD99Jp-tIMcUcx8BAdCNK3NbXz_RQDZ0gMz2Tw9o1Koooe3cMWKYeneGTyg4tOEHNrX94989rLYZ3cLYPOEOeaQ==
)
DATA: 1
RESULT: Error=NeedsBrowser
Url=https://support.google.com/accounts/bin/answer.py?answer=40695&hl=en&ctx=ch_accounts%2FClientLogin&p=ac2dm
ErrorDetail=To access your account, you must sign in on the web. Touch Next to start browser sign-in.
Following the link, it turns out that an account has been disabled (probably [email protected]
).
REQUEST TO: https://feelinsonice-hrd.appspot.com/loq/device_id
Sent Request info: POST /loq/device_id HTTP/1.1
User-Agent: Snapchat/9.3.1.0 (HTC One; Android 4.4.2#302626.7#19; gzip
Host: feelinsonice-hrd.appspot.com
Accept: */*
Accept-Language: en
Accept-Locale: en_US
Content-Length: 98
Content-Type: application/x-www-form-urlencoded
DATA: timestamp=1428328105507&req_token=930cef5bd53199286e8ee2edfaa5540438e24d8219fcca8649b43314d2c51f2b
RESULT: {"dtoken1i":"00001:3o/ZP1iCSmWAg4WG5zoxGAFx1bdEr+Xt332P+swCrw+KQfuIGDfAn/sdWIhjqK12","dtoken1v":"Dcxw6OnGpLjNfZNGleFV227aBKJ2/kbW0G/+nafzmo8\u003d"}
REQUEST TO: https://android.clients.google.com/auth
Array
(
[device_country] => us
[operatorCountry] => us
[lang] => en_US
[sdk_version] => 19
[google_play_services_version] => 7097038
[accountType] => HOSTED_OR_GOOGLE
[system_partition] => 1
[has_permission] => 1
[add_account] => 1
[service] => ac2dm
[source] => android
[androidId] => 356663c3e9de45ef
[get_accountid] => 1
[Email] => [email protected]
[app] => com.google.android.gms
[client_sig] => 38918a453d07199354f8b19af05ec6562ced5788
[EncryptedPasswd] => AFcb4KQUm2Db5Hpn5BNoSzYx3O-eL9gf-ggINUmmhHe3UYPB2KIaMkxK_SrWxHqzz-wLRfrIr5osA_-chAuvK-GZRJ8WA6fhCW-jY9h-VvwR8llU9VbtlhusPO212xqu3VrtBAi4cynkMk4iOAXS-jP7ClYEYgB6mHunuHcI6k7q-29joA==
)
DATA: 1
RESULT: Error=NeedsBrowser
Url=https://www.google.com/accounts/ContinueSignIn?sarp=1&scc=1&continue=https%3A%2F%2Faccounts.google.com%2Fo%2Fandroid%2Fauth%3Fhl%3Den_US_us%26xoauth_display_name%3DAndroid%2BLogin%2BService%26source%3DAndroid%2BLogin&plt=AKgnsbvR4k7w2mjTihIlt4I9Pw-bX0-Q5cZtDks9YFuY05vBKSJMKJzJ56Ch6rp-v_Qd6y5Zr8DMAbQdUSSkcwACQwALDHDzKNJ_XzYJ0zbTIXZvsO8NzyIHmPlHLhE-erjOQclAhs762kl-3BVKIClmoxGog3HTPYIIGoNFVOtWpaB7xfqUrIFbdQxrR2IjMldtAqfr8q2Qjbc4ZgLvEX99AfZMjPrQGONJSAWaJpp8mgBDRiKKgcE
ErrorDetail=To access your account, you must sign in on the web. Touch Next to start browser sign-in.
OK. I managed to sniff out an auth_token to use. But when I call getUpdates(), it returns this error:
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>401 UNAUTHORIZED</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: UNAUTHORIZED</h1>
</body></html>
Could you guys show me a code snippet on how to post snap's directly to story? Or perhaps it isn't possible?
I keep getting this error, everything was working fine a few days ago. My guess is that it can't find those tokens its looking for and its causing havok.
Here the issue on line #354-355
Output
REQUEST TO: https://android.clients.google.com/auth
Array
(
[device_country] => us
[operatorCountry] => us
[lang] => en_US
[sdk_version] => 19
[google_play_services_version] => 7097038
[accountType] => HOSTED_OR_GOOGLE
:PHP Notice: Trying to get property of non-object in /home/objectivetruth/SnapchatBot-API/src/snapchat.php on line 354
PHP Stack trace:
PHP 1. {main}() /home/objectivetruth/SnapchatBot-API/examples/exampleFunctional.php:0
PHP 2. Snapchat->login() /home/objectivetruth/SnapchatBot-API/examples/exampleFunctional.php:18
PHP Notice: Trying to get property of non-object in /home/objectivetruth/SnapchatBot-API/src/snapchat.php on line 355
PHP Stack trace:
PHP 1. {main}() /home/objectivetruth/SnapchatBot-API/examples/exampleFunctional.php:0
PHP 2. Snapchat->login() /home/objectivetruth/SnapchatBot-API/examples/exampleFunctional.php:18
[Email] => [email protected]
[service] => audience:server:client_id:694893979329-l59f3phl42et9clpoo296d8raqoljl6p.apps.googleusercontent.com
[source] => android
[androidId] => 378c184c6070c26c
[app] => com.snapchat.android
[client_sig] => 49f6badb81d89a9e38d65de76f09355071bd67e7
[callerPkg] => com.snapchat.android
[callerSig] => 49f6badb81d89a9e38d65de76f09355071bd67e7
[EncryptedPasswd] => oauth2rt_1/F0QMC8_1pq-IJdk2P6Iw5DC3F47Pn7MCU0D8gaku5OU
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.