Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed May 23, 2017
1 parent e949a0b commit 8a95f48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions socli/socli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
header = {} # Request header
google_search = True # Uses google search. Enabled by default.
google_search_url = "https://www.google.com/search?q=site:stackoverflow.com+" #Google search query URL
# Suppressing InsecureRequestWarning
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# Suppressing InsecureRequestWarning and many others
requests.packages.urllib3.disable_warnings()

### To support python 2:
if sys.version < '3.0.0':
Expand Down Expand Up @@ -921,6 +920,8 @@ def fixGoogleURL(url):
:param url:
:return: Correctly formatted URL to be used in requests.get
"""
if "&sa=" in url:
url=url.split("&")[0]
if "/url?q=" in url[0:7]:
url = url[7:] #Removes the "/url?q=" prefix

Expand Down

0 comments on commit 8a95f48

Please sign in to comment.