Base hangouts management

Hangout API

Main module of Hangout that provide base HG management and call settings management.

class hangout_api.base.Hangouts(executable_path=None, chrome_options=None)[source]

Main class for controlling hangout calls.

Initialization does two things:
  1. Makes sure that there is active X session.
  2. Starts the browser.

If ‘DISPLAY’ can’t be found in os.environ than new X session starts. Starting new session handels PyVirtualDisplay.

For handling browser used seleniumwrapper library.

>>> hangout = Hangouts()

Connect to an existing hangout. Takes id of targeted hangout as argument. Also it sets hangout_id property:

>>> hangout.connect('fnar4989hf9834h')
>>> hangout.hangout_id

Leave hangout (equal on clicking on “Leave call” button). After leaving the call you can create a new one or connect to existing.

>>> hangout.disconnect()

Invite person or circle to hangout:

>>> hangout.invite("")
>>> hangout.invite(["", "Public", "Friends"])
login(username, password, otp=None)[source]

Log in to google plus.

otp argument is one time password and it’s optional, set it only if you’re using 2-factor authorization.

>>> hangout.login('', 'password')
>>> hangout.login('', 'password', otp='123456')

Returns list of namedtuples of current participants:

>>> hangout.participants()
[Participant(name='John Doe', profile_id='108775712935')]

Start a new hangout. After new hangout is created its id is stored in ‘hangout_id’ attribure

>>> hangout.start()
>>> hangout.hangout_id

To start OnAir just pass on_air argument to ‘start’ method.

>>> hangout.start(
...   on_air={'name':'My OnAir', 'attendees':['Friends']})
>>> hangout.start(on_air='')