Code Monkey home page Code Monkey logo

Comments (3)

kuzmoyev avatar kuzmoyev commented on May 20, 2024

I think the problem is that google_auth_oauthlib runs its authentication flow server on the port 8080 by default which might be occupied by something else in your system.

Try netstat -a -b -n and check if this port is in use. If you can, quit the application that uses it. If not it would require overriding the _get_credentials of GoogleCalendar like so:

class GoogleCalendarOnAnotherPort(GoogleCalendar):    
    def _get_credentials(self):
        _credentials_path = os.path.join(self._credentials_dir, self._credentials_file)

        credentials = None

        if os.path.exists(self._token_path):
            with open(self._token_path, 'rb') as token:
                credentials = pickle.load(token)

        if not credentials or not credentials.valid:
            if credentials and credentials.expired and credentials.refresh_token:
                credentials.refresh(Request())
            else:
                flow = InstalledAppFlow.from_client_secrets_file(_credentials_path, self._scopes)
                credentials = flow.run_local_server(port=8090) # note the port parameter. Change to any free port

            with open(self._token_path, 'wb') as token:
                pickle.dump(credentials, token)

        return credentials

It is a workaround and should be fixed in the future version of the gcsa.

Thank you for the issue submission.

from google-calendar-simple-api.

neurognome avatar neurognome commented on May 20, 2024

Perfect! That was exactly the issue, I set it to use a different port and everything is working great.

Thanks so much.

from google-calendar-simple-api.

kuzmoyev avatar kuzmoyev commented on May 20, 2024

I'll leave the issue open until it is fixed in the implementation

from google-calendar-simple-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.