Coder Social home page Coder Social logo

spotify-network's Introduction

spotify-network

THE MASS

This probably break's Spotify's ToS or something. It does not use an official API application and uses your personal account to do API requests. USE AT YOUR OWN RISK.


spotify-network is an OSINT tool which gets a Spotify account's following, then their following, then their following, etc (to as many degrees of separation as you want) to create a pretty graph that you can show your friends.

See the results here: https://twitter.com/King_Millez/status/1643435598852820993

2D Mass

Included is a script which imports the network data into Blender so you can create even prettier 3D visualisations of your stalking endeavours.

Setup

  1. Install dependencies

    pip install -r requirements.txt
  2. Set necessary variables

    In network.ipynb, you need to set the STARTING_PROFILE_ID constant to a Spotify account ID.

    You get the ID by splitting the account URL after the final slash. For https://open.spotify.com/user/1239621992, the ID is 1239621992.

    STARTING_PROFILE_ID = "1239621992"
  3. Set MAX_DEPTH. By default it's set to 3, but this may be too much or too little for whatever it is you've trying to do. Keep in mind that this number increases the running time and amount of requests exponentially, and also makes the visualisations much slower

  4. Get your Spotify bearer token

    1. In your browser, got to https://open.spotify.com while logged in and hit F12.Then click the Network tab

    2. Change the intercept mode to only XHR requests

    3. You should see requests populating the intercept list. Click on a few until you find one which contains authorization in the request headers, not the response headers

      Example of a Spotify bearer token in the request headers

    4. Copy the value to your clipboard.

Usage

  1. Once you have your bearer token, click Run All in the Jupyter Notebook
  2. You should see a prompt to enter your account token. Abide by the divine request
  3. Once you've done this, sit back and relax while the application creates a cool network for your Spotify account
  4. Network data will be exported to {Provided Account ID}.csv, and the visualisation can be viewed in a browser by opening {Provided Account ID}.html

Importing to Blender

  1. Once you've exported the network CSV file, open Blender >= 2.8

  2. Click on the Scripting tab

  3. Click Window > Toggle System Console if you don't have it open yet

  4. In blender.py (in this repository), change csv_file_path to the absolute path of the network CSV file, e.g:

    csv_file_path = "C:\\Users\\User\\Desktop\\whatever\\123123123.csv"
  5. Change your Blender render engine to Cycles instead of Eevee (read this).

  6. Delete all objects in your scene. Add some lights if you want. You are the creative.

  7. Click play button to run the script. Watch the progress in the System Console.

  8. When it's done, do some crazy 3D stuff with your visualisation :)

spotify-network's People

Contributors

king-millez avatar

Stargazers

 avatar Kevin Jiang avatar  avatar Saad Azghour avatar GOΠZO avatar

Watchers

 avatar

Forkers

filipw-ctrl

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.