GithubHelp home page GithubHelp logo

illnyang / playnite.storespoofer Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 2.0 30 KB

Change library provider of your Playnite games.

C# 100.00%
playnite metadata game-stores metadata-provider playnite-extension

playnite.storespoofer's Introduction

Playnite.StoreSpoofer

This plugin allows for per-entry editing of GameId and PluginId properties of your games. Here are some scenarios in which you'd want to edit those properties:

  • Download metadata from an official store for a manually imported game.
  • Use metadata from a different store than the game was initially imported from.

Includes an option to mass-undo all the changes you've made to your database with this plugin.

Installation

Go to %localappdata%\Playnite\Extensions (or wherever you've installed your Playnite instance) and create a folder for the plugin. You can name this folder however you prefer, the assembly will load regardless. Copy all files from /bin/${Configuration}/ (or root dir of the archive, in you downloaded the plugin from Github's releases) to this folder and restart your Playnite process.

Usage

After you've installed the plugin, its functions will be listed in the Playnite->Extensions menu.

Automatic mode for games from Battle.Net, Steam and GOG is now available under Auto-match... method. It will automatically set GameId and PluginId properties and ask you which library you prefer when multiple providers are available.

Here's a step-by-step guide on how to download metadata from a given store, manually:

  1. Find proper GameId for your Game with correspondence to the store you plan to use. Consult Finding GameId subsection for more insight.
  2. Use Change Game Id of the Selected Game and enter the new GameId.
  3. Use Change Library Plugin of the Selected Game(s) and enter the name of the new Store.
  4. Download metadata using Playnite's built-in editor - Official Store option should now be available.

Please note that some functions support multi-select editing, make use of that as you will.

Finding GameId

Internally, Playnite passes GameId property to the corresponding plugin's MetadataProvider implementation, thus there is no universal way of obtaining it for each and every game store. Consult Playnite's source code for more info.

Provider Protips
BattleNet Copy 'ProductId' field from here
Bethesda See below
Epic See below
GOG Just copy the ID from here
Itchio See below
Origin See below
Steam The number in this URL is the ID.
Twitch See below
Uplay See below

Bethesda
The last part of the url is the id, but that does not matter because of this code. This cannot be mitigated unless I implement runtime IL patching sometime in the future or ship patched plugin assembly. Not that it's worth it anyway - it doesn't download any interesting stuff.


Epic
Actually, you don't need any sort of ID to pull this off. Go here and copy the name to the Name field in the Playnite's editor. You must uncheck Installed checkbox as well.


Itchio
Currently impossible to mitigate. See this. Even if Butler supports grabbing all available games' ids and allows you to download their metadata, Playnite does not and it would require either a new MetadataProvider coded from scratch or heavy modifications to the code.


Origin
Go to Origin Store with Development Tools of your browser enabled. Look for the first API call that looks like this. Highlighted part within quotes is the ID. It should be noted that sometimes the metadata will not download fully (for example: background is missing in the case of The Sims 4 but present with Battlefield 1). Unsure whether it is a bug, more investigation is needed. Remember to disable the Installed checkbox!


Twitch
Playnite uses Twitch's API to download metadata, so you need to own the game beforehand.


Uplay
Same as Bethesda; Playnite checks if the game is installed.


Building

Download or clone the project, restore the packages and copy BattleNetLibrary.dl from your Playnite installation to the external folder. Then build the project using preferred solution configuration. All necessary manifest files will be copied to the /bin/${Configuration}/ folder alongside the binary.

Future

As of now (9/6/2019) there is no way to introduce custom Metadata Providers . A more viable option than this workaround-tier plugin would be to implement a custom Metadata Provider that could search various game stores for a given title and download the data via HTML parsing. This could be implemented in four ways:

  1. Wait until 6.0 release of Playnite and implement it the 'official' way.
  2. Use Mono.Cecil/other trickery to replace the official implementation with a custom one at runtime. Pretty hard.
  3. Create a boilerplate Library Plugin with said Metadata Provider and use Playnite.StoreSpoofer to temporarily switch to it, download the metadata, unswitch.
  4. Implement it via a Generic Plugin, possibly with a custom GUI as Playnite's Dialogs API is pretty limiting.

License (MIT)

Copyright (c) 2019 kvdrrrrr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

playnite.storespoofer's People

Contributors

illnyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alehacksp kryeker

playnite.storespoofer's Issues

Doesn't change storefront if it's disabled on Playnite

Today I tried to change Stardew Valley storefront to GOG, but it didn't work, I didn't know why, I even restarted Playnite as Admin.

But after a little while, I tried to enable GOG extension from Settings > Extensions > GOG Library Importer.

I don't think that this is an issue, but I hope that you can write this on the description, so no one else have a bad experience as I did.

Sorry for bad English, and Thank you so much for this Plugin ๐Ÿ˜

Changing Manually imported game to store error

I tried to change a game from being manually imported to being on itch.io. I got the following error:

"Failed to download metadata: Input String was not correct"

Playnite 8.11
Extension version 0.2

Script Error

I'm getting a script error: "Failed to execute extension function, One or more errors occured" when trying to automatch.
Willing to provide logs if you can explain how?
Manual set of ID works

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.