diff --git a/README.md b/README.md index a60b2ac..bade08b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # OBS Adapter for WebNowPlaying-Redux -A OBS script to display information from [WebNowPlaying-Redux](https://github.com/keifufu/WebNowPlaying-Redux) +A OBS script to display information from [WebNowPlaying-Redux](https://github.com/keifufu/WebNowPlaying-Redux) +It also supports a lot of desktop players! Read more [here](https://github.com/keifufu/WebNowPlaying-Redux/blob/main/NativeAPIs.md). ![widgets](./images/widgets.jpg) @@ -23,5 +24,6 @@ If you delete a source, it will stay deleted until you click "Create Sources" ag - Open cmd and run `pip install --upgrade pywnp` # Known Issues -- Reloading the script will cause it to spam errors. -If you need to reload it for some reason, please restart OBS. \ No newline at end of file +- Reloading the script might cause it to spam errors or not work at all. +If you need to reload it for some reason, restart OBS. +If you DID reload the script and it doesn't work anymore even after restarting OBS, restart your computer. \ No newline at end of file diff --git a/wnp-obs.py b/wnp-obs.py index a83ffe1..2d9a63e 100644 --- a/wnp-obs.py +++ b/wnp-obs.py @@ -1,6 +1,8 @@ +from threading import Thread +import urllib.request, json from pywnp import WNPRedux import obspython as obs -import urllib.request, json +import time # WNP Variables player_name = 'N/A' @@ -63,11 +65,13 @@ def script_update(settings): def script_load(settings): def logger(type, message): print(f'WNP - {type}: {message}') - WNPRedux.start(6534, 6535, '1.2.0', logger) + print('load') + WNPRedux.start(6534, '2.0.0', logger) obs.timer_add(update, 250) def script_unload(): - WNPRedux.stop() + Thread(target=WNPRedux.stop).start() + time.sleep(1) # sorry but this at least prevents reloading the script breaking it obs.timer_remove(update) def update():