leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
69 stars 42 forks source link

Could not send message. server return a Server error. Request Failed. Status Code: 520 #40

Closed fateh-sarfaraz closed 3 years ago

fateh-sarfaraz commented 3 years ago

I don't understand why i am getting this error Few days back i could run textapp automatically using pytextnow_api but suddenly it's not working and i am unable to figure out the problem

SilverStrings024 commented 3 years ago

Have you changed your code at all or has your sid changed?

ovr-hit commented 3 years ago

Same thing happening to me all of a sudden.

I don't understand why i am getting this error Few days back i could run textapp automatically using pytextnow_api but suddenly it's not working and i am unable to figure out the problem

SilverStrings024 commented 3 years ago

Same thing happening to me all of a sudden.

I don't understand why i am getting this error Few days back i could run textapp automatically using pytextnow_api but suddenly it's not working and i am unable to figure out the problem

To be honest; text now may just be cracking down or changing the way they handle request authentications. Add something to your code to print out the connect.sid cookie for each request. If it isn't found or changes for each request then this package is most likely going to become blocked/obsolete I can't even do any testing nor log in normally because I keep getting hit with unsolvable captchas (you can have it right but it will still say you failed).

leogomezz4t commented 3 years ago

Alright I'll look into it and try and push a bug fix soon. It may takes some time because of the impending 2.0.0 update. I'm just going to make a smaller 1.1.8 patch soon.

ovr-hit commented 3 years ago

Do you have a timeframe it will be out by? I'm really depending on it. Thanks for all the work you do on this, im infinitely grateful for people like you.

SilverStrings024 commented 3 years ago

Alright I'll look into it and try and push a bug fix soon. It may takes some time because of the impending 2.0.0 update. I'm just going to make a smaller 1.1.8 patch soon.

@leogomezz4t What's the issue?

ovr-hit commented 3 years ago

Any word? @leogomezz4t @SilverStrings024

SilverStrings024 commented 3 years ago

Any word? @leogomezz4t @SilverStrings024

I asked him about it on the discord (now deleted because no one was working on anything nor talking about trying anything other than Aaron Jamt and I [EDIT: Made a new one to talk about new methods, hmu if you want to come discuss]) and he said it seemed as though they were updating the authentication methods so it's POSSIBLE the sid is not longer a valid method.

So, since I would assume you're using the main/stable branch something I could suggest is to clone the repo then update it to do a simple check on each request to make sure the connect.sid cookie value is the same and if it's not, update it. If that doesn't work then I was correct and they indeed updated their authentication methods to make the connect.sid cookie obsolete. Which means this package is no longer viable unless someone makes a new robot and obfuscates the code (REALLY well). Which, if someone did, would mean this package becomes nothing but a texting robot instead of an API package which would pretty much call for a refactor of the entire code base.

If I can find some free time, I'll see what I can do but since I was banned it's likely not gonna happen on my side. If you'd like to brainstorm on how we can bypass this with @aaronjamt and I, then let me know and I can give you an invite to the new server Tag me when you decide what you'd like to do. Good luck!

ovr-hit commented 3 years ago

@SilverStrings024 I'm down to help out but I'm not the most experienced, I can definitely help tho. (After all I'm only 14 tryna piece together some code) Send the Discord link, let's see what we can do.

SilverStrings024 commented 3 years ago

@SilverStrings024 I'm down to help out but I'm not the most experienced, I can definitely help tho. (After all I'm only 14 tryna piece together some code) Send the Discord link, let's see what we can do.

Alright, here you go. Talk with you there. https://discord.gg/sv3kBkQm

ghost commented 3 years ago

@SilverStrings024 I'd also like a discord link. The ones you've sent are invalid. I'm depending on this API for one of my projects and I've yet to find any alternatives that are similar to text-now.

leogomezz4t commented 3 years ago

So I did some testing and it looks like textnow.com now requires a _csrf cookie to send a message and perhaps other methods

SilverStrings024 commented 3 years ago

@SilverStrings024 I'd also like a discord link. The ones you've sent are invalid. I'm depending on this API for one of my projects and I've yet to find any alternatives that are similar to text-now.

https://discord.gg/sEBe6ERt

ovr-hit commented 3 years ago

@leogomezz4t Have you figured it all out?

leogomezz4t commented 3 years ago

I think so but I'm still formatting all the new methods with the new cookie so there should be a patch soon. Keep in mind you will have to include the _csrf cookie in the Client constructor much like the sid cookie

ovr-hit commented 3 years ago

Great! Notify us when it's ready, thanks! On Sep 10, 2021, 11:45 AM -0400, Leo Wu-Gomez @.***>, wrote:

I think so but I'm still formatting all the new methods with the new cookie so there should be a patch soon. Keep in mind you will have to include the _csrf cookie in the Client constructor much like the sid cookie —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

ovr-hit commented 3 years ago

@SilverStrings024 I'm down to help out but I'm not the most experienced, I can definitely help tho. (After all I'm only 14 tryna piece together some code) Send the Discord link, let's see what we can do.

Alright, here you go. Talk with you there. https://discord.gg/sv3kBkQm

Hehe uh unban please im very sorry

SilverStrings024 commented 3 years ago

@SilverStrings024 I'm down to help out but I'm not the most experienced, I can definitely help tho. (After all I'm only 14 tryna piece together some code) Send the Discord link, let's see what we can do.

Alright, here you go. Talk with you there. https://discord.gg/sv3kBkQm

Hehe uh unban please im very sorry

I didn't ban you but, if Aaron did, let me know what your username (or whatever discord calls it) is and I'll try to figure out how to unban you

ovr-hit commented 3 years ago

Send another invite, this one's invalid. On Sep 13, 2021, 3:36 PM -0400, Matthew Amstutz @.***>, wrote:

@SilverStrings024 I'm down to help out but I'm not the most experienced, I can definitely help tho. (After all I'm only 14 tryna piece together some code) Send the Discord link, let's see what we can do. Alright, here you go. Talk with you there. https://discord.gg/sv3kBkQm Hehe uh unban please im very sorry I didn't ban you, if Aaron did I'll unban you. —You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

SilverStrings024 commented 3 years ago

You left, he didn't ban you https://discord.gg/NYUx4xRzq2

SilverStrings024 commented 3 years ago

Join the discord at the link above.

ovr-hit commented 3 years ago

@SilverStrings024 no, I'm banned, just tried to join again and it didn't work.

SilverStrings024 commented 3 years ago

@SilverStrings024 no, I'm banned, just tried to join again and it didn't work.

Then I need your username. Aaron said you only left so, let me get that I'll friend request you then unban you. Honestly not sure why he would do that though.

ovr-hit commented 3 years ago

Viviotic#3929 thanks

SilverStrings024 commented 3 years ago

Viviotic#3929 thanks

It said you don't accept friend requests.

ovr-hit commented 3 years ago

Viviotic#3929 thanks

It said you don't accept friend requests.

Try now please.

SilverStrings024 commented 3 years ago

Viviotic#3929 thanks

It said you don't accept friend requests.

Try now please.

Request sent. When I see you've accepted I'll get you back in.

leogomezz4t commented 3 years ago

Alr looks like the request also requires a csrf_token header to work

leogomezz4t commented 3 years ago

I don't know how to find the header without first sending a message in textnow.com. If anyone has an idea or wants to help then post on this thread

wunter8 commented 3 years ago

I think I got it working and will submit a PR later today. I've only tested it for sending a couple SMS. Some of the changes might need to be propagated to the other methods.

ovr-hit commented 3 years ago

I think I got it working and will submit a PR later today. I've only tested it for sending a couple SMS. Some of the changes might need to be propagated to the other methods.

That's great to hear, stay in touch on this thread please!! Much appreciated.

leogomezz4t commented 3 years ago

Great thanks!

ghost commented 3 years ago

@ovr-hit The pull request wunter did is working. I'm just telling you cause I know you also were depending on this project just as I was so yeah.

leogomezz4t commented 3 years ago

@wunter8 PR worked great so I debugged and renamed some variables and made a new PR. I'll merge it soon

ovr-hit commented 3 years ago

@wunter8 PR worked great so I debugged and renamed some variables and made a new PR. I'll merge it soon

I'll just wait for the merge, thanks!

Message here when its ready.

leogomezz4t commented 3 years ago

Will do!

wunter8 commented 3 years ago

@ovr-hit It looks like my changes have been merged! But the changes haven't been pushed to pypi/pip, so you'll have to install the latest files from Github

ovr-hit commented 3 years ago

@ovr-hit It looks like my changes have been merged! But the changes haven't been pushed to pypi/pip, so you'll have to install the latest files from Github

Is there an updated README doc? for grabbing the CSRF token and implementing it?

wunter8 commented 3 years ago

The README hasn't been updated yet. In addition to the connect.sid cookie you grab from the browser using the Developer Tools (same as before), you'll need to grab the _csrf cookie using the same method

ovr-hit commented 3 years ago

The README hasn't been updated yet. In addition to the connect.sid cookie you grab from the browser using the Developer Tools (same as before), you'll need to grab the _csrf cookie using the same method

Ok perfect, thanks.

ovr-hit commented 3 years ago

The README hasn't been updated yet. In addition to the connect.sid cookie you grab from the browser using the Developer Tools (same as before), you'll need to grab the _csrf cookie using the same method

Ok perfect, thanks.

leogomezz4t commented 3 years ago

Yeah I merged the changes yesterday and today I'll update the README and publish 1.1.8 on pypi

ovr-hit commented 3 years ago

Yeah I merged the changes yesterday and today I'll update the README and publish 1.1.8 on pypi

Perfect!!

leogomezz4t commented 3 years ago

1.1.8 has been pushed to the main branch as well as published on PyPi https://pypi.org/project/PyTextNow/1.1.8/

leogomezz4t commented 3 years ago

There are still documentation and stuff to be added but functionality is working