Skip to content
/ sbotify Public

reddit bot that adds songs from a comment to that thread's Spotify playlist

Notifications You must be signed in to change notification settings

nhend/sbotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sbotify

This project is a python bot that scrapes reddit for a 'summon' with song and artist names and then adds those songs to a playlist dedicated to that thread. The intention with this project was to cater to threads with large collections of songs, for example: "What are your best workout songs?" could be found on /r/fitness, "Post your favorite Count Basie song" could be found on /r/jazz, etc.

Usage

Note: /u/Sbotify is not currently active

You can summon Sbotify by using the following format anywhere in your comment: /u/Sbotify **song name**:*artist name* You can add any number of songs from your comment by repeating the syntax after /u/Sbotify (see image below)

After adding the songs, Sbotify will reply to the summoning comment with a message telling the user their songs were added to the playlist. It will also provide a link to the playlist, a link to a 30sec preview (which can be played without logging into Spotify), and a link to message me in case of an issue. The reply also includes a link for the summoner to delete the bot's comment and remove their songs from the playlist (used especially if the bot gets their songs wrong).

If you're familiar with reddit, you can find more usage information on the FAQ

img

Requirements

If you plan on running your own version of Sbotify, make sure you:

  • Have a Spotify account
  • Have a reddit account
  • Configure config.py with your own API ids and information. Make sure to put your reddit username in your reddit useragent
  • Create an empty comment_ids.txt and link_ids.txt to keep track of what comments your bot has seen
  • Install the libraries mentioned below

Libraries

  • spotipy for Spotify API interaction
  • PRAW for interaction with reddit

Next Steps

  • Multiple songs in one comment
  • Improve summon detection with regex
  • Get summons from inbox instead of comment search
  • Playlist descriptions with subreddit, author, and full title
  • Better error handling
  • Allow summoner to delete the reply comment and requested song (if the bot gets the wrong song, etc.)
  • Prevent duplicates from being added to a playlist

Thanks

  • /u/kungming2 -- suggested new syntax and summon source
  • /u/friedkeenan -- found some bugs

About

reddit bot that adds songs from a comment to that thread's Spotify playlist

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages