Closed prabapro closed 4 years ago
The file should simply look like:
input-ipc-server=/tmp/mpvsocket
No need to add [root]
into the mpv.conf file. Try recreating the file?
Hi,
Recreated the conf file & added input-ipc-server=/tmp/mpvsocket
. Same error, please refer below log;
Hmm that's really weird. Did the scrobbling work when you added [root]
to the file and played using mpv?
Once added the [root]
, getting below log;
2020-05-25 19:13:21,538 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-05-25 19:13:21,551 - INFO - MainThread - monitor - Started monitor for vlc
2020-05-25 19:13:21,556 - INFO - MainThread - monitor - Started monitor for mpv
2020-05-25 19:13:21,557 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2020-05-25 19:13:21,561 - INFO - vlc - monitor - Unable to connect to vlc. Ensure that the web interface is running.
Hey @iamkroot,
Here's an update. When I'm playing files using mpv gui player, nothing happens. But tried to run it on my terminal, scrobble started.
mpv /Users/codechilli/Movies/The\ Internship\ \[2013\]/The\ Internship\ \[2013\].mp4 --input-ipc-server=/tmp/mpvsocket
2020-05-25 21:03:50,262 - DEBUG - mpv - file_info - Filepath '/Users/codechilli/Movies/The Internship [2013]/The Internship [2013].mp4'
2020-05-25 21:03:50,263 - DEBUG - mpv - file_info - Trying to match custom regex.
2020-05-25 21:03:50,264 - DEBUG - mpv - file_info - Using guessit module to match.
2020-05-25 21:03:50,299 - DEBUG - mpv - file_info - MatchesDict([('title', 'The Internship'), ('year', 2013), ('container', 'mp4'), ('mimetype', 'video/mp4'), ('type', 'movie')])
2020-05-25 21:03:50,300 - DEBUG - scrobbler - scrobbler - Progress: 50.31%
2020-05-25 21:03:50,301 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-05-25 21:03:50,301 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 81433}}}
2020-05-25 21:03:52,006 - INFO - scrobbler - scrobbler - Scrobble start successful for The Internship
Yeah, that's pretty much expected. When you add [root]
to the file, mpv can't parse it. It's needed because the Python parser requires a section, so we add a dummy one. For some reason, it's not picking up this on your system.
Did you have auto-detect
enabled for the previous version of the config too?
One more thing, what file are you modifying exactly? It should be /Users/codechilli/.config/mpv/mpv.conf
.
Open up python3
in your terminal and paste this. Let's see what the output is.
from pathlib import Path
conf_path = Path.home() / ".config" / "mpv" / "mpv.conf"
print(conf_path)
print(conf_path.read_text())
Yup, editing /Users/codechilli/.config/mpv/mpv.conf
Below is the output as requested;
Also, sharing the track config file content for your ref;
Bro you have put the input-ipc-server
entry at the wrong position! Basically, you put the line inside the [protocol.http]
section (when you didn't put [root]
). If you look carefully, you'll see that the input-ipc-server
option is literally at the top of the config file, and that is what you should be editing (simply uncomment the line). I recommend reading how config files work.
Hey bro, actually it was there in the very first line & I commented It out & added to the last line referring to the getting started guide as it says add input-ipc-server=<path>
to the end of the mpv.conf
file. I misunderstood this, sorry about it mate :)
Btw, now the conf file is corrected by removing [root] input-ipc-server=/tmp/mpvsocket
& uncommented the first line. But the issue remains same :(
referring to the getting started guide
You're right. That was incorrect. I've updated the README.
But the issue remains same
Well, you're not getting the No option 'input-ipc-server' in section: 'root'
error in your log anymore I believe.
Yes, I'm not getting the root error now.
But ipc bath error is still there;
2020-05-27 22:15:05,754 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
But ipc bath error is still there;
That mostly means that mpv is not reading the config file properly. In a terminal, run mpv --log-file=~/mpv.log
. Then open the log file /Users/username/mpv.log
and search for input-ipc-server
. The log file should also have a line like: Reading config file /Users/...
[ 0.014][v][cplayer] Reading config file /Users/codechilli/.config/mpv/mpv.conf
[ 0.016][v][cplayer] Setting option 'input-ipc-server' = '/tmp/mpvsocket' (flags = 4)
[ 0.022][v][ipc] Starting IPC master
[ 0.023][v][ipc] Listening to IPC socket.
I can confirm the same error on Linux, Manjaro KDE 20.0.1.
If it helps, I open mpv using the shortcut, not from the terminal.
This is the mpv.conf:
###########
# General #
###########
input-ipc-server=/tmp/mpvsocket # listen for IPC on this socket
pause # no autoplay
keep-open # keep the player open when a file's end is reached
autofit-larger=100%x95% # resize window in case it's larger than W%xH% of the screen
cursor-autohide-fs-only # don't autohide the cursor in window mode, only fullscreen
input-media-keys=no # enable/disable OSX media keys
cursor-autohide=1000 # autohide the curser after 1s
This is the trakts-scrobbler logs output:
2020-05-30 03:36:30,407 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-05-30 03:36:30,425 - INFO - MainThread - monitor - Started monitor for mpv
2020-05-30 03:36:30,425 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
This is the mpv.log:
@georgeat8 It seems there's some error on your side. Your mpv log file says [ 0.030][v][cplayer] Setting option 'input-ipc-server' = '/home/george/.config/mpv/mpvsocket' (flags = 4)
. The path should be /tmp/mpvsocket
. Are you sure the option is not getting overriden somewhere else?
@prabapro Try restarting? Also, see if it works when you manually pass the option as a command line argument to mpv (like you did earlier)
@prabapro Try restarting?
@iamkroot Did restart bro, but same error
2020-05-31 23:11:39,224 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-05-31 23:11:39,265 - INFO - MainThread - monitor - Started monitor for vlc
2020-05-31 23:11:39,269 - INFO - MainThread - monitor - Started monitor for mpv
2020-05-31 23:11:39,270 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
Also, see if it works when you manually pass the option as a command line argument to mpv (like you did earlier)
Tried mpv /Users/codechilli/Movies/The\ Wolf\ of\ Wall\ Street\ \[2013\]/The\ Wolf\ of\ Wall\ Street\ \[2013\].mp4 --input-ipc-server=/tmp/mpvsocket
Video plays but nothing in the trakts log
@georgeat8 It seems there's some error on your side. Your mpv log file says
[ 0.030][v][cplayer] Setting option 'input-ipc-server' = '/home/george/.config/mpv/mpvsocket' (flags = 4)
. The path should be/tmp/mpvsocket
. Are you sure the option is not getting overriden somewhere else?
@iamkroot
A mistake on my part, however, even after changing it to /tmp/mpvsocket
, still nothing and the same error on trakts-scrobbler log:
2020-05-31 20:55:38,715 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-05-31 20:55:38,749 - INFO - MainThread - monitor - Started monitor for mpv
2020-05-31 20:55:38,751 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
Let's see if trakts config set players.mpv.ipc_path /tmp/mpvsocket
works.
Let's see if
trakts config set players.mpv.ipc_path /tmp/mpvsocket
works.
Wow, this did the trick 🥇
2020-06-03 19:05:33,999 - ERROR - mpv - mpv - Error with command ['get_property', 'path']. Response: {'request_id': 72, 'error': 'property unavailable'}
2020-06-03 19:05:33,999 - ERROR - mpv - mpv - Error with command ['get_property', 'duration']. Response: {'request_id': 74, 'error': 'property unavailable'}
2020-06-03 19:05:34,000 - ERROR - mpv - mpv - Error with command ['get_property', 'time-pos']. Response: {'request_id': 75, 'error': 'property unavailable'}
2020-06-03 19:05:43,919 - ERROR - mpv - mpv - Error with command ['get_property', 'path']. Response: {'request_id': 77, 'error': 'property unavailable'}
2020-06-03 19:05:43,920 - ERROR - mpv - mpv - Error with command ['get_property', 'duration']. Response: {'request_id': 79, 'error': 'property unavailable'}
2020-06-03 19:05:43,920 - ERROR - mpv - mpv - Error with command ['get_property', 'time-pos']. Response: {'request_id': 80, 'error': 'property unavailable'}
2020-06-03 19:05:54,047 - ERROR - mpv - mpv - Error with command ['get_property', 'path']. Response: {'request_id': 82, 'error': 'property unavailable'}
2020-06-03 19:05:54,047 - ERROR - mpv - mpv - Error with command ['get_property', 'duration']. Response: {'request_id': 84, 'error': 'property unavailable'}
2020-06-03 19:05:54,048 - ERROR - mpv - mpv - Error with command ['get_property', 'time-pos']. Response: {'request_id': 85, 'error': 'property unavailable'}
2020-06-03 19:05:57,493 - ERROR - mpv - mpv - Error with command ['get_property', 'duration']. Response: {'request_id': 89, 'error': 'property unavailable'}
2020-06-03 19:05:57,494 - ERROR - mpv - mpv - Error with command ['get_property', 'time-pos']. Response: {'request_id': 90, 'error': 'property unavailable'}
2020-06-03 19:05:57,807 - DEBUG - scrobbler - scrobbler - Progress: 21.56%
2020-06-03 19:05:57,807 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-03 19:05:57,807 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 75735}}}
2020-06-03 19:05:58,578 - INFO - scrobbler - scrobbler - Scrobble pause successful for The Wolf of Wall Street
2020-06-03 19:06:07,661 - DEBUG - scrobbler - scrobbler - Progress: 21.56%
2020-06-03 19:06:07,664 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-03 19:06:07,665 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 75735}}}
2020-06-03 19:06:08,690 - INFO - scrobbler - scrobbler - Scrobble start successful for The Wolf of Wall Street
2020-06-03 19:06:25,034 - DEBUG - scrobbler - scrobbler - Progress: 21.72%
2020-06-03 19:06:25,034 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-03 19:06:25,048 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 75735}}}
2020-06-03 19:06:25,052 - DEBUG - mpv - mpv - Sock closed
2020-06-03 19:06:25,755 - INFO - scrobbler - scrobbler - Scrobble stop successful for The Wolf of Wall Street
2020-06-03 19:06:26,127 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
Hmm that's weird, ideally the auto-detection should've worked. (I've been using mpv for a long time, and there's been no bugs in my case). @prabapro if you're up for some experimentation, let's try to get to the root of this.
First, undo the config change you did using trakts config unset players.mpv.ipc_path
. Check again whether the scrobbler is picking up the changes.
Next, go to ~/.local/pipx/venvs/trakt-scrobbler/site-packages/trakt_scrobbler/player_monitors
and open monitor.py
in an editor. Then, add logger.debug(cls.config)
on line 18 (create a new line before the except ...
). Save, and re-run the scrobbler with trakts start -r
. Send the new log contents here.
@prabapro if you're up for some experimentation, let's try to get to the root of this.
Of course :)
My file path is bit different from you mentioned.
~/.local/pipx/venvs/trakt-scrobbler/lib/python3.8/site-packages/trakt_scrobbler/player_monitors/monitor.py
Anyways, I unset the path from the config file & edited the monitor.py
Output of trakts start -r
codechilli@Prabas-MacBook-Air:~/.local/pipx/venvs/trakt-scrobbler$ trakts start -r
Unrecognized target specifier. <service-target> takes a form of <domain-target>/<service-id>.
Please refer to `man launchctl` for explanation of the <domain-target> specifiers.
Usage: launchctl kickstart [-k] [-p] <service-target>
-k Terminates the service if it is already running.
-p Prints the PID of the service that was started.
-s Starts the service suspended so that a debugger may attach.
[CalledProcessError]
Command '['launchctl', 'kickstart', '-k', 'com.iamkroot.trakt-scrobbler']' returned non-zero exit status 64.
trakts start
won't work for me anyway, what I usually do to is trakts autostart enable
when I want to force start the scrobbler.
Filed another bug for that. For now, let's focus on the mpv issue. Could you send the log contents after restarting the scrobbler?
@iamkroot Thank you for filing a new bug. Here's the log;
2020-06-07 17:06:50,225 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-06-07 17:06:50,269 - DEBUG - MainThread - monitor - {'ip': 'localhost', 'port': '8001', 'password': '**********', 'poll_interval': 10}
2020-06-07 17:06:50,269 - INFO - MainThread - monitor - Started monitor for vlc
2020-06-07 17:06:50,277 - DEBUG - MainThread - monitor - {'ipc_path': '/tmp/mpvsocket # listen for IPC on this socket', 'poll_interval': 10}
2020-06-07 17:06:50,277 - INFO - MainThread - monitor - Started monitor for mpv
2020-06-07 17:06:50,279 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2020-06-07 17:06:50,282 - INFO - vlc - monitor - Unable to connect to vlc. Ensure that the web interface is running.
wow. looks like it's not recognizing the comment, so the entire line is included as the path.
wow. looks like it's not recognizing the comment, so the entire line is included as the path.
Indeed. Removed the comment from /Users/codechilli/.config/mpv/mpv.conf
& all working fine :)
2020-06-07 18:05:43,863 - INFO - MainThread - scrobbler - Started scrobbler thread.
2020-06-07 18:05:43,887 - INFO - MainThread - monitor - Started monitor for mpv
2020-06-07 18:05:43,888 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2020-06-07 18:05:43,906 - INFO - MainThread - monitor - Started monitor for vlc
2020-06-07 18:05:43,915 - INFO - vlc - monitor - Unable to connect to vlc. Ensure that the web interface is running.
2020-06-07 18:06:04,067 - DEBUG - mpv - file_info - Filepath '/Users/codechilli/Movies/HIT The First Case [2020]/HIT The First Case [2020].mp4'
2020-06-07 18:06:04,068 - DEBUG - mpv - file_info - Trying to match custom regex.
2020-06-07 18:06:04,068 - DEBUG - mpv - file_info - Using guessit module to match.
2020-06-07 18:06:04,261 - DEBUG - mpv - file_info - MatchesDict([('title', 'HIT The First Case'), ('year', 2020), ('container', 'mp4'), ('mimetype', 'video/mp4'), ('type', 'movie')])
2020-06-07 18:06:04,262 - DEBUG - scrobbler - scrobbler - Progress: 6.45%
2020-06-07 18:06:04,263 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-07 18:06:04,263 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 517606}}}
2020-06-07 18:06:05,745 - INFO - scrobbler - scrobbler - Scrobble start successful for HIT: The First Case
2020-06-07 18:06:43,463 - DEBUG - scrobbler - scrobbler - Progress: 6.97%
2020-06-07 18:06:43,464 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-07 18:06:43,465 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 517606}}}
2020-06-07 18:06:44,712 - INFO - scrobbler - scrobbler - Scrobble pause successful for HIT: The First Case
2020-06-07 18:06:46,820 - DEBUG - scrobbler - scrobbler - Progress: 6.97%
2020-06-07 18:06:46,821 - DEBUG - mpv - mpv - Sock closed
2020-06-07 18:06:46,822 - DEBUG - scrobbler - trakt_interface - Searching cache.
2020-06-07 18:06:46,822 - DEBUG - scrobbler - trakt_interface - {'movie': {'ids': {'trakt': 517606}}}
2020-06-07 18:06:47,892 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2020-06-07 18:06:47,978 - INFO - scrobbler - scrobbler - Scrobble stop successful for HIT: The First Case
wow. looks like it's not recognizing the comment, so the entire line is included as the path.
@georgeat8 Hope this one would help you too. What I did was removing the comment from mpv.conf
Hey @iamkroot,
Updated to beta5 but still getting an error with MPV monitoring.
So I added
[root]
to thempv.conf
& got rid of the errors. The log is as below;Could you please let me know what value should go in the
mpv.conf
please? I tried below options & couldn't success with any (Sorry for not understanding the guide properly);input-ipc-server=<path>
input-ipc-server=/Users/codechilli/.config/mpv/mpv.conf
input-ipc-server=/tmp/mpvsocket
Please help.
Thanks, Praba.