Spaces:
Running
Running
Add url param to match detail API for slug-based HTML scraping
Browse files- app_main.py +4 -2
app_main.py
CHANGED
|
@@ -233,8 +233,10 @@ def api_wc2026_match(event_id:int):return JSONResponse(scrape_match_detail(event
|
|
| 233 |
from match_detail import fetch_match_detail, fetch_match_detail_by_url
|
| 234 |
|
| 235 |
@app.get('/api/match/{event_id}/detail')
|
| 236 |
-
def api_match_detail(event_id: int):
|
| 237 |
-
"""Get complete match detail
|
|
|
|
|
|
|
| 238 |
return JSONResponse(fetch_match_detail(event_id))
|
| 239 |
|
| 240 |
@app.get('/api/match/detail')
|
|
|
|
| 233 |
from match_detail import fetch_match_detail, fetch_match_detail_by_url
|
| 234 |
|
| 235 |
@app.get('/api/match/{event_id}/detail')
|
| 236 |
+
def api_match_detail(event_id: int, url: str = Query(default=None)):
|
| 237 |
+
"""Get complete match detail. Optional 'url' param with full bongda URL (with slug) for HTML scraping."""
|
| 238 |
+
if url:
|
| 239 |
+
return JSONResponse(fetch_match_detail_by_url(url))
|
| 240 |
return JSONResponse(fetch_match_detail(event_id))
|
| 241 |
|
| 242 |
@app.get('/api/match/detail')
|