I just finally decided to write a script in Python 3 to get the largest number of images (16) from the xml archive.
So now I can archive images effortlessly. Just run the Python script.
I arrange the images in the Year / Month folders as follows: 2018> December 12> 2018 -1 2-06.jpg
This script is in my Bing Wallpapers folder. (which is in my image folder)
import urllib.request as urllib import json from datetime import date from dateutil import parser import sys,os months = "January","Febuary","March","April","May","June","July","August","September","October","November","December" def downloadBingImages(start): try: data = urllib.urlopen("https://www.bing.com/hpimagearchive.aspx?format=js&idx=%i&n=8&mkt=en-NZ"%start).read() except: sys.exit() e = json.loads(data.decode()) images = e["images"] for image in images: d = parser.parse(image["startdate"]) # parse("20181206") filename = str(d.date())+".jpg" # 2018-12-06.jpg folder = "%i/%i %s/"%(d.year,d.month,months[d.month-1]) # 2018/12 December/ file = folder+filename # 2018/12 December/2018-12-06.jpg if not os.path.exists(folder): os.makedirs(folder) exists = os.path.isfile(file) url = "https://www.bing.com"+image["urlbase"]+"_1920x1200.jpg" print(("downloading","exists")[exists],filename,url) if not exists: try: urllib.urlretrieve(url,file) except: sys.exit() print() # downloads the 16 latest bing images downloadBingImages(-1) downloadBingImages(7)
Additional additional code for updating the wallpaper: (put BingImages (7) under the download)
import ctypes,win32con def getWallpaper(): ubuf = ctypes.create_unicode_buffer(512) ctypes.windll.user32.SystemParametersInfoW(win32con.SPI_GETDESKWALLPAPER,len(ubuf),ubuf,0) return ubuf.value def setWallpaper(path): changed = win32con.SPIF_UPDATEINIFILE | win32con.SPIF_SENDCHANGE ctypes.windll.user32.SystemParametersInfoW(win32con.SPI_SETDESKWALLPAPER,0,path,changed)
output example:
exists 2018-12-15.jpg https://www.bing.com/az/hprichbg/rb/YosemiteBridge_ROW11493343707_1920x1200.jpg exists 2018-12-14.jpg https://www.bing.com/az/hprichbg/rb/CardinalBerries_ROW13321753978_1920x1200.jpg exists 2018-12-13.jpg https://www.bing.com/az/hprichbg/rb/ReykjavikYuleLads_ROW12406174277_1920x1200.jpg exists 2018-12-12.jpg https://www.bing.com/az/hprichbg/rb/PoinsettiaBuds_ROW14015106672_1920x1200.jpg exists 2018-12-11.jpg https://www.bing.com/az/hprichbg/rb/KilimanjaroMawenzi_ROW12001033920_1920x1200.jpg exists 2018-12-10.jpg https://www.bing.com/az/hprichbg/rb/ChristmasIslandCrab_ROW12174154872_1920x1200.jpg exists 2018-12-09.jpg https://www.bing.com/az/hprichbg/rb/JohnDaySnow_ROW10922424229_1920x1200.jpg exists 2018-12-08.jpg https://www.bing.com/az/hprichbg/rb/BanffEvergreens_ROW13248925556_1920x1200.jpg exists 2018-12-07.jpg https://www.bing.com/az/hprichbg/rb/TaisetsuShirakawago_ROW12053480529_1920x1200.jpg exists 2018-12-06.jpg https://www.bing.com/az/hprichbg/rb/Huuhkajat_ROW11700922065_1920x1200.jpg exists 2018-12-05.jpg https://www.bing.com/az/hprichbg/rb/SurfersBronteBeach_ROW9358782018_1920x1200.jpg exists 2018-12-04.jpg https://www.bing.com/az/hprichbg/rb/SphinxObservatory_ROW9691446114_1920x1200.jpg exists 2018-12-03.jpg https://www.bing.com/az/hprichbg/rb/HussarPoint_ROW8654856850_1920x1200.jpg exists 2018-12-02.jpg https://www.bing.com/az/hprichbg/rb/Nuuk_ROW12381573676_1920x1200.jpg exists 2018-12-01.jpg https://www.bing.com/az/hprichbg/rb/RedAntarctica_ROW12620598839_1920x1200.jpg exists 2018-11-30.jpg https://www.bing.com/az/hprichbg/rb/KilchurnSky_ROW9474162800_1920x1200.jpg
PS The above script uses &mkt=en-NZ for New Zealand images.
You can check the market code for other countries here .
You can also see all the images archived since 2009 for different countries, here .
(only at 1366x768 though)
Major PS add a script to the task scheduler to run when you log in. (or daily / weekly)
Create a primary task
Program / script: python (or C: \ Python34 \ python.exe if it is not in the env path)
Arguments: "path / to / your / script.py"
start with: "path / to / yours"
UPDATE! (March 2019)
An incorrect start date (20190309) in xml and rss format was specified for the image 2019-03 -1 0.
Instead, the Json format is used. (as it gives the exact date)