locast2plex icon indicating copy to clipboard operation
locast2plex copied to clipboard

Error logging in to Locast

Open rottdog32 opened this issue 5 years ago • 163 comments

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.

rottdog32 avatar Nov 13 '20 12:11 rottdog32

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.

paradxum avatar Nov 13 '20 13:11 paradxum

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 :)

numchucksoe avatar Nov 13 '20 14:11 numchucksoe

Same issue in DC area.

daneric2020 avatar Nov 13 '20 14:11 daneric2020

Same in Seattle. My guess is it may be something on the locast side with how they're handling logins

dwkane avatar Nov 13 '20 14:11 dwkane

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.

toadman50 avatar Nov 13 '20 14:11 toadman50

I just checked (New York DMA 501) and see the same thing.

CTJohnK avatar Nov 13 '20 15:11 CTJohnK

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!

paradxum avatar Nov 13 '20 15:11 paradxum

Yes def in below: Locast changed something....

loginOpn = urllib.request.urlopen(loginReq) loginRes = json.load(loginOpn) loginOpn.close()

rottdog32 avatar Nov 13 '20 15:11 rottdog32

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!

tgorgdotcom avatar Nov 13 '20 15:11 tgorgdotcom

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.

dnixon1981 avatar Nov 13 '20 16:11 dnixon1981

Yep same Dallas just started this morning, tried retrograding to older version same errors. I am certain it is a Friday the 13th thing! ;-)

libersongm avatar Nov 13 '20 16:11 libersongm

Yep. I'm having the same problem in Los Angeles.

begunfx avatar Nov 13 '20 17:11 begunfx

Same issue in NYC market

zcquist avatar Nov 13 '20 17:11 zcquist

Same here in Boston market I can log in on chrome but cant get it to connect in the script.

Oumpa31 avatar Nov 13 '20 17:11 Oumpa31

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

ratherDashing avatar Nov 13 '20 18:11 ratherDashing

Issues in Seattle too. Spent the last hour troubleshooting it. Seamed to stop working before 5am PST

patrick-GH avatar Nov 13 '20 18:11 patrick-GH

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

Above2 avatar Nov 13 '20 18:11 Above2

Glad I checked here. Time to put my OTA to use.

MervisDiamonds avatar Nov 13 '20 19:11 MervisDiamonds

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 avatar Nov 13 '20 20:11 Above2

@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.

tgorgdotcom avatar Nov 13 '20 20:11 tgorgdotcom

Awesome catch Above2. I have confirmed that fixes the issue for me. Thank you!

rottdog32 avatar Nov 13 '20 20:11 rottdog32

@tgorgdotcom I just copied the file out of the docker, made the change, and copied back in.. it works now.

yaroz avatar Nov 13 '20 20:11 yaroz

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.

JimSpeedo avatar Nov 13 '20 21:11 JimSpeedo

@Above2's change is applied. I wonder if I have to include it when accessing the stream.

tgorgdotcom avatar Nov 13 '20 21:11 tgorgdotcom

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

toadman50 avatar Nov 13 '20 21:11 toadman50

I am getting the "You have reached the maximum number of active streams for this account" too with Plex...

rottdog32 avatar Nov 13 '20 21:11 rottdog32

@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.

Above2 avatar Nov 13 '20 21:11 Above2

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.

tgorgdotcom avatar Nov 13 '20 21:11 tgorgdotcom

I made that change to main.py but Im still getting the reached maximum connections error.

JimSpeedo avatar Nov 13 '20 21:11 JimSpeedo

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.

CTJohnK avatar Nov 13 '20 21:11 CTJohnK