Skip to content
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

Error logging in to Locast #128

Open
rottdog32 opened this issue Nov 13, 2020 · 163 comments
Open

Error logging in to Locast #128

rottdog32 opened this issue Nov 13, 2020 · 163 comments

Comments

@rottdog32
Copy link

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.

@paradxum
Copy link

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.

@numchucksoe
Copy link

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

@daneric2020
Copy link

Same issue in DC area.

@dwkane
Copy link

dwkane commented Nov 13, 2020

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

@toadman50
Copy link

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.

@CTJohnK
Copy link

CTJohnK commented Nov 13, 2020

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

@paradxum
Copy link

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!

@rottdog32
Copy link
Author

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

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

@tgorgdotcom
Copy link
Owner

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!

@dnixon1981
Copy link

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.

@libersongm
Copy link

libersongm commented Nov 13, 2020

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

@begunfx
Copy link

begunfx commented Nov 13, 2020

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

@zcquist
Copy link

zcquist commented Nov 13, 2020

Same issue in NYC market

@Oumpa31
Copy link

Oumpa31 commented Nov 13, 2020

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

@ratherDashing
Copy link
Contributor

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

@patrick-GH
Copy link

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

@Above2
Copy link

Above2 commented Nov 13, 2020

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

@MervisDiamonds
Copy link

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

@Above2
Copy link

Above2 commented Nov 13, 2020

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

@tgorgdotcom
Copy link
Owner

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

@rottdog32
Copy link
Author

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

@yaroz
Copy link

yaroz commented Nov 13, 2020

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

@JimSpeedo
Copy link

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.

@tgorgdotcom
Copy link
Owner

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

@toadman50
Copy link

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

@rottdog32
Copy link
Author

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

@Above2
Copy link

Above2 commented Nov 13, 2020

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

@tgorgdotcom
Copy link
Owner

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.

@JimSpeedo
Copy link

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

@tgorgdotcom
Copy link
Owner

@dscisci Try pulling the latest version to see if that fixes things.

@jbruett
Copy link

jbruett commented Nov 26, 2020

@tgorgdotcom, I just spun up the latest container and it's still failing (I've tokened out personal info, but the values are accurate and I've checked my creds against locast.org directly and they're working)

2020-11-26T19:06:26.633034855Z Initiating Locast2Plex v0.6.1
2020-11-26T19:06:26.633104260Z Opening and Verifying Configuration File.
2020-11-26T19:06:26.633121550Z /app/config/config.ini
2020-11-26T19:06:26.633133828Z Loading Configuration File: /app/config/config.ini
2020-11-26T19:06:26.633145826Z Tuner count set to 3
2020-11-26T19:06:26.633160144Z Server is set to run on  192.168.20.60:6077
2020-11-26T19:06:26.633180922Z No UUID found.  Generating one now...
2020-11-26T19:06:26.633193240Z UUID set to: <my-uuid>...
2020-11-26T19:06:26.633204631Z Getting user location...
2020-11-26T19:06:26.633215772Z Getting location via IP Address.
2020-11-26T19:06:26.633227253Z Got external IP <my-public-ip>.
2020-11-26T19:06:26.633238690Z Got location as Philadelphia - DMA <my-dma-code> - Lat\Lon <myl-lat>\<my-long>
2020-11-26T19:06:26.633273370Z Logging into Locast using username <my-email>...
2020-11-26T19:06:26.633286375Z Error in function login: Not Found
2020-11-26T19:06:26.633297746Z Invalid Locast Login Credentials. Exiting...

@tgorgdotcom
Copy link
Owner

@jbruett I wonder if this is related to #142. I did push another update for that (0.6.2).

@dscisci
Copy link

dscisci commented Nov 27, 2020

@dscisci Try pulling the latest version to see if that fixes things.

It worked Thomas, thanks! Happy Thanksgiving

@jbruett
Copy link

jbruett commented Nov 29, 2020

Sorry @tgorgdotcom, still not working for me with the 0.6.2 release, same error as above with both the container and the repo. Also for what it's worth my current password is 12 char long with no special characters (I changed it to ensure that #142 wasn't the issue I was hitting while testing on Thursday.

@jbruett
Copy link

jbruett commented Dec 8, 2020

I've been testing a bit more...using the Rest Client plugin for VS Code I passed the following:

POST https://api.locastnet.org/api/user/login
username: <myemail>
password: <mypasswd>
Content-Type: application/json
User-Agent: Mozilla/5.0

And received the following response:

HTTP/1.1 500 Internal Server Error
Date: Tue, 08 Dec 2020 01:57:43 GMT
Content-Type: application/json
Content-Length: 110
Connection: close
Cache-Control: no-cache, no-transform

{
  "code": 500,
  "message": "There was an error processing your request. It has been logged (ID cd014481c021296b)."
}

I attempted to log a ticket with locast directly to find out more about that error ID and got a laughable auto response and ticket closure within a 90 seconds of the ticket being opened.

@fishtek
Copy link

fishtek commented Dec 11, 2020

Hey guys just found out about locast today. Looks like a great project but I did run into the error that the OP had. However I think the way it is coded could be masking a few different login errors as the same top level error in the log file.

In my case I have two plex servers one is here in the states (midwest) and I was able to supply the override_zipcode flag with a zipcode for the denver DMA 751 and all was good. Everything fired up and connected and I was able to stream channels.

However I have another server that isn't in the US and I tried the exact same thing w/ the zipcode override and the Denver DMA 751 seems ok from the location in the log, however during the authentication portion I hit the above error the OP had.

I set a break point and inspected the return i'm getting and it turns out i'm getting a 204 (no content), so there is nothing to use for the login. I thought perhaps they moved it to the headers but I don't see anything there either.

Hopefully someone with more experience with this knows what we can do from here? I can test stuff out if anyone has any ideas and here is my debug session in case it is helpful for people:

Getting user location...
Getting location via provided zipcode 80209
Got location as Denver - DMA 751 - Lat\Lon 39.70658\-104.96575
Logging into Locast using username [email protected]...
> /home/tek/dev/locast2plex/lib/locast_service.py(62)login()
-> loginRes = json.load(loginOpn)
(Pdb) l 
57                                               {'Content-Type': 'application/json', 'User-agent': self.DEFAULT_USER_AGENT}) 
58 
59             loginOpn = urllib.request.urlopen(loginReq) 
60             import pdb; pdb.set_trace() 
61 
62  ->         loginRes = json.load(loginOpn) 
63             loginOpn.close() 
64 
65             self.current_token = loginRes["token"] 
66             return True 
67
(Pdb) loginOpn.status
204
(Pdb) loginOpn.headers.as_string()
'Date: Thu, 10 Dec 2020 16:25:39 GMT\nConnection: close\nCache-Control: no-cache, no-transform\n\n'
(Pdb) loginOpn.read()
b''
(Pdb)

@pb1051
Copy link

pb1051 commented Jan 6, 2021

2020-11-26T19:06:26.633286375Z Error in function login: Not Found

I'm getting a similar error, but it is this:

Error in function login: Expecting value: line 1 column 1 (char 0),
Invalid Locast Login Credentials. Exiting...,

@dgarozzo
Copy link

Lots of comments here, but it seems like this is still a problem. Is anybody able to successfully use this? I, too, am getting the "Error in function login: Not Found" error.

@craigarno
Copy link

I'm using the latest 0.6.5 which worked until yesterday. I tried my Roku units and Locast had changed login requirements to require "activation" and software upgrades to limit use of their services to 7 user accounts, which broke everything, including Locast2Plex.

I sent a support ticket, explaining Roku (something they do support) was broken. I also mentioned their timing is horrible since PNW is experiencing a record heatwave and we need access to local news. Once I finally got my 3 Roku units "activated", Locast2Plex started working again too. I'm in the Greater Seattle area. 0.6.5 is working, I'm not sure why, and wondering when Locast might break it again.

@CTJohnK
Copy link

CTJohnK commented Jun 29, 2021

I'm in Connecticut and have recordings on Plex via Locast2Plex from throughout the day. I just checked a few of them and they all recorded without issue and I was just watching one of the local channels via Locast2Plex on Plex.

@patrick-GH
Copy link

In the Seattle area too, but not having any issues. Just checked a recording from earlier today. I only really use it through plex or roku.

@dgarozzo
Copy link

dgarozzo commented Jun 30, 2021 via email

@drewwats
Copy link

drewwats commented Aug 5, 2021

Similar issue just started for me (restarted container for first time in a few weeks). I'm running latest version locast2plex in Docker on a Synology. I have not changed anything on my end, it had been working for almost a year without intervention.

I have verified that the same creds in my docker-compose work to log in on the Locast site, no issues there. I've also deleted the container and image and rebuilt, to no avail.

Anyone else seeing the same?

Logging into Locast using username [email protected]...
Error in function login: Forbidden
Invalid Locast Login Credentials. Exiting...

@GRSmithIA
Copy link

Just trying to start this up for the first time. Running in a command window and Python 3.9 on a windows 10 machine. I get the same Forbidden error and invalid locast login credentials. Also can use log in web browser to log in so values are not the issue.

@vjlabbott
Copy link

Same here - setting up locast 2 plex for the first time in the past hour. getting credentials error but have validated login id and password works from browser

@drewwats
Copy link

drewwats commented Aug 5, 2021

@tgorgdotcom, do you know what has caused this, or if there's a workaround?

@vjlabbott
Copy link

vjlabbott commented Aug 5, 2021 via email

@drewwats
Copy link

drewwats commented Aug 5, 2021

Nope - I suspect a change in some setting at locast. I don’t write python so I don’t have the skill set to fix. Guess I will be watching tv tonight over the air. Valerie

On Aug 5, 2021, at 1:58 PM, drewwats @.***> wrote:  @tgorgdotcom, do you know what has caused this, or if there's a workaround? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

I suspect the same. The locast2plex image hasn't changed in 6 months and my configuration hasn't either. Since it appears to be a common issue recently, an update on Locast's side is the most likely cause.

@patrick-GH
Copy link

there's another thread that locast just started implementing captcha. I screwed up trying to create a duplicate container and over wrote my existing, so now it's not working :( I'll have to try and fix it later tonight.

#272

@tgorgdotcom
Copy link
Owner

tgorgdotcom commented Aug 5, 2021

Hello all (@drewwats, @vjlabbott, @GRSmithIA). Looks like a new issue has cropped up over the past couple days (see issue #272) I'm working to fix this latest issue. As for reports coming in from June 29th and prior, not sure what's going on.

@mark-in-dallas
Copy link

The issue cropped up for me today as well. When running python3 main.py this is the result I get:

Error in function login:
Exiting...

I then get the Rate Limit error when trying to login at locast.org. If I wait an hour then try to login again I am able do so, but if I try to run python3 main.py again I'm back to the Rate Limit error.

Tried this with 2 different locast accounts before finding this thread.

@drewwats
Copy link

drewwats commented Aug 5, 2021

I then get the Rate Limit error when trying to login at locast.org. If I wait an hour then try to login again I am able do so, but if I try to run python3 main.py again I'm back to the Rate Limit error.

Tried this with 2 different locast accounts before finding this thread.

Your issue could have been introduced in the same update but sounds a bit different since ours is saying valid creds are invalid. Do you already have throttling implemented on your side?

@drewwats
Copy link

drewwats commented Aug 5, 2021

#272

Hello all (@drewwats, @vjlabbott, @GRSmithIA). Looks like a new issue has cropped up over the past couple days (see issue #272) I'm working to fix this latest issue. As for reports coming in from June 29th and prior, not sure what's going on.

Interesting that it appears to be related to Captcha when I've never been prompted for Captcha on web login, but luckily that appears to be a pretty simple fix.

If it ends up being that simple, do you expect you'll be able to post new Docker image relatively quickly?

@mark-in-dallas
Copy link

Your issue could have been introduced in the same update but sounds a bit different since ours is saying valid creds are invalid. Do you already have throttling implemented on your side?

No, I don't have throttling implemented. I am using the basic locast2plex script on a Linux Mint machine, but running Emby instead of Plex.

I did go through the other "Error in Function login" thread and see people talking about modifying the locast_service.py file but that file doesn't appear to exist anywhere on my system, but do have a LocastService.py file.

@drewwats
Copy link

drewwats commented Aug 5, 2021

FWIW, the fix listed in the other thread did not work for me

@drewwats
Copy link

drewwats commented Aug 5, 2021

Your issue could have been introduced in the same update but sounds a bit different since ours is saying valid creds are invalid. Do you already have throttling implemented on your side?

No, I don't have throttling implemented. I am using the basic locast2plex script on a Linux Mint machine, but running Emby instead of Plex.

I did go through the other "Error in Function login" thread and see people talking about modifying the locast_service.py file but that file doesn't appear to exist anywhere on my system, but do have a LocastService.py file.

I'd look for the the loginReq definition inside LocastService.py, file could just be renamed...

@mark-in-dallas
Copy link

The code edit in the other thread (#272) worked perfect for me, and now I've got my locast2plex working again.

@drewwats
Copy link

drewwats commented Aug 6, 2021

Mine's good too now.

loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D', ('{"username":"' + username + '","password":"' + password + '","captcha":"locast2plex"}').encode("utf-8"), {'Content-Type': 'application/json', 'User-agent': self.DEFAULT_USER_AGENT})

@mlweber62
Copy link

mlweber62 commented Aug 6, 2021

Well, the code edit worked for a day, but now I'm back to getting the login error when trying to start locast2plex and Rate Limit when trying to login at locast.org.

My guess is that its the client_id in the api call, but I'm not tech savvy enough to actually figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests