Skip to content

ronilaukkarinen/pianobar-macos

Repository files navigation

Enhanced pianobar for macOS

This is rolle's awesome fork of pianobar settings for macOS.

With pianobar-macos you can achieve a working Command Line Interface music player that plays radio from Pandora, scrobbles songs to Last.fm and more. All this with CLI!

Features

  • Always connects to Pandora regardless of country (SOCKS5 and Tor)
  • Notifies songs played with pianobar
  • Loved songs in Pandora are automatically Loved songs in Last.fm when marked loved + key
  • Displays currently playing album art in notification
  • Scrobbles playing songs to Last.fm in real time and permanently when played 50% of the song
  • Displays info about changing stations, displays station name in notification

Screen-Shot-2022-10-18-09-29-47 82

Installation

  1. terminal-notifier - Send User Notifications on macOS 10.8 and later from the command-line:

    brew install terminal-notifier
  2. Python3

    brew install python3
  3. pylast important: You will need the latest version, install with:

    pip3 install pylast
  4. pync

    pip3 install pync
  5. pianobar - pianobar is a free/open-source, console-based client for the personalized online radio Pandora.

    brew install pianobar
  6. Tor

    brew install tor
  7. pianobarproxy

    go install github.com/brendanhoran/pianobarproxy@latest
  8. Add tor config with sudo nano /opt/homebrew/etc/tor/torrc:

    ExitNodes {us} StrictNodes 1
    CircuitBuildTimeout 5
    NumEntryGuards 6
    KeepalivePeriod 60
    NewCircuitPeriod 15
    SOCKSPort 9050
    RunAsDaemon 0

Usage

  1. Install requirements (steps above)

  2. Clone this repo and move everything to ~/.config/pianobar:

    cd $HOME; git clone https://github.com/ronilaukkarinen/pianobar-macos; cd pianobar-macos; mkdir -p $HOME/.config/pianobar; cp -Rv $HOME/pianobar-macos/* $HOME/.config/pianobar/; rm -rf $HOME/pianobar-macos
  3. Edit:

    nano $HOME/.config/pianobar/config

    Add following:

    user = yourusername@gmail.com
    password = YourVeryHardPassWordForPandora
    event_command = /Users/rolle/.config/pianobar/events.py
    proxy = http://127.0.0.1:9090
  4. Rename events.py.sample to events.py:

    mv $HOME/.config/pianobar/events.py.sample $HOME/.config/pianobar/events.py
  5. Edit events.py and fill in the Last.fm variables at the top of the script.

  6. Make sure everything is executable:

    cd $HOME/.config/pianobar && sudo chmod +x *.py && sudo chmod +x *.sh && sudo chmod +x *.rb
  7. Create folder for covers:

    mkdir -p $HOME/.config/pianobar/.covers
  8. Open three terminal windows and run these, tor and pianobarproxy and pianobar in their separate windows:

    unset PYTHONPATH
    tor
    export GOPATH=/Users/rolle/go
    export PATH=$GOPATH/bin:$PATH
    pianobarproxy -socks5 :9050
    pianobar

Troubleshooting

If Last.fm happens to be down, pianobar won't load any music. You should disable event_command line during the downtime or wait it out.

If you don't get any notifications or scrobbles, try which python and change the first line from your events.py to the path, for example:

#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python

About

Fork of console-based pandora.com player - Last.fm scrobbling and notifications with album art for macOS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages