pixelchai / NightBotNowPlaying

Program for overlaying NightBot's current song on your stream
2 stars 3 forks source link

No code #3

Closed roosartwork closed 3 months ago

roosartwork commented 1 year ago

After the step of "python3 nowplaying.py", it opens a new window where it asks to allow or cancel the application. It gives the error "unknown error occurred" and, when trying to find the code at the end of the url, there's none. Screenshot from 2023-04-28 16-24-49

roosartwork commented 11 months ago

Hi! I tried again and the issue persists, both in Chromium and Firefox

pazrosales98 commented 6 months ago

It happens the same to me, did anyone figure out what's wrong?

roosartwork commented 5 months ago

The request gives this error {"message":"Invalid client: redirect_uri does not match client value"}

DinoSour69 commented 5 months ago

having same issue, on my machine when running nowplaying.py it opens 2 duplicate browser tabs. pressing Cancel or Authorize on either of them show 'Unknown Error Occured' can someone please help

DinoSour69 commented 5 months ago

The request gives this error {"message":"Invalid client: redirect_uri does not match client value"}

ok i got it to work through trial and error. i went into nowplaying.py and copied the value of URI_REDIRECT directly from there. I think the uri on the README is missing a slash or something. Hope this helps. Edit: my OS is Ubuntu 20.04.6 LTS focal fossa. To clarify I pasted the value into my nightbot applications page. Idk why I forgot to mention that I was pretty tired

roosartwork commented 5 months ago

The request gives this error {"message":"Invalid client: redirect_uri does not match client value"}

ok i got it to work through trial and error. i went into nowplaying.py and copied the value of URI_REDIRECT directly from there. I think the uri on the README is missing a slash or something. Hope this helps.

I got so excited when I read your reply so I ran to try it out only to find that, since I last tried getting the program to work, the error changed (I switched distros) and now it only says this when I click "authorize"... :')

image

The code is still nowhere to be found, of course.

But I'm so so so happy you got it working for you! I hope someone else with the same problem finds your solution and helps them get it fixed too <3

pixelchai commented 3 months ago

Thank you all for the bug report and the helpful details you all provided.

Bug fix I can confirm that I was able to reproduce and fix the bug. @DinoSour69 absolutely had the right idea. It is important that the 'Redirect URI' in the applications page on NightBot must be set to the exact correct value, with no trailing backslash. Previously, in the README file, the URL got auto-formatted to a link (like this: http://localhost:5771 ) and for some reason, browsers put a backslash at the end when you right-click and copy-link. @DinoSour69 said they copied and pasted the URL from the code itself, and that's why they got the exact right value. I've confirmed that when the value is exactly correct, the program works as expected.

I've updated the README to highlight this issue in a new Common Issues section, and prevented link auto-formatting.

Enhancement Sorry for the delay in looking into this, I was super busy with uni but now that I've graduated, I finally had some time :) :mortar_board:

To thank you for your patience, I have also implemented an enhancement to the authorisation process: you now no longer need to copy-paste a code from the browser and into the Python program. You simply click 'Authorize', and it'll handle it behind the scenes.

Getting the changes I recommend removing the NightBot application from https://nightbot.tv/account/applications ('My Apps' > red delete button) and deleting the folder where you installed this program, and then repeating the instructions in the README again from scratch. I have pushed the code changes to main so they should be available for everyone already.


Thank you once again for your patience and for your continued support of my programs. Please feel free to contact me if you have any other issues, questions or feature requests.

Best of luck for your streaming journey!