Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Brock committed Dec 19, 2014
2 parents c0e7bf6 + 1ede3ec commit b4d288b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/gfsoso.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _refreshCookie(opener, what):
global RedirectedUrl
RedirectedUrl = response.geturl()
RedirectedUrl = RedirectedUrl[0 : RedirectedUrl.find('/', 7) + 1]
# print RedirectedUrl
# print 'Redirect', RedirectedUrl
return False

html = response.read()
Expand All @@ -62,10 +62,12 @@ def _refreshCookie(opener, what):

m = re.search(r"_GFTOKEN','([0-9a-f]+)'", html)

# print m, m.group(1)
webutils.cookieJar.set_cookie(_makeCookie('AJSTAT_ok_pages', '1'))
webutils.cookieJar.set_cookie(_makeCookie('AJSTAT_ok_times', '1'))
if m:
webutils.cookieJar.set_cookie(_makeCookie('_GFTOKEN', m.group(1)))
else:
return False
global _cookieFetched
_cookieFetched = True
Expand Down Expand Up @@ -164,6 +166,7 @@ def _gfsosoSearch(opener, what, resultNum = -1, startNum = 0):

if not _cookieFetched:
if not _refreshCookie(opener, what):
print 'abcd'
#global _gfsosoPageHandler
googlesearch.GOOGLE_HOME = RedirectedUrl
#print RedirectedUrl
Expand Down

0 comments on commit b4d288b

Please sign in to comment.