Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ctypes
- import requests
- import os
- class DownloadWallpaper(object):
- def __init__(self):
- r = requests.get('http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US')
- data = r.json()
- suffix = data['images'][0]['url']
- wallpaper = requests.get("https://bing.com%s" % suffix)
- with open("wallpaper.jpg", "wb") as wallpaperFile:
- wallpaperFile.write(wallpaper.content)
- DownloadWallpaper()
Add Comment
Please, Sign In to add comment