Skip to content

Instantly share code, notes, and snippets.

@bburky
Last active August 24, 2023 03:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bburky/464543d4c6662c66ad6088d06ced50ce to your computer and use it in GitHub Desktop.
Save bburky/464543d4c6662c66ad6088d06ced50ce to your computer and use it in GitHub Desktop.
Get Steam Cover Images Playnite Extension

Get Steam Cover Images Playnite Extension

Replaces the cover image of the selected games with the Steam header image for the game. If the game is not a Steam game, the game's links will be parsed for a Steam store link to guess the game's AppID.

Setting game's covers to an internet URL may be slow to load, so enabling "Asynchronous image loading" in Playnite's settings is suggested.

I recommend first running "Tools" → "Download Metadata" with "Only download metadata for games missing them" unchecked and select only:

  • Cover Image "Offical Store > IGDB"
  • Links "IGDB > Offical Store"

Usually the official store already has banner sized cover images, and fetching IGDB links will ensure the games have Steam store links.

Name: Get Steam Cover Images
Author: Blake Burkhart
Version: 0.1.1
Module: steam-header-covers.ps1
Type: Script
Functions:
- Description: Get Steam Header Images for Selected Games
FunctionName: Update-SelectedGameCovers
$steamGuid = [Guid]"CB91DFC9-B977-43BF-8E70-55F46E410FAB"
$HEADER_URL = "http://cdn.akamai.steamstatic.com/steam/apps/{0}/header.jpg"
Function Update-GameCovers ($games) {
foreach ($game in $games) {
$appid = $null
if ($game.PluginId -eq $steamGuid) {
# Use GameId for Steam games
$appid = $game.GameId
} else {
# Look for a Link to a Steam Store URL for other games
foreach ($link in $game.Links) {
switch -regex ($link.Url) {
"https?://store.steampowered.com/app/(\d+)" {
$appid = $matches[1]
}
}
}
}
if (!$appid) {
continue
}
# Verify that the URL doesn't 404
$url = $HEADER_URL -f $appid
try {
Invoke-RestMethod -Method Head -Uri $url
} catch {
continue
}
$game.CoverImage = $url
$PlayniteApi.Database.Games.Update($game)
}
}
function global:Update-SelectedGameCovers {
$selected = $PlayniteApi.MainView.SelectedGames
$updated = Update-GameCovers $selected
$PlayniteApi.Dialogs.ShowMessage("Updated cover image of $($updated.count) of $($selected.count) games.", "Update Complete")
}
@bburky
Copy link
Author

bburky commented May 11, 2020

Version 0.1.1

Updated for current versions of Playnite.

Untested, but was just an update to use $PlayniteApi.Database.Games.Update($game) instead of UpdateGame(). I had a few comments to update this and I see there is already a revision on this Gist with that change.

Copy link

ghost commented Jun 21, 2022

How to enable it? It is not .pest file.

@bburky
Copy link
Author

bburky commented Jun 21, 2022

@ataberkcemunal This extension is pretty old, some minor tweaks will be needed to work on a current version of Playnite

Does the Universal Steam Metadata addon meet your needs? I think it can download the cover image from steam? I'm not completely sure, I haven't tested it.
https://playnite.link/addons.html#Universal_Steam_Metadata

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment