seleccionar-idioma
This commit is contained in:
9
app.py
9
app.py
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user