Compare commits

..

No commits in common. 'f31f0def29d29cfca3122bc68d7b1accafe17fc0' and '71f6298708056fc54badaeaa86d6a193955d07cb' have entirely different histories.

@ -1,12 +1,9 @@
import logging
from fastapi import FastAPI
from loguru import logger
from starlette.requests import Request
from app.api import api as api_router
logger = logging.getLogger(__name__)
app = FastAPI(title='prayertimes',
version='1.0.0',
description='An API for fetching islamic prayer times from Presidency of Religious Affairs of Turkey')

@ -21,7 +21,7 @@ class PrayerTimes(BaseModel):
isha: str
@cached(ttl=3*60*60, cache=Cache.MEMORY)
@cached(ttl=60*60, cache=Cache.MEMORY)
async def parse_prayer_times(url: str) -> List[PrayerTimes]:
res = await _http.get(url)
res.raise_for_status()
@ -39,7 +39,7 @@ async def parse_prayer_times(url: str) -> List[PrayerTimes]:
def make_location_url(location_id: int) -> str:
url = f'https://namazvakitleri.diyanet.gov.tr/en-US/{location_id}'
return url
return f'https://proxy.abdusco.workers.dev?url={quote(url)}'
async def get_prayer_times(location_id: int) -> List[PrayerTimes]:

@ -1,5 +1,6 @@
beautifulsoup4==4.10.0
fastapi==0.74.1
httpx==0.22.0
loguru==0.6.0
uvicorn==0.17.5
aiocache==0.11.1
Loading…
Cancel
Save