Current API Version: 1.0.1 PyPI
Current API functions:
connect(): Starts the connection to VLC on specified host and portsend(command): Sends command to VLCdisconnect(): Disconnects from VLCshutdown(): Ends the connection and shuts down VLCis_alive(): Returns True if the connection is alive else Falselist_commands(): Lists supported commands that can be executed by VLC
- Open VLC Media Player
- Click Tools on Menu Bar
- Click on Preferences
- On the bottom left of popup window, under 'show settings' click on All
- In the left menu expand 'Interfaces' and click on Main Interfaces
- IMPORTANT: In main interfaces, checkmark on 'Telnet'
- Expand 'Main Interfaces' on the left pane and click on 'Lua'
- On the right pane configure 'Lua Telnet'
- Lua Interface:
dummy - Host:
localhostor127.0.0.1for same computer or set remote IP - Port:
4212is default, you can leave it as is or configure any other port if required - Password: Set your password
- Lua Interface:
- Click on Save
fromPyVLC.PyVLCimportPyVLCThe library works asynchronously hence you will need to explicitly import asyncio (import asyncio) for asynchronous functioning and call the object functions with async/await syntax.
Example:
fromPyVLC.PyVLCimportPyVLCimportasyncioVLC=PyVLC()
asyncdefrunner():
awaitVLC.connect()
whileTrue:
com=input("VLC> ")
ifcom=="quit"orcom=="exit":
awaitVLC.disconnect()
breakawaitVLC.send(com)
if__name__=="__main__":
loop=asyncio.get_event_loop()
loop.run_until_complete(runner())This project is distributed under the MIT License. See LICENSE for details.