Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,9 @@ def get_page_in_quran(page: int) -> str:
|
|
| 45 |
response = requests.get(api_url)
|
| 46 |
if response.status_code == 200:
|
| 47 |
data = response.json()
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
else:
|
| 50 |
return f"Error: Unable to fetch page: {page} in the quran"
|
| 51 |
except Exception as e:
|
|
|
|
| 45 |
response = requests.get(api_url)
|
| 46 |
if response.status_code == 200:
|
| 47 |
data = response.json()
|
| 48 |
+
ayahs = data['ayahs']
|
| 49 |
+
page_content = "\n".join([ayah['text'] for ayah in ayahs])
|
| 50 |
+
return page_content
|
| 51 |
else:
|
| 52 |
return f"Error: Unable to fetch page: {page} in the quran"
|
| 53 |
except Exception as e:
|