Skip to content

Commit

Permalink
set User-Agent to avoid Google login warnings
Browse files Browse the repository at this point in the history
pettazz#40 (commits)
  077b106 Fix LOGIN error. Add USER_AGENT.
  984e343 Use settings USER_AGENT
  f6f5df1 Add USER_AGENT setting.
seansweda committed Jun 28, 2018
1 parent 90d7957 commit 0273585
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion googlevoice/settings.py
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
}

DEBUG = False
LOGIN = 'https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice&ltmpl=open'
LOGIN = 'https://accounts.google.com/ServiceLogin?continue=https://www.google.com/voice&rip=1&nojavascript=1&followup=https://www.google.com/voice&service=grandcentral&ltmpl=open&flowName=GlifWebSignIn&flowEntry=Identifier'
LOGIN_POST = 'https://accounts.google.com/signin/challenge/sl/password?service=grandcentral&continue=https://www.google.com/voice/redirection/voice&followup=https://www.google.com/voice&ltmpl=open'
SMSAUTH = 'https://accounts.google.com/SmsAuth'
FEEDS = ('inbox', 'starred', 'all', 'spam', 'trash', 'voicemail', 'sms',
2 changes: 1 addition & 1 deletion googlevoice/voice.py
Original file line number Diff line number Diff line change
@@ -259,7 +259,7 @@ def __do_page(self, page, data=None, headers={}, terms={}):
page = page.upper()
if isinstance(data, dict) or isinstance(data, tuple):
data = urlencode(data)
headers.update({'User-Agent': 'PyGoogleVoice/0.5'})
headers.update({'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Firefox/52.0'})
if log:
log.debug('%s?%s - %s' % (getattr(settings, page)[22:], data or '', headers))
if page in ('DOWNLOAD', 'XML_SEARCH'):

0 comments on commit 0273585

Please sign in to comment.