Git Product home page Git Product logo

mezque / vrc-spotifyosc-py Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 79 KB

Python script using SpotifyAPI to display your current song and song playback position using the VRChat message box and OSC.

License: MIT License

Python 74.17% Batchfile 5.05% PowerShell 5.92% Shell 14.87%
opensoundcontrol osc vrchat vrchat-tool spotify spotify-api spotifyapi vrc-osc vrchat-osc vrchat-chatbox music python python-script python3

vrc-spotifyosc-py's Introduction

VRC-SpotifyOSC-Py

A simple Spotify OSC chatbox for VRChat using SpotifyAPI.

Key FeaturesHow To UseDownloadDev Portal InstructionsCreditsLicense

Key Features

  • Customizable
    • Able to change the chatbox text formatting very easy! Just change the formatting on
      Song1[0] = f"Now playing {cur_song} by {cur_artist} {time2}/{time1}" (time display/OSC always mode)
      or Song1[0] = f"Now playing {cur_song} by {cur_artist}" (send once per song mode).
  • Uses API
    • Slightly more optimized than reading the Spotify program name, or limiting to Windows only via usage of the godawful Windows Now Playing API, plus with the added song scrobble time feature returned by SpotifyAPI.
    • Able to display the current song playing on any device due to using API to retrieve playing information.
  • Cross platform
    • Windows, macOS and Linux ready.
  • Timestamp and song length display. (updated aprox every 5 seconds)
    Screenshot 2023-02-26 184155
  • Or alternatively only send playing song once per each song, checked for song change on a 2 second interval.
    image

Note : Usage of the Spotify API requires a premium account; this will not work with free accounts.

How To Use

To clone and run this application, you'll need Python and git (links for windows) From your command line:

# Clone this repository
$ git clone https://github.com/Mezque/VRC-SpotifyOSC-Py

# Go into the repository
$ cd VRC-SpotifyOSC-Py/Py/Spotify

# Install dependencies
$ pip install -r requirements.txt

# Run the app
$ py Spotify.py

Open Spotify.py and set client_id and client_secret to their respected value on your created application from the Spotify Dev Portal. Instructions here

Note If you're using Windows, there is included bat files to do step 3 and 4.
(if you choose to download below you don't need to clone the repositroy or install git)
If Python is failing to run properly on Windows install it from the Microsoft Store instead of the python website for an easy fix; this is a Windows problem to do with how python is set up under your system variables.

Download

You can download the latest version as well if you don't want to use git to clone the repository. It's the same thing just slower for people less experienced with usage of git through a CLI.

Spotify Dev Portal

How to set up the application,

  1. Head to the Spotify Dev Portal and log into your account.
  2. Press the green button on the top of the right side that says "Create an app", the name doesn't matter and a description is not required.
  3. Open up the newly created app and copy your Client ID and set this value in the Spotify.py file. Do the same thing for the Client Secret after pressing Show Client Secret.
  4. Press the green button around the same location where the create app button was on the previous menu and under the section "Redirect URIs" put http://localhost:8888/spotify/callback

Credits

This software uses the following open source packages:

License

MIT


vrc-spotifyosc-py's People

Contributors

mezque avatar

Stargazers

 avatar  avatar  avatar  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.