Git Product home page Git Product logo

winamprpc's Introduction

WinampRPC

A script reading playing status from Winamp and connecting it to Discord rich presence with images.

Winamp.py is a standalone Winamp controller module fleshed out for modern python with OOP in mind. It was originally based on controller made by DerpyChap, which can be found from his PyWinamp repository.

Fast-forwarding tracks is not currently supported. If the track position is changed, pausing and un-pausing the track or restarting main.py should correct the elapsed time in Discord. If the track name is one character long, it is changed to format Track: {track_name}. This is due to Discord rich presence supporting only strings at least two characters long.

Requirements

The minimum Python version supported is 3.8.

  • Winamp
  • pypresence
  • pywin32

Any relatively new Winamp version should be fine. Versions starting from 5.0 should be safe.

How to use

  1. Clone the repository
  2. (optional) Set up some custom assets
  3. Run main.py while using Winamp and Discord

In case there are some troubles with pywin32 especially after updating Python, running pip upgrade command should solve this: python -m pip install --upgrade pywin32.

Custom assets

Getting custom images to the rich presence is rather simple:

  1. Create a new Discord app for WinampRPC in Discords' Developer portal
  2. Make files album_covers.json and album_name_exceptions.txt
  3. In settings.json
    • Replace the client_id with the new Discord app ID
    • set custom_assets True
    • (optional) Define a default asset key and text for large asset. If given, this image is shown when an album asset cannot be found from Discord API
    • (optional) Define a small asset key and text. If given, this is shown when a track is playing
  4. Upload default assets with keys matching to ones given in settings.json (if any)
  5. Upload some album assets and add corresponding album name: asset_key pairs to album_covers.json. The default asset keys are not needed in this file.

If there are many albums with same name, the album name must be added to album_name_exceptions.txt each on their own line for the assets to work. For these albums the assets are searched in format artist - album name instead of only the album name. Naturally this must also be taken into account when saving the assets into Discord API.

Due to restrictions in the Discord asset API, following rules must be met with custom assets:

  • There can be maximum of 300 assets for an application
  • The asset keys cannot be longer than 30 characters long
  • The keys cannot have any special characters, including spaces
  • The asset keys in album_covers.json and settings.json must be exact matches with the ones in asset API

If there are no matches for an asset key in Discord API, they are simply ignored. Therefore, if ignoring large or small asset is needed, it is possible by leaving their asset keys empty. This also means if WinampRPC is working but assets are not appearing, there are no matches between Discord API and the asset keys in local files.

Examples

As these images show, there should not really be problem with any kind of alphabet as long as they are supported in UTF-8.

cyrillic example japanese example short track name custom asset

winamprpc's People

Contributors

visperi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

winamprpc's Issues

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.