Use importlib.resources.files() api (#15)

This commit is contained in:
Simon Sawicki
2025-10-23 21:32:43 +02:00
committed by GitHub
parent b57ce18965
commit e0560ee403
2 changed files with 3 additions and 4 deletions

View File

@@ -7,11 +7,11 @@ def core() -> str:
"""
Read the contents of the JavaScript core solver bundle as string.
"""
return importlib.resources.read_text(yt_dlp_ejs.yt.solver, "core.min.js")
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "core.min.js").read_text()
def lib() -> str:
"""
Read the contents of the JavaScript library solver bundle as string.
"""
return importlib.resources.read_text(yt_dlp_ejs.yt.solver, "lib.min.js")
return (importlib.resources.files(yt_dlp_ejs.yt.solver) / "lib.min.js").read_text()