seleccionar-idioma

This commit is contained in:
2026-03-10 13:33:01 +01:00
parent 218983660c
commit e7e124527c
2 changed files with 173 additions and 32 deletions

9
app.py
View File

@@ -469,14 +469,17 @@ def api_export_m3u():
def api_mirror_status():
data = request.get_json()
channel_id = data.get('channel_id')
mirror_idx = data.get('mirror_idx')
acestream_hash = data.get('acestream_hash')
status = data.get('status', 'unknown')
if status not in ('ok', 'issues', 'broken', 'unknown'):
return jsonify({'error': 'invalid status'}), 400
ch = next((c for c in state['channels'] if c['id'] == channel_id), None)
if not ch or not isinstance(mirror_idx, int) or mirror_idx >= len(ch['mirrors']):
if not ch:
return jsonify({'error': 'not found'}), 404
ch['mirrors'][mirror_idx]['status'] = status
m = next((m for m in ch['mirrors'] if m['acestream_hash'] == acestream_hash), None)
if not m:
return jsonify({'error': 'not found'}), 404
m['status'] = status
export = {
'version': '1.0',
'exported_at': datetime.now(timezone.utc).isoformat(),