Resource icon

OBS Python VLC Now Playing Monitor - Metadata Display 1.3.2 - Hotfix

Yeaaah... I kinda foreshadowed it myself in the previous version upload `1.3.0`... due to an IDE error masive chunks of the code were gone. This basically made the properties not render in OBS, which made the script unusable, since you couldn't set up the script up for work. Thank God I keep copies of previous versions, and through a cross reference, despite adding more code to the 1.3.0 version, it roughly had almost the same number of lines as 1.2.5....so yeahh *sigh*

Funny enough these are the missing functin definitions:
- script_properties() ---- CATASTROPHIC PROBLEM
- script_save() ---- not that bad, but an issue nonetheless
- get_status_text()
- clear_cache_callback()


I'm very sorry, and I promise this will happen often from time to time xD
As pointed out before from dr0nk, the previous version of the script did have some issues that would stop the script dead on its tracks. In response to these issues, I've come up with the neccessary fixes (lets hope i didnt break something else again xD)

1. Unterminated string literal in version info

Original issue:
Python:
16 # ==================== Version Info ====================
17 __version__ = "1.2.5   <-----
18 __author__ = "icy404"
19 __updated__ = "2025-11-11"
20
21 # ==================== Configuration ====================

# issue provided by dr0nk
__version__ = "1.2.5


Fix:
I closed the string properly
✅ Fixed.




2. VLC playlist only shows first item

Original problem: get_vlc_current_file() only returned the first item.
Python:
419 def get_playing_file():
420     """Cross-platform file detection"""
421     # Method 1: Try VLC source first (most reliable and cross-platform)
422     if vlc_source_name:
423         file = get_vlc_current_file()
424         if file:
425             return file
426   
427     # Method 2: Fallback to file monitoring
428     if not music_folder:
429         return None
430   
431     system = platform.system()
432   
433     if system == 'Windows':
434         return get_playing_file_windows()
435     elif system in ['Linux', 'Darwin']:  # Darwin = macOS
    
    # issue provided by dr0nk
Current handling:
  • The script still reads VLC playlists through OBS.
  • However, note that OBS’s VLC source API does not always expose the currently playing file reliably on Windows.
  • For Windows, the script now defaults to folder monitoring, which correctly updates the text for the current song even if VLC is playing multiple items.
  • The cached OBS process avoids performance hits from repeatedly searching for OBS via psutil.

✅ This partially fixes it on Windows by switching to folder monitoring, which is what the user suggested. On Linux/macOS, VLC playlist reading works as before.


3. Performance issues / freezing

Original problem: Every call to get_playing_file_windows() searches OBS processes, freezing video.
Fix:
  • Introduced get_obs_process_cached() to cache the OBS process for 2 seconds.
  • Reduces repeated CPU-heavy searches.
✅ Fixed.



4. Cross-platform compatibility

  • Linux/macOS still use lsof monitoring.
  • Windows uses cached OBS process folder monitoring.
  • VLC source reading still works if VLC source is supported on the platform.
✅ Addressed.


5. Metadata caching

  • Implemented cache keyed by filepath + mtime.
  • Limits cache size to 500 items.
  • Clears oldest entries to prevent memory bloat.
✅ Fixed.


6. File writing / default text

  • Writes text to file if output_file is set.
  • Writes default text if no song is detected.
✅ Fixed.
Fixed Issues:
  1. File output not working by default - The script now automatically writes to a default output file path. Previously, users had to manually configure the output file path in settings.
  2. Song titles with dashes displayed incorrectly - Fixed formatting logic that was removing dashes from song names. Files like "Song Title - Artist Name.mp3" now display correctly with the dash preserved.
  3. Folder monitoring mode parsing metadata instead of filenames - When using folder monitoring (instead of VLC source), the script now correctly displays the filename instead of attempting to parse metadata tags, which was causing incorrect display.
How to Update:
  1. Remove the old script from OBS (Tools → Scripts → Select script → Remove)
  2. Add the updated script back
  3. Reconfigure your settings if needed
All users are pleased to not download or run the script. It has a fatal error which im trying to find and fix. If you still have the old version of the file, please use that, otherwise it wont work.

I will fix this as soon as humanly possible, and i know some might be frustrated, but mistakes happen, and im really sorry for that. See ya in a bit lads.
⚠️ Warning: This version, while containing lots of new and improved features, it has a critical bug. Refer to Parse text error update for more information, and please download the new stable version 1.2.5.

Added Multi-Platform Support
Prior to version 1.0.0, the script used lsof, which is primarily a Linux based library.

Fixed Performance Issues (direct source reading)
  • VLC source reading is now the primary method (instant, no file system scanning)
  • lsof now only checks obs process, not entire folder.
  • Much faster and more reliable

Module-Level Imports
  • mutagen imported at top with HAS_MUTAGEN flag
  • Warns user once if not installed
  • No repeated import attempts

Path Validation
  • Validates if music folder exists in script_update()
  • Validates output file directory exists
  • Shows warnings in log with proper context
Better Cache Cleanup
  • Removes entries where files no longer exist
  • Only removes old entries when needed
  • Logs when cleanup happens

And lastly below I have to show some bonus improvements I've done that were not part of the plan (for now at least), but I ended up adding anyways.

Bonus Improvements
  • Better error handling with specific exception types
  • Improved logging with severity levels
  • Removed leading space from text output
  • Added VLC source selection in the OBS UI
  • Status shows mutagen availability and platform
Usage Notes for best results:
  1. Select your VLC source in the dropdown (recommended method)
  2. OR set music folder for fallback monitoring
Windows users need:
pip install psutil mutagen

Linux/macOS users need:
pip install mutagen # lsof is usually pre-installed
Top