Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (12 sloc) 572 Bytes
# Delete the file running on VLC
import dbus, os
from urllib.parse import unquote
session_bus = dbus.SessionBus()
player = session_bus.get_object('org.mpris.MediaPlayer2.vlc', '/org/mpris/MediaPlayer2')
interface = dbus.Interface(player, dbus_interface='org.mpris.MediaPlayer2.Player')
metadata = player.Get('org.mpris.MediaPlayer2.Player', 'Metadata', dbus_interface='org.freedesktop.DBus.Properties')
path = unquote(metadata['xesam:url']).replace('file://','')
if ".mp4" not in path or ".avi" not in path:
You can’t perform that action at this time.