leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
67 stars 41 forks source link

Sudo #20

Closed bryanperez43 closed 3 years ago

bryanperez43 commented 3 years ago

Program requires sudo in order to open and read/write the user_sids.json file.

SilverStrings024 commented 3 years ago

Program requires sudo in order to open and read the Sid file.

Is the Sid file located in a directory that requires root to modify its files?

leogomezz4t commented 3 years ago

It depends on the OS of course but yes. If you’re using Linux then you will have to run it with sudo. The SID file is in the root directory of the package. So normally wherever your pip site-packages are.

On Thu, Jun 17, 2021 at 4:39 PM SilverStrings (Matt) < @.***> wrote:

Program requires sudo in order to open and read the Sid file.

Is the Sid file located in a directory that requires root to modify its files?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leogomezz4t/PyTextNow_API/issues/20#issuecomment-863607222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQV6RXUMYSJZEPR4NSLBMNTTTJ2T5ANCNFSM464JALTA .

SilverStrings024 commented 3 years ago

It depends on the OS of course but yes. If you’re using Linux then you will have to run it with sudo. The SID file is in the root directory of the package. So normally wherever your pip site-packages are.

On Thu, Jun 17, 2021 at 4:39 PM SilverStrings (Matt) < @.***> wrote:

Program requires sudo in order to open and read the Sid file.

Is the Sid file located in a directory that requires root to modify its files?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leogomezz4t/PyTextNow_API/issues/20#issuecomment-863607222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQV6RXUMYSJZEPR4NSLBMNTTTJ2T5ANCNFSM464JALTA .

We could use a sqlite3 database since it only needs created one time and then simply connected to after that which shouldn't need sudo. Just spitballing

bryanperez43 commented 3 years ago

I concur. This would make things smoother.

It depends on the OS of course but yes. If you’re using Linux then you will have to run it with sudo. The SID file is in the root directory of the package. So normally wherever your pip site-packages are.

On Thu, Jun 17, 2021 at 4:39 PM SilverStrings (Matt) < @.***> wrote:

Program requires sudo in order to open and read the Sid file.

Is the Sid file located in a directory that requires root to modify its files?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/leogomezz4t/PyTextNow_API/issues/20#issuecomment-863607222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQV6RXUMYSJZEPR4NSLBMNTTTJ2T5ANCNFSM464JALTA .

We could use a sqlite3 database since it only needs created one time and then simply connected to after that which shouldn't need sudo. Just spitballing

SilverStrings024 commented 3 years ago

I can work on a PR for it if you'd like. Just let me know :)

On Mon, Jun 21, 2021, 10:55 AM Bryan Perez @.***> wrote:

I concur. This would make things smoother.

It depends on the OS of course but yes. If you’re using Linux then you will have to run it with sudo. The SID file is in the root directory of the package. So normally wherever your pip site-packages are.

On Thu, Jun 17, 2021 at 4:39 PM SilverStrings (Matt) < @.***> wrote:

Program requires sudo in order to open and read the Sid file.

Is the Sid file located in a directory that requires root to modify its files?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub

20 (comment)

https://github.com/leogomezz4t/PyTextNow_API/issues/20#issuecomment-863607222 , or unsubscribe

https://github.com/notifications/unsubscribe-auth/AQV6RXUMYSJZEPR4NSLBMNTTTJ2T5ANCNFSM464JALTA .

We could use a sqlite3 database since it only needs created one time and then simply connected to after that which shouldn't need sudo. Just spitballing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/leogomezz4t/PyTextNow_API/issues/20#issuecomment-865098713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJA6UH3OLN4S7Z6NKLV2UJDTT5HGBANCNFSM464JALTA .

leogomezz4t commented 3 years ago

yeah @SilverStrings024 please do work on a PR. Unfortunately, I am not well versed in SQL and SQLite but if you make a PR I'll vet it and see if I add it to the project. Thank you!

SilverStrings024 commented 3 years ago

yeah @SilverStrings024 please do work on a PR. Unfortunately, I am not well versed in SQL and SQLite but if you make a PR I'll vet it and see if I add it to the project. Thank you!

No problem, the only thing we're storing is just the user name and sid right? Also, Text now changes the sid cookie each time you log out/log in correct?

leogomezz4t commented 3 years ago

Yeah just the username and sid. yeah textnow makes the cookie expire after about 24 hours and right now I am trying to figure out a way to make it auto-refresh.

SilverStrings024 commented 3 years ago

Yeah just the username and sid. yeah textnow makes the cookie expire after about 24 hours and right now I am trying to figure out a way to make it auto-refresh.

Alright, thanks. I'll try to see what I can do to help with the auto refresh. They use Google reCAPTCHA V3 so they tend to detect less sophisticated robots so, short of making a very good robot I'm not sure it's possible to refresh the sid. I did an experiment and it looks like the results for sid changes are inconsistent. I've logged in a total of 4 times and had the same sid for 3 of those so there has to be some sort of trigger. I'm going to do some investigating to see if I can find any hints; I'll post a comment here if I find anything and submit the PR when it's good to go (don't worry, I do automated and manual tests before submitting a PR)

leogomezz4t commented 3 years ago

Thanks yeah I've been doing countless login tests to find the trigger. I think that it's just authenticating the Sid cookie so I'm trying to find it.

SilverStrings024 commented 3 years ago

Well, there are two people on the mission so hopefully we find it. I'll let you know what I find

leogomezz4t commented 3 years ago

Thanks yeah hopefully we find it.

SilverStrings024 commented 3 years ago

Thanks yeah hopefully we find it.

Pretty sure I found something. Do you have an email or something we can talk on? This could become a massive thread.

bryanperez43 commented 3 years ago

could create a discord channel to discuss development

SilverStrings024 commented 3 years ago

@bryanperez43 alright. Just now made one, I'll finish setting it up in a moment.

https://discord.gg/xypPCmwHvs

SilverStrings024 commented 3 years ago

Full release of 2.0.0 will contain a database handler which should get rid of the need for sudo. This will need tested but I'm currently working to make the database handler even easier to use and speed the program up by implementing an event manager that will start threads and do things for you when a function registered as an event fires. So, using DatabaseHandler directly will be replaced with event manager decorators. You can still use the database handler directly but it will execute synchronously which will slow down your program.