Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access once #104

Closed
Arvendui opened this issue Jul 8, 2021 · 6 comments · Fixed by #114
Closed

Access once #104

Arvendui opened this issue Jul 8, 2021 · 6 comments · Fixed by #114

Comments

@Arvendui
Copy link

Arvendui commented Jul 8, 2021

Is there a way in which I can access with the same credentials every time I run my script? (And not get the "We noticed you accessed from a new device" mail from too good to go every time?)

@ahivert
Copy link
Owner

ahivert commented Aug 16, 2021

For the moment, you will have to save the client and reuse it.
The solution would be to save only tokens and give it to the client but the client is not ready for that at the moment.
I will try to make this change this week.

@c-hloehuang
Copy link

Hi, has there been any update on this issue? I'm not able to figure out how to stop getting the new login emails

@christoschronopoulos
Copy link

+1 That would be good to know! Those emails are quite annoying :P

@ahivert
Copy link
Owner

ahivert commented Oct 20, 2021

Have you tried to change how you build your loop/scheduler ?

Something like this should work:


client = TgtgClient(email="", password="")

while True:
    items = client.get_items()
    time.sleep(1)

Build first the client then use it in your loop.

@ahivert ahivert linked a pull request Oct 20, 2021 that will close this issue
@christoschronopoulos
Copy link

Omg, this makes perfect sense! Thanks a lot @ahivert!!

@brouckaertd
Copy link

brouckaertd commented Oct 22, 2021

In the mean time I used pickle to save the client to my tinydb database and reuse it when needed.

import codecs
import pickle

# client to string
pickled = codecs.encode(pickle.dumps(tgtg_client), "base64").decode()
# string to client
tgtg_client = pickle.loads(codecs.decode(pickled.encode(), "base64"))

It seems that a permanent solution has been provided (the pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants