Giter Site home page Giter Site logo

rohieb / mpv-notify Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 14.0 12 KB

now-playing-desktop notifications for mpv ⚠ Note: This software is currently unmaintained since I don't have the resources or interest right now to maintain it. If you want to work on it, I could give you access to the repository, or just fork it. :-)

Lua 100.00%
mpv libnotify nowplaying

mpv-notify's Introduction

⚠ Note: This software is currently unmaintained since I don't have the resources or interest right now to maintain it. If you want to work on it, I could give you access to the repository, or just fork it. :-)


mpv-notify

Adds desktop notifications to the mpv media player, which show metadata like artist, album name and track name when the track changes.

Features

  • shows artist, title and album name (as far as detected by mpv)
  • tries to find load cover art in the same folder, or loads it from coverartarchive.org and caches it locally.

Requirements

On recent Debians, do a sudo apt-get install lua-socket lua-posix libnotify-bin imagemagick

Installation

Just drop notify.lua into the folder ~/.mpv/lua (create it when neccessary), and mpv will find it. Optionally, you can add it to mpv's command line:

mpv --lua=/path/to/notify.lua <files and options>

License

mpv-notify was written by Roland Hieber , you can use it under the terms of the MIT license.

mpv-notify's People

Contributors

mathstuf avatar rohieb avatar tmsbrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mpv-notify's Issues

Possible LUA errors

Long story short: I don't know if this is my end or yours, and for that I apologize now.

The error, when loaded via the lua=~/.mpv/lua/notify.lua is as follows:

Warning: option --lua was replaced with --script and might be removed in the future.
[notify] 
[notify] stack traceback:
[notify]    /home/jared/.mpv/lua/notify.lua:70: in main chunk
[notify]    [C]: at 0x00475400
[notify]    [C]: at 0x004769a0
[notify] Lua error: /home/jared/.mpv/lua/notify.lua:70: module 'socket.http' not found:
[notify]    no field package.preload['socket.http']
[notify]    no file './socket/http.lua'
[notify]    no file '/usr/share/luajit-2.0.4/socket/http.lua'
[notify]    no file '/usr/local/share/lua/5.1/socket/http.lua'
[notify]    no file '/usr/local/share/lua/5.1/socket/http/init.lua'
[notify]    no file '/usr/share/lua/5.1/socket/http.lua'
[notify]    no file '/usr/share/lua/5.1/socket/http/init.lua'
[notify]    no file './socket/http.so'
[notify]    no file '/usr/local/lib/lua/5.1/socket/http.so'
[notify]    no file '/usr/lib/lua/5.1/socket/http.so'
[notify]    no file '/usr/local/lib/lua/5.1/loadall.so'
[notify]    no file './socket.so'
[notify]    no file '/usr/local/lib/lua/5.1/socket.so'
[notify]    no file '/usr/lib/lua/5.1/socket.so'
[notify]    no file '/usr/local/lib/lua/5.1/loadall.so'

An image of the error:
2016-07-15-172124_632x464_scrot

mpv --version returns:

mpv git-8b47e5d (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Tue Jul 12 15:40:06 EDT 2016
ffmpeg library versions:
   libavutil       55.17.103
   libavcodec      57.24.102
   libavformat     57.25.100
   libswscale      4.0.100
   libavfilter     6.31.100
   libswresample   2.0.101
ffmpeg version: 3.0.2

I'm running on Arch Linux, and that's really the most that I can give ya there.

Any more info will be added as requested! :)

local scope on mbid variable

I see this is no longer being supported.

I found your script and have been messing around with it on an arch install which has hooks into mpv playback via ranger.
I was finding that although the "d" variable on the musicbrainz look up was coming back with valid XML that it was not correctly getting passed back to the coverart look up.
I finally tracked it down to the local scope on mbid with the string.match

local mbid = string.match(d or "",
"<%srelease%s+[^>]id%s=%s['"]%s*([0-9a-fA-F-]+)%s*['"]")

Removing the local scope fixed this :
mbid = string.match(d or "",
"<%srelease%s+[^>]id%s=%s['"]%s*([0-9a-fA-F-]+)%s*['"]")

Based on other issues, I forked it over on gitlab with credit given :)
https://gitlab.com/geolaw/mpv-notify

Doesn't work on Windows

I've dropped the notify.lua script in %APPDATA%\mpv\lua\ and %APPDATA%\mpv\scripts\ but it doesn't do anything for me. Any tips on how it's supposed to work?

fetch cover art from local files

Cover art is currently taken from the internet every time. Although it is cached locally, there may already be a cover image embedded in the file, or there may be one (like cover.jpg) in the same folder as the played track. Such cover art should be used instead if it is present.

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.