jesseward / plex-lastfm-scrobbler

Scrobble played audio items Last.FM from the Plex Media Server application.
MIT License
92 stars 13 forks source link

Not starting on CentOS 6.6 - File contains no section headers #34

Closed ronilaukkarinen closed 9 years ago

ronilaukkarinen commented 9 years ago

Hi,

I get the following on CentOS:

(plex-lastfm-scrobber)[21:09:52] [58.0°C] rolle ~ $ plex-scrobble.py
Traceback (most recent call last):
  File "/home/rolle/.virtualenvs/plex-lastfm-scrobber/bin/plex-scrobble.py", line 100, in <module>
    config.read(options.config_file)
  File "/usr/lib64/python2.6/ConfigParser.py", line 286, in read
    self._read(fp, filename)
  File "/usr/lib64/python2.6/ConfigParser.py", line 482, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home/rolle/.config/plex-lastfm-scrobbler/plex_scrobble.conf, line: 4
"mediaserver_url = 'http://192.168.2.100:32400'\n"

I can access to my Plex web through http://192.168.2.100:32400/web so I guess that part of the config is okay? Also, the setup didn't create ~/.config/plex-lastfm-scrobbler/plex_scrobble.conf automatically, I had to create it manually (used nano). Running as user, not as root.

What gives?

jesseward commented 9 years ago

@ronilaukkarinen thanks for reporting. Looks like this may be a formatting issue within the configuration file. Please paste a copy of /home/rolle/.config/plex-lastfm-scrobbler/plex_scrobble.conf at http://pastebin.com/ and pass along the URL.

ronilaukkarinen commented 9 years ago

@jesseward Here you go: http://pastebin.com/4ipHJGMT

jesseward commented 9 years ago

hi @ronilaukkarinen , try using the following. Note that your version was missing the header [plex-scrobble] which is required.

[plex-scrobble]
# REQUIRED: mediaserver_url is the location of the http service exposed by Plex Media Server
# the default values should be 'ok', assuming you're running the plex scrobble
# script from the same server as your plex media server
mediaserver_url = http://192.168.2.100:32400

# REQUIRED: Where do you wish to write the plex-scrobble log file.
log_file = /tmp/plex_scrobble.log

# REQUIRED: a python data struture that stores failed scrobbles. plex-scrobble
# will retry on a 60 minute interval, maximum of 10 attempts if last.fm is
# experiencing issues.
cache_location = /tmp/plex_scrobble.cache

# OPTIONAL: mediaserver_log_location references the log file location of the plex media server
# the default under /var/lib/... is the default install of plex media server on 
# a Linux system. You may wish to change this value to reference your OS install.
# https://support.plex.tv/hc/en-us/articles/200250417-Plex-Media-Server-Log-Files
#mediaserver_log_location = /path/to/plex/media/server/log
jesseward commented 9 years ago

@ronilaukkarinen i added some error handling to catch and cleanly exit when an improperly formatted configuration file is met. May want to checkout latest release (1.3.4 or master) and reinstall.

ronilaukkarinen commented 9 years ago

Thanks! after setting up and relaunching output should be empty? should the scrobbling be in real time or after listening? No songs scrobbled yet in my Last.fm profile.

You should add the header also to Configuration part of your readme.

ronilaukkarinen commented 9 years ago

Oh yeah, it works, just not in real time but that's okay. Resolved. :+1:

jesseward commented 9 years ago

Nice catch, thanks. Updated the README.md in https://github.com/jesseward/plex-lastfm-scrobbler/commit/e9149073560aa0e31e6b21f658048057a0cc1971