Skip to content

Instantly share code, notes, and snippets.

@stepbrobd
Last active October 5, 2023 15:27
Show Gist options
  • Save stepbrobd/fe2f44cbb26b2fa90e9ef3a5fcb56830 to your computer and use it in GitHub Desktop.
Save stepbrobd/fe2f44cbb26b2fa90e9ef3a5fcb56830 to your computer and use it in GitHub Desktop.
download macos wallpapers
#!/usr/bin/env python3
import plistlib
import requests
from urllib.request import urlretrieve
def xml(url: str) -> list[str]:
result = []
for asset in plistlib.loads(
requests.get(url).text.encode()
)["Assets"]:
result.append(asset["__BaseURL"] + asset["__RelativePath"])
return result
def main() -> int:
urls = xml("https://mesu.apple.com/assets/macos/com_apple_MobileAsset_DesktopPicture/com_apple_MobileAsset_DesktopPicture.xml")
for idx, url in enumerate(urls):
urlretrieve(url, f"{idx}.zip")
return 0
if __name__ == "__main__":
raise SystemExit(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment