Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kodi scrobbling - auth difficulties #66

Closed
DSolimano opened this issue Feb 24, 2025 · 8 comments
Closed

Kodi scrobbling - auth difficulties #66

DSolimano opened this issue Feb 24, 2025 · 8 comments

Comments

@DSolimano
Copy link

I'm attempting to use the Kodi libre.fm scrobbling plugin. It worked successfully in the past (up until about five months ago I can confirm), then I took a break from using it and restarted my usage on Sunday Feb 23. Fairly confident I have my username and password entered correctly from my password manager. I tried updating my password both in libre.fm and Kodi which did not help.

I was going to open a support request on Kodi but decided to take some Wireshark traces first (which Github won't let me attach), and was surprised to see a 403 coming back from the auth attempt. I decided to copy the auth attempt URL into Firefox and, 200, success! That suggests to me that, the Kodi plugin is making a correct request, but libre.fm doesn't like it for some reason?

Comparing the two traces, the only thing that seems to differ is the HTTP options (User-Agent, Connection: keep-alive vs close, etc). Might this be something on the libre.fm side causing an issue, or perhaps I need to go get the plugin fixed to do HTTP a little differently?

Image
Image
Image

Please let me know if there's any additional information I can provide, or anything I can do to debug further. I'm a dev in my day job so I've got no objections to a homework assignment.

@mattl
Copy link
Member

mattl commented Feb 24, 2025

Is your Kodi server on a VPN of some kind?

@DSolimano
Copy link
Author

No, both on residential Verizon fiber in the US, same Windows 10 box in fact.

I do apologize but I have a work event that's going be keeping me busy for the next week so my responses may be slow until the 5th or so if you want me to run code / traces / etc, was going to wait until I got back to report the issue but didn't want to forget the investigation I had made so far.

@mattl
Copy link
Member

mattl commented Feb 24, 2025

I'll have a look at setting up Kodi here and see if I can reproduce an error.

@DSolimano
Copy link
Author

Ok, been debugging and I have a bit of a wild-*** guess of a theory as to what's going on here. I noticed that on failure, I have an HTTP header set: "cf-mitigated: challenge"

Googling that points to some kind of Cloudflare firewall being unhappy, perhaps the Cloudflare Turnstile technology, e.g. https://www.answeroverflow.com/m/1229026214224859187. Basically, it would suggest either my IP has done bad things (possible since I'm sitting on Verizon FIOS and it's shared with a thousand other bozos, but I'm guessing not since it works from browser), or I'm triggering some kind of firewall rule when Kodi calls out from the python script it uses for submissions, but the rule is happy when it sees the request is coming from a browser.

So, is turtle.libre.fm protected by Cloudflare by any chance? Looking at the returned IPv4 and IPv6, it looks like the answer is yes based on the public Cloudflare IPs at https://www.cloudflare.com/ips/. And if so, maybe a firewall rule needs a tweak?

@mattl
Copy link
Member

mattl commented Mar 12, 2025

Yes it is... I can go into all the reasons later..

Can you curl https://turtle.libre.fm from the machine in question?

If you see some HTML about hosts files, you're all good. If you see some Cloudflare-specific stuff, you're not.

Sorry, 1am brain.... see if you can do something like a curl in Python? Off the top of my head, I think Requests is the Python thing for that?

Email me your IP address if you like too.

@DSolimano
Copy link
Author

Curl looks pretty unhappy - I'm getting a big old HTML page asking me to enable javascript and cookies to complete a challenge (attached). so I'm well and truly toasted. I'll try to repeat from Python but guessing it'll be a similar result.

IP's no secret, what's my IP gives 173.50.163.218 as my public IPv4.

curl results.txt

@DSolimano
Copy link
Author

Just thinking, is there another client you know of that's successfully using the API, I can dig into that code and see what it's doing?

@mattl
Copy link
Member

mattl commented Mar 25, 2025

zomg is my favorite basic client.

https://packages.debian.org/bookworm/zomg

It was created by one of the early Libre.fm developers

@foocorp foocorp locked and limited conversation to collaborators Mar 28, 2025
@mattl mattl converted this issue into discussion #80 Mar 28, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants