cloudwp commited on
Commit
cbf6837
1 Parent(s): b28dbdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  import json
4
  import zipfile
5
  import requests
 
6
 
7
  app = Flask(__name__)
8
 
@@ -17,7 +18,7 @@ class APIService:
17
  class SynonymAPI(APIService):
18
  """ API-Dienst für Synonyme. """
19
  def fetch(self, word):
20
- url = f"https://lingua-robot.p.rapidapi.com/language/v1/synonyms?word={word}"
21
  headers = {
22
  'x-rapidapi-key': self.api_key,
23
  'x-rapidapi-host': "lingua-robot.p.rapidapi.com"
 
3
  import json
4
  import zipfile
5
  import requests
6
+ from urllib.parse import quote as url_quote # Korrektur des Imports
7
 
8
  app = Flask(__name__)
9
 
 
18
  class SynonymAPI(APIService):
19
  """ API-Dienst für Synonyme. """
20
  def fetch(self, word):
21
+ url = f"https://lingua-robot.p.rapidapi.com/language/v1/synonyms?word={url_quote(word)}"
22
  headers = {
23
  'x-rapidapi-key': self.api_key,
24
  'x-rapidapi-host': "lingua-robot.p.rapidapi.com"