data = fetch_top_videos(args.key, args.max) xml_output = to_xml(data) with open(args.output, "w", encoding="utf-8") as f: f.write(xml_output) print(f"Saved args.max top videos to args.output")