VLC NowPlaying

Non-OBS Script VLC NowPlaying 1.7.0

Latest version : 1.7.0

This is a Python script I put together in order to display information from VLC on my stream. The setup that I know this script will work on is Windows 7/10 with Python v2.7/v3.4-7 and VLC v2.2.4-v3.0.4, but it should be cross platform although I cannot guarantee that.

The README.txt contained within the zip should contain all the directions required to get this script up and running, but for ease of access and understanding I will include it here as well.

VLC NowPlaying Script
Version: 1.7.0

Author: Tipher88
Contributors: AbyssHunted, Etuldan
Date: 20190227
================================================================================
This is a script that allows you to create a NowPlaying.txt file to display song
information from VLC.

While developing this script I was using VLC v2.2.4-v3.0.4 and Python v2.7/v3.4-7.
The directions stated in this file assume default VLC settings for the Web
Interface before starting.

Updates:
Version 1.7.0
- Fixed UnicodeEncodeError caused by improper encoding

Version 1.6.0
- Added handling for Unicode BOM as well as some minor optimizations

Version 1.5.0
- Unicode characters should now be supported in the meta-data

Version 1.4.0
- The script should now handle escaped characters (such as &)

Version 1.3.0
- The script now generates another file: NowPlaying_History.txt

Version 1.2.0
- Added support for the now_playing metadata tag

Version 1.1.0
- Tweaked script in order to support Python v3.x
================================================================================
Usage:
python NowPlaying.py
================================================================================
Dependencies:
Python (https://www.python.org/)
requests (http://www.python-requests.org/en/latest/)
================================================================================
In order to be able to use this script you need to do the following:

Extract the contents of the .zip to a location of your choosing

VLC:
1. Open VLC
2. Go to Tools -> Preferences
3. On the bottom left select the All radio button in the Show Settings
group
4. Click Main Interfaces item in the list on the left
5. Check the Web check-box
6. Click the drop-down arrow next to the Main Interfaces item to expand
the selection
7. Click the Lua sub-item
8. Set a password in the Lua HTTP group
9. Make sure the Source Directory in the same group is set to something
similar to: C:\Program Files (x86)\VideoLAN\VLC\lua\http
10. Click the Save button
11. Close and re-open VLC

Check to make sure Web Interface is active:
1. Open an internet browser and go to:
http://localhost:8080/requests/status.xml
2. Leave the username blank and type in the password you set in VLC
step 8
3. If the resulting page is in the form of xml (a bunch of tags with
names) then the Web Interface is working

Modify the script:
1. Search the script for the term "CUSTOM" to look at the items you can
change, they are currently as follows:
a. The separator string
b. The password to the Web Interface (needs to match VLC step 8)
c. The name of the generated file (default is NowPlaying.txt)
d. The amount of time to wait between checks

Run the script:
1. Open up your preferred console/terminal used to run python scripts
2. Change the directory to the location you extracted the .zip to
initially
3. Run the command: python NowPlaying.py
4. Start playing songs in VLC media player
5. You should see the song info show up in the console
6. You should also see a NowPlaying.txt file appear with text that
matches what is displayed in the console
7. Keep the script running while you stream
8. Enter ctrl + c to exit the script once you are done streaming

OBS:
1. Add a text source to OBS with the "Use Text From File" pointing to
the file generated from the script

Console:
Console.PNG


NowPlaying.txt, contains only the current song + separator:
NowPlaying.PNG


NowPlaying_History.txt, contains all songs played with a timestamp for reference:
NowPlaying_History.PNG


If you have any questions I will do my best to answer them as I have time to do so.

Thanks for checking out my script!
-Tipher88
  • Like
Reactions: Luis Bordis
Author
Tipher88
Downloads
11,064
Views
11,064
First release
Last update
Rating
5.00 star(s) 3 ratings

Latest updates

  1. Version 1.7.0

    === Version 1.7.0 - Fixed UnicodeEncodeError caused by improper encoding
  2. Version 1.6.0

    === Version 1.6.0 - Added handling for Unicode BOM as well as some minor optimizations
  3. Version 1.5.0

    === Version 1.5.0 - Unicode characters should now be supported in the meta-data

Latest reviews

Very well coded and the readme is just amazing too. Thanks a lot!
Tipher88
Tipher88
I appreciate your kind comments and review. Thank you!
Thanks so much for this script @Tipher88! Never run a python script before, never even worked with python but I got this up and running in OBS in just a couple hours. Works great!
Tipher88
Tipher88
I'm glad it is working for you! Thanks for the review!
Very good script, congratulations, actually I make a video about your script inpired me to create an pyhton script with youtube api to load in a text my subscribers. Uploaded here today!!
Tipher88
Tipher88
Thank you very much! I'm glad I inspired you to make something that you saw a need for! :-)
Top