-
Notifications
You must be signed in to change notification settings - Fork 67
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
google calendar requires me to re-authorize each time #19
Comments
@esprittordu so after you get prompted, and after you run that URL in another curl session, and the first session continues, do you see a Two possibilities I'm thinking of are, either that token.pickle isn't being written, so the code doesn't know what tokens to use to get your calendar info. Or, the tokens are being written but whatever permissions it has been given aren't sufficient for calendar operations. You can give it another go, try deleting credentials.json (which you downloaded from Google API Console) and token.pickle (which this script generates), and then regenerate and redownload credentials.json, and then run the script again. |
I don't see a .pickle file anywhere in this directory. What a whimsical file extension name! I will delete credentials and redo them and see if anything is generated. I am doubtful that anything will be different because like i said google appears to have changed the format of their calendar token, they don't give me an alphanumeric code or anything but then again I have a thick head. |
Ok after going through the python3 screen-calendar-get.py I receive all of these errors:
|
Let's see if our steps are the same and make sure the file being downloaded is the same. I go to https://console.cloud.google.com and sign in. On the left, APIs and Services > Credentials On the credentials screen, at the top, New Credentials, OAuth client ID Application type = Limited input device or Desktop. I think both should be acceptable. After the credentials get created, you should see a list of Client IDs in a table like this. On the right the 'down' arrow should prompt you to download the credentials.json file. The contents look like this. I've deleted some bits for secrecy
Now the contents of that file should become Once credentials.json is in place, I did a I open it in a browser, I get a warning screen, Google hasn't verified this app!. Show advanced, I allow it, and the browser shows an error page, because it's trying to go to a A message appears: I go back to the first SSH session, and the script has continued and should have listed things from your calendar. I also see a token.pickle in the same folder when I do
Now try running run.sh again. It should not prompt you. |
So I got curious about the pickle name after you pointed it out 😁 and found this StackOverflow post. I think it comes down to Python being Python... and the naming goes back to 1994! |
Did the screenshots help @esprittordu ? |
I'm at exactly the same sticking point. No pickled token. |
I get 404 if I execute ./run.sh :
But if I run |
I'm wondering what's different between us that could be causing this. Can all of you show me the output of these commands: Maybe if there's something different I need to experiment and try to match your environments. Here's mine:
|
@Maquis90 When you call screen-calendar-get.py on its own, it must be defaulting to the "primary" calendar, as it's picking the default value. When you run it with My guess is that the value set in env.sh for Can you re-copy-paste the Calendar ID from Google Calendar into your env.sh. Here's what mine looks like, I'm obscuring the first part.
I was able to reproduce the 404 problem by changing random letters in the Google Calendar ID to one that didn't exist. |
Seems like my calendar ID was the problem: |
I sorted my problem, I wasn't putting bunny ears around the curl url. Works like a dream now, thanks. |
Ok full disclosure I'm a total slobbering idiot when it comes to this but I think I'm almost there. I've got the code mostly working. The weather displays which is great. The calendar isn't though. I know that this is probably partially google's fault changing code and authentication protocols around on you but this is what it is:
Each time I run run.sh I get the prompt to put the google url into a browser window. I follow the instructions in a different ssh window with curl and run.sh continues. When I run run.sh again I am again prompted with the url and have to paste it into another curl session.
The other problem is that my display (which looks great, nice formatting!) instead of showing calendar entries says:
CAL_ONE
CAL_DESC_ONE
CAL_TWO
CAL_DESC_TWO
...and so on.
This may be because I think the calendar id for google format changed. Now it shows just my email address for calendar id. There is no number as seen in your example.
The text was updated successfully, but these errors were encountered: