Coder Social home page Coder Social logo

martymacgyver / spotlight-downloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orelio/spotlight-downloader

0.0 2.0 0.0 34 KB

Download Spotlight images and define them as wallpaper and lockscreen image.

Batchfile 2.74% Visual Basic 0.53% C# 96.73%

spotlight-downloader's Introduction

SpotlightDL

This program can retrieve Windows Spotlight images by requesting the Microsoft Spotlight API. SpotlightDL can also define images as wallpaper and system-wide lockscreen image.

It is useful in the following use cases:

  • Download the whole Spotlight library with maximum image resolution and metadata
  • Define Spotlight images as wallpaper, not only on Windows 10 but also on previous versions
  • Define Spotlight images as global lock screen on Win7/8/10, removing the ads on Windows 10
  • Chain SpotlightDL with your own scripts and apps by taking advantage of the url mode

How to use

Simply call SpotlightDownloader.exe from the Windows command prompt and see usage. The download/url modes should also work on Mac/Linux using the Mono framework.

A few Batch files are offered for ease of use for common tasks:

  • spotlight-download: Download Spotlight images
  • update-wallpaper: Set images as desktop wallpaper
  • update-lockscreen: Set images as system-wide lockscreen
  • restore-lockscreen: Restore default system-wide lockscreen
  • generate-manual: Generate a text file with command-line usage

If you wish to periodically update your wallpaper or lockscreen, you can schedule one of the provided script by following these instructions.

How it works

Spotlight API

The Spotlight API is located on the following endpoint:

https://arc.msn.com/v3/Delivery/Cache?pid=209567&fmt=json&rafb=0&ua=WindowsShellClient%2F0&disphorzres=9999&dispvertres=9999&lo=80217&pl=en-US&lc=en-US&ctry=us&time=2017-12-31T23:59:59Z

Where the expected arguments are:

  • pid : Purpose currently unknown
  • fmt : Output format, e.g. json
  • rafb : Purpose currently unknown
  • ua : Client user agent string
  • disphorzres: Screen width in pixels
  • dispvertres: Screen height in pixels
  • lo : Purpose currently uknown
  • pl : Locale, e.g. en-US
  • lc : Language, e.g. en-US
  • ctry : Country, e.g. us
  • time : Time, e.g. 2017-12-31T23:59:59Z

The JSON response contains details about 6-7 images including image url, title, sha256, ads, etc.

Spotlight API URL was originally found in this file, thanks to the author for their findings!

Global lock screen

The global lock screen image for Windows 8 and 10 is stored as C:\Windows\Web\Screen\img100.jpg. SpotlightDL backups the image as img200.jpg if it does not already exists, then overwrite this file. The lock screen image cache, located at C:\ProgramData\Microsoft\Windows\SystemData\S-1-5-18\ReadOnly\LockScreen_Z, must be cleared for the change to take effect.

SpotlightDL gets around NTFS permissions on these folders being locked down to TrustedInstaller by setting the local Administrators group as new owner of the relevant files and folders, and granting full control to this group. Then, programs running as administrator can overwrite the lockscreen image and clear the cache.

This way of replacing the lockscreen is basically a C# implementation of this script, avoiding the use of the takeown and iacls commands which are not reliable due to a localization issue.

Windows 7 support is also implemented through the OEMBackground feature:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background]
"OEMBackground"=dword:00000001

Then the image has to be placed in C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg Windows 7 enforces a limit of 250 KiB so SpotlightDL will recompress the image to the highest quality fitting in that limit.

License

SpotlightDL is provided under CDDL-1.0 (Why?).

Basically, you can use it or its source for any project, free or commercial, but if you improve it or fix issues, the license requires you to contribute back by submitting a pull request with your improved version of the code. Also, credit must be given to the original project, and license notices may not be removed from the code.

spotlight-downloader's People

Contributors

orelio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.