feat: Phase 3 AI Radio (DJ Host & interleaved playlist) and Like/Dislike/Delete actions
- Add Like button: promotes wave track to permanent library and refills buffer - Add Dislike button: blacklists track in SQLite disliked_tracks, removes audio, refills buffer - Add Delete button in history table for library file removal - Add AI Radio module: wttr.in weather, Qwen 2.5 host monologues, speech synthesis, ID3 tags - Generate interleaved 'AI Радио.m3u8' alongside clean 'Моя Волна.m3u8' - Update Web UI with Radio DJ card, voice selection, and track actions
This commit is contained in:
1 parent
3db9bdb38b
commit
e5afeb06cc
15 files changed
+945
-8
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
from typing import Optional
|
||||
from app.config import settings
|
||||
|
||||
def get_current_weather() -> Optional[str]:
|
||||
"""Fetch current weather report from wttr.in in Russian."""
|
||||
city = urllib.parse.quote(settings.WEATHER_CITY) if settings.WEATHER_CITY else ""
|
||||
url = f"https://wttr.in/{city}?format=%C,+%t&lang=ru"
|
||||
try:
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
headers={"User-Agent": "curl/7.88.1"}
|
||||
)
|
||||
with urllib.request.urlopen(req, timeout=3.5) as resp:
|
||||
text = resp.read().decode("utf-8").strip()
|
||||
# Basic validation
|
||||
if text and not text.startswith("<") and len(text) < 60:
|
||||
return text
|
||||
except Exception as e:
|
||||
print(f"[RadioWeather] Warning: unable to fetch weather: {e}")
|
||||
return None
|
||||
Reference in new issue
Block a user