From 0273585c2960d5a74a77d5a8219e68d2c97fba88 Mon Sep 17 00:00:00 2001 From: Sean Sweda Date: Fri, 18 Aug 2017 03:10:26 -0400 Subject: [PATCH] set User-Agent to avoid Google login warnings https://github.com/pettazz/pygooglevoice/pull/40#commits-pushed-f6f5df1 077b106 Fix LOGIN error. Add USER_AGENT. 984e343 Use settings USER_AGENT f6f5df1 Add USER_AGENT setting. --- googlevoice/settings.py | 2 +- googlevoice/voice.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/googlevoice/settings.py b/googlevoice/settings.py index 611a759..df241f1 100644 --- a/googlevoice/settings.py +++ b/googlevoice/settings.py @@ -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<mpl=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<mpl=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<mpl=open' SMSAUTH = 'https://accounts.google.com/SmsAuth' FEEDS = ('inbox', 'starred', 'all', 'spam', 'trash', 'voicemail', 'sms', diff --git a/googlevoice/voice.py b/googlevoice/voice.py index 908c632..8ad4349 100644 --- a/googlevoice/voice.py +++ b/googlevoice/voice.py @@ -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'):