feat: support for "trending" playlists (without authors)

also introduces a fix for text run parsing (by forcing obj to be a dict)
This commit is contained in:
2025-10-05 17:22:15 +02:00
parent 719b545cb4
commit 5944fd2458
2 changed files with 3 additions and 1 deletions

View File

@@ -904,7 +904,7 @@ def playlists(data, req, only_json: bool = False):
# no info about what length can playlists be
# settle for a basic sanity check instead
# if len(plid) not in (18, 34, 36):
if not plid.startswith("PL"):
if not (plid.startswith("PL") or plid.startswith("OL")):
response = {"error": "Only standard playlists are currently supported (no mixes, video-based playlists, etc.)"}
if only_json:
return response

View File

@@ -471,6 +471,8 @@ def extractTextFromSimpleOrRuns(obj: dict, default: str = "") -> str:
# Extracts the text both from "runs" and "simpleText"
# with failsafe to default.
text = default
if not isinstance(obj, str):
return default
if "runs" in obj:
text = runsToText(obj["runs"])
elif "simpleText" in obj: