Finally! Automated Authentication Made Easy with Python #1236
Replies: 3 comments 1 reply
-
Maybe you would like to add, that the way over the browsers dev.tools panel maybe show the text "shop_id" but will NOT result in the number we do search. I tryed it this way because I thought it would be the same (yes, you did discribe it absolutly right!)... The values will only be viewable throught the raw source code where you only find this never ending html code XD
|
Beta Was this translation helpful? Give feedback.
-
tryed the "GitHub Copilot", lets see if the AI works so well like they are saying. |
Beta Was this translation helpful? Give feedback.
-
I've updated the Download on 6/18/24 |
Beta Was this translation helpful? Give feedback.
-
GetNewToken.zip
I've updated the Download on 6/18/24
It was causing a loop trying to authenticate. A simple pause was added to allow the .env file time to update while running and it's fixed now.
I attached a zip file here as an attachment that has a GetNewToken.py file, an .env file and StartAuthenticator.bat. All three files must be in the same folder/directory. This is your replacement for the horrible 'Quick Start Tutorial' and because this one is completely automated with no knowledge of coding or struggling needed.
It doesn't make you jump through hoops as the tutorial has you do.
To get this scripts working, you'll need to do a few things in the .env file first. This file is where important information is stored to help the scripts connect to your Etsy account. There are more direct instructions within the .env file to help you if you've never done this before.
RUN_SCRIPT_AFTER_AUTH: Decide if you want to run another script after logging in. Set this to 'true' to automate tasks like updating listings.
RETURN_TO_PROCESSES: Enter the name of the script file that will run after logging in, like ProcessUploadListings.py.
Callback URL:
REDIRECT_URI: Use http://localhost:3003/oauth/redirect and update the Callback URL in your Etsy app settings to match.
Here is what you don't have to do any longer: These fill in within the .env file automatically.
CODE_CHALLENGE=
CLIENT_VERIFIER=
ETSY_OAUTH_TOKEN=
ETSY_OAUTH_TOKEN_EXPIRY=
STATE_ID=
You will need to start the GetNewToken.py file with the StartAuthenticator.bat file, so you can see the output of what is happening.
That's it!!
At any point in code you make yourself for creating, updating or removing listings and your token expires you can have your code call GetNewToken.py and then have a return to the file it left by adding to the .env file where RETURN_TO_PROCESSES is located, so there is nothing to do manually to slow you down.
Beta Was this translation helpful? Give feedback.
All reactions