VLC NowPlaying Script
Version:    1.4.0

Author:         Tipher88
Contributors:   Etuldan
Date:           20160521
================================================================================
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.1 and Python v2.7.8/v3.2.5.
    The directions stated in this file assume default VLC settings for the Web
    Interface before starting.
    
Updates:
    Version 1.4.0
        - The script should now handle escaped characters (such as &amp;)
        
    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