Error logging in to Locast
Anyone else getting a "Error in function login: Not Found" when starting up locast2plex?
It just started happening out of the blue last night. I tried other locast user id's, different computers with same result. The id's work when I sign into locast.org and watch over the web.
Confirmed over here in Chicago area.... Same exact issue. Error would be in the login function of LocastService.py
¦ loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login',
¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ('{"username":"' + username + '","password":"' + password + '"}').encode("utf-8"),
¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ {'Content-Type': 'application/json'})
¦ loginOpn = urllib.request.urlopen(loginReq)
¦ loginRes = json.load(loginOpn)
¦ loginOpn.close()
I'm guessing something changed or got blocked.... need to go to the 925 now but will inspect a bit more tonight if noone else fixes it first.
Same issue here in the Denver area.. I woke up this morning and it showed "Max Streams" and I wasnt using any streams. Restarted the container and got the above error. Error in function login: Not Found. I also will dig more tonight, once I finish my day job :)
Same issue in DC area.
Same in Seattle. My guess is it may be something on the locast side with how they're handling logins
Hi All, I guess I picked the wrong day to start trying to use locast2plex. When I am running container in docker, it keeps on doing the error in function login: not found. Here in Detroit.
I just checked (New York DMA 501) and see the same thing.
Alright! I think we can safely say this is not isolated to a specific Metro Area! I'll bet money on it's what @dwkane Said.... Locast changed the login page/method something!
Yes def in below: Locast changed something....
loginOpn = urllib.request.urlopen(loginReq) loginRes = json.load(loginOpn) loginOpn.close()
Hmmm, that's odd. I just simulated a login request to Locast in Chrome and it seemed to work okay. I was using it as late as 12 am last night without issues. I'll try to look into it further tonight. Definitely let us know if you find anything on your end, and thanks in advance!
https://api.locastnet.org/ is returning 503 Temporarily Unavailable while https://api.locastnet.org/api/user/login is returning 405 Method not allowed. It seems to be on there end, but hopefully something that opens back up soon.
Yep same Dallas just started this morning, tried retrograding to older version same errors. I am certain it is a Friday the 13th thing! ;-)
Yep. I'm having the same problem in Los Angeles.
Same issue in NYC market
Same here in Boston market I can log in on chrome but cant get it to connect in the script.
also having issues, this morning it was logged in but complaining about multiple streams. i just have locast2plex running, no other streams. so i restarted the container and now it won't log in
Issues in Seattle too. Spent the last hour troubleshooting it. Seamed to stop working before 5am PST
https://api.locastnet.org/ is returning 503 Temporarily Unavailable while https://api.locastnet.org/api/user/login is returning 405 Method not allowed. It seems to be on there end, but hopefully something that opens back up soon.
You cant open the login like that in a browser, you have to do it as a Post request. which appears to work fine, when I captured and replayed it in Burp
Glad I checked here. Time to put my OTA to use.
so changing the header line in the LocastService.py file will fix the login, don't ask me why. Something in the URLLIB library is demanding a User-Agent header apparently. change {'Content-Type': 'application/json'} to {'Content-Type': 'application/json','User-agent':'Mozilla/5.0'}
well that aleast let my Docker container launch and get logged in, now to try and make it work with Plex :)
@Above2 Excellent find! If anyone else can confirm as well, I'll try to add the line to the code and push it right away.
Awesome catch Above2. I have confirmed that fixes the issue for me. Thank you!
@tgorgdotcom I just copied the file out of the docker, made the change, and copied back in.. it works now.
Changing the header line in the LocastService.py worked and allowed me to start the service. Now the issue is that I get an error saying Ive reached the maximum number of streams. I can play streams fine from the Locast website, just not on Plex.
@Above2's change is applied. I wonder if I have to include it when accessing the stream.
Wish it worked for me. I changed first instance of {'Content-Type': 'application/json'} in LocastService.py and also every instance, each time reset, and still get the same error in docker ( my email is changed below for this purpose,, and yes i am paid sub)-
locast2plex_1 | UUID set to: zppsizol... locast2plex_1 | Logging into Locast using username [email protected]... locast2plex_1 | Error in function login: Not Found locast2plex_1 | Exiting... locast2plex-master_locast2plex_1 exited with code 0
I am getting the "You have reached the maximum number of active streams for this account" too with Plex...
@Above2's change is applied. I wonder if I have to include it when accessing the stream.
I'm guessing if the call is in multiple places you might, I was able to start the container, and add it to plex. But It cant start a stream for me. Not sure if its the same error or not.
For those of you who can, please try this:
On line 127 of main.py, update to the following:
ffmpeg_proc = subprocess.Popen(["ffmpeg", "-i", channelUri, "-user_agent", "'Mozilla/5.0'", "-codec", "copy", "-f", "mpegts", "pipe:1"], stdout=subprocess.PIPE)
Sorry I'm still technically at work or I would be testing this myself.
I made that change to main.py but Im still getting the reached maximum connections error.
In 4.2 I made the "{'Content-Type': 'application/json','User-agent':'Mozilla/5.0'}" change within LocastService.py, but only in the def login. I also made the ffmpeg_proc change within main.py.
I rebooted and Plex still indicates I'm already using 4 instances.