Made it more like a uv script style project

This commit is contained in:
Mike Lynch 2025-04-06 08:53:46 +10:00
parent f4a2b4f88e
commit 477514c2ba
2 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,7 @@ def main():
help="Config file", help="Config file",
) )
args = ap.parse_args() args = ap.parse_args()
print(f"Config from {args.config}")
with open(args.config, 'r') as cfh: with open(args.config, 'r') as cfh:
cf = json.load(cfh) cf = json.load(cfh)
m = int(cf.get("max", "5")) m = int(cf.get("max", "5"))
@ -77,3 +78,5 @@ def main():
print(f"content = {url}") print(f"content = {url}")
download_audio(url, config['dir']) download_audio(url, config['dir'])
if __name__ == "__main__":
main()

View File

@ -8,3 +8,6 @@ dependencies = [
"feedparser>=6.0.11", "feedparser>=6.0.11",
"pycurl>=7.45.6", "pycurl>=7.45.6",
] ]
[project.scripts]
autoradio = "autoradio.autoradio:main"