Yaron Koresh commited on
Commit
80158b7
·
verified ·
1 Parent(s): 8307765

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -40,8 +40,7 @@ def translate(text,lang):
40
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15',
41
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15'
42
  ]
43
- params = {'q': f'{lang}: {text}'}
44
- url = f'https://www.google.com/search?{parse.urlencode(params)}'
45
  print(url)
46
  resp = requests.get(
47
  url = url,
 
40
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15',
41
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15'
42
  ]
43
+ url = f'https://www.google.com/search?q={lang}: {text}'.replace(" ","+")
 
44
  print(url)
45
  resp = requests.get(
46
  url = url,