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 in function login: Forbidden #272

Open
tmwebb2 opened this issue Aug 4, 2021 · 87 comments
Open

Error in function login: Forbidden #272

tmwebb2 opened this issue Aug 4, 2021 · 87 comments

Comments

@tmwebb2
Copy link

tmwebb2 commented Aug 4, 2021

I ma getting the error below. I allowed a Microsoft update and rebooted the laptop. Happens on my desktop and laptop.

C:\locast2plex>python3 main.py
Initiating Locast2Plex v0.6.5
Opening and Verifying Configuration File.
C:\locast2plex\config\config.ini
C:\locast2plex\config.ini
Loading Configuration File: C:\locast2plex\config.ini
Tuner count set to 3
Server is set to run on 127.0.0.1:6077
UUID set to: zkqzpils...
Getting user location...
Getting location via IP Address.
Got external IP 99.64.87.111.
Got location as Atlanta - DMA 524 - Lat\Lon 34.0663-84.6784
Logging into Locast using username notmyreal@comcast.net...
Error in function login: Forbidden
Invalid Locast Login Credentials. Exiting...

@rqbanerjee
Copy link

I am also seeing this, starting today. docker on a Synology NAS (Linux). I can use the same credentials to log into the website. Maybe Locast did a bad deployment, or changed their API endpoint for logins?

@jg-24
Copy link

jg-24 commented Aug 4, 2021

Locast apparently started enforcing a captcha implemented with Google ReCaptcha.

@seakurt
Copy link

seakurt commented Aug 4, 2021

Same issue after restarting. Windows 10.

@jg-24
Copy link

jg-24 commented Aug 4, 2021

For the developers: try using a hardcoded client ID and captcha in the locast api calls. The ID is currently hardcoded in website static objects so it may change and the captcha appears have just been added as a required field but is not being enforced/checked yet (so it will certainly change). Kudos to other developers for figuring this out so quickly...

https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D

credentials = {
"username": username,
"password": password,
"captcha": "anything"
}

@purduepete
Copy link

For the developers: try using a hardcoded client ID and captcha in the locast api calls. The ID is currently hardcoded in website static objects so it may change and the captcha appears have just been added as a required field but is not being enforced/checked yet (so it will certainly change). Kudos to other developers for figuring this out so quickly...

https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D

credentials = {
"username": username,
"password": password,
"captcha": "anything"
}

This worked for me. I altered line 55, of the file, lib/locast_service.py to match the above (see below code snippet)

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

Thank you jg-24.

@tmwebb2
Copy link
Author

tmwebb2 commented Aug 4, 2021

This worked for me as well. Thank you all for jumping on this so quickly.

@seakurt
Copy link

seakurt commented Aug 4, 2021

Worked here too! Thank you soooooo much!

@SVRapture
Copy link

SVRapture commented Aug 4, 2021

I hate to be so stupid (I know I am missing something). I am running locast2plex on a Windows10 box. I made the change above to the locast_service.py file but it still would not work. So I hard coded my username in the locast.service.py file and it is still using the one in my config.ini file. Clearly it is not using the changed .py file. Do I need to compile it or something?

I discovered my error - I had to change the link as well as add the captcha.

Thank you for the quick work!

@jwarner75
Copy link

I am having this very same issue.

I have 2 machines, 1 a Quad Core running Locast2plex and 1 8 Core running Locast2plex both connected to the network and I just had this issue. Both of them are not wanting to connect.

I even made the changes to the file as suggested above and it's not helping either.

Some help would be appreciated to help me get up and running!

Thanks!

@mazinkhu
Copy link

mazinkhu commented Aug 4, 2021

Can someone please advice where do you find the file locast_service.py, when using locast2plex as docker container in Synology NAS.

@Nbr1Sniper
Copy link

For the developers: try using a hardcoded client ID and captcha in the locast api calls. The ID is currently hardcoded in website static objects so it may change and the captcha appears have just been added as a required field but is not being enforced/checked yet (so it will certainly change). Kudos to other developers for figuring this out so quickly...
https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D
credentials = {
"username": username,
"password": password,
"captcha": "anything"
}

This worked for me. I altered line 55, of the file, lib/locast_service.py to match the above (see below code snippet)

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

Thank you jg-24.

THANK YOU!!! If anyone can't find the file its in locast2plex\lib and named: locast_service

@jwarner75
Copy link

For the developers: try using a hardcoded client ID and captcha in the locast api calls. The ID is currently hardcoded in website static objects so it may change and the captcha appears have just been added as a required field but is not being enforced/checked yet (so it will certainly change). Kudos to other developers for figuring this out so quickly...
https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D
credentials = {
"username": username,
"password": password,
"captcha": "anything"
}

This worked for me. I altered line 55, of the file, lib/locast_service.py to match the above (see below code snippet)
loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D', ('{"username":"' + username + '","password":"' + password + '", "captcha": "anything"}').encode("utf-8"), {'Content-Type': 'application/json', 'User-agent': self.DEFAULT_USER_AGENT})
Thank you jg-24.

THANK YOU!!! If anyone can't find the file its in locast2plex\lib and named: locast_service

I found the file. And I made the change just like that.

I'll list it below to show my modification.

      loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login',
                                         ('{"username":"' + username + '","password":"' + password + '", "captcha": "anything"}').encode("utf-8"),
                                         {'Content-Type': 'application/json', 'User-agent': self.DEFAULT_USER_AGENT})

I just added it in, I didn't copy the code from here and copied it over.

@jwarner75
Copy link

Ok, I just figured it out, it took me a Minute.

For anyone NEEDING Help with this.

Copy and paste this Code OVER The other one.

  ```

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

You WILL Need to Add in the top (https://api.locastnet.org/api/user/login?client_id=CqhAMsBw%2BnxTXSJMLGqyOw%3D%3D) This will get copied over top of the line that says (loginReq = urllib.request.Request('https://api.locastnet.org/api/user/login',) and replaced with the one above.

And then "captcha": "anything" will be added as well.

I included the corrections in the code above.

@jwarner75
Copy link

Ok, Last comment lol.

I'm SOOO Very new to this...

But I "Forked" the file. Made changes to the Locast file as directed above with the changes. Then I uploaded the file with the changes.

So I think all you got to do is download the amended files, copy over existing one (Except for the Config.ini), you'll wanna make a copy of that so you don't over right the info and have to enter it all again. Then copy it over.
Screenshot 2021-08-04 181819

Here is a Screen Shot of the changes made from the file.

@joerich
Copy link

joerich commented Aug 5, 2021

purduepete

Thank you so much! your fix worked perfectly!

@bulfinch
Copy link

bulfinch commented Aug 5, 2021

Any advice for us non developer types running this in docker on synology?

@ratherDashing
Copy link
Contributor

@bulfinch
I fixed it in the official docker container by doing this:
docker cp locast2plex:/app/lib/locast_service.py .
then edit the file with the code above then copied it back
docker cp locast_service.py locast2plex:/app/lib/
then restarted the container. make sure the indentation matches up with the previous code (which I just commented out) as python cares about that stuff.

@jaimelalone
Copy link

Thanks all for the fix. Best to simply copy pasta!

@LLCoolWas
Copy link

Is this still working for those of you that applied the change? I tried editing in the client_id into my docker container's files, but it and copying the locast_service.py file from @jwarner75 but it is still giving me an invalid creds error since the update.

@jwarner75
Copy link

@LLCoolWas Wish I could help you with this issue. I don't know anything about Docker Containers.

I WAS going to install Docker if I couldn't get Python to work when I originally started having some issues with it. It just took me getting away from it for a little while.

I wish I knew MORE about python and the programming.

it took me a few minutes to fix the issue i was having with the Client ID that someone else figured out to get it working. it turned out i was missing a line.

Once i figured it out, I just saved it and I forked the codes and saved the change to the file and uploaded it to the forked files that way someone could just download the updated file, copy over top and should be able to get it to work.

I didn't think about the Docker, Someone else would probably be better to assist you on that that is more knowledgeable about it than me.

@jwarner75
Copy link

@LLCoolWas it looks like @ratherDashing has a fix for it, Check out his method in the post comments

@mazinkhu
Copy link

mazinkhu commented Aug 5, 2021

Hi,
Thank you everyone for the help. For those of you who are new to all this like me. Just some detailed steps of how I accessed the files. I am using the Synology NAS DS220+, and do not have a software background.

FYI: I used the container from Synology Docker registry as shown below:
a1

step1: You will need to access a ssh terminal, to use the docker cp commands.
step 2: You will need to know the name of the container for you installation. This can be done by clicking the "Edit" tab under the docker container.
i2

step 3: In the ssh terminal window, you will issue the docker cp command to copy the file.Please make sure you use the container name from step2 for the "docker cp" command.(you will need to be root for all the commands below)
docker cp tgorg-locast2plex1:/app/lib/locast_service.py .
You can then use the ls command as shown below, to see if the file get copied.

i3

Step 4: Modify the copied file, as indicated in the forum.
Step 5: Copy back the file to the docker container.

cp locast_service.py tgorg-locast2plex1:/app/lib/locast_service.py

@tgorgdotcom
Copy link
Owner

Hello all. Thanks for all your work into figuring this out. Let me see if I can integrate the changes to a new version.

@jwarner75
Copy link

@tgorgdotcom I'm no expert on writing scripts, I forked the files and I made changes to the file that was needed and saved it, I wasn't sure if i could upload to your files or not so I just forked, made changes and uploaded it.

@rkendry
Copy link

rkendry commented Aug 5, 2021

I use Unraid and I cannot figure out where the files are stored to modify the locast_service.py. i might need to just wait for an update to the docker image.

@patrick-GH
Copy link

I use Unraid and I cannot figure out where the files are stored to modify the locast_service.py. i might need to just wait for an update to the docker image.

You have to pull the file out of the container then add it back in. I'm no expert either, but will take a look tonight

@drewwats
Copy link

drewwats commented Aug 5, 2021

This fix did not work for me. Latest locast2plex image, Docker container on Synology.

@mazinkhu
Copy link

mazinkhu commented Aug 5, 2021

Can you please post your modifications, as I have had no problems. Please make sure the indentation does not change for the lines modified. Below are my modifications, I commented out the old lines and matched the original indentation.
Capture

@wouterdebie
Copy link

Modify the code to use this client_id 9qXBrVzpTjUZmVGsZRnnWQ-7GvGeJ48QWtV9v+bsen4=

Would you mind sharing how you got that ID? I tried figuring out how the android app sent it, but had no luck sniffing traffic with a proxy. I didn't get lucky with trying to get it from decompiling some sources.

@tgorgdotcom
Copy link
Owner

Hello @wouterdebie, you can get a new client ID by registering on https://www.locast.org/developers/apply. I'm working on getting one myself. If it's all right with everyone, I'll use the one @cklinker made for now...

The downside to registering is the potential of having to remove location override features from our scripts/apps (per the dev agreement). I think Locast support has been pretty good dealing with users in the past when they ask them to fix geolocation issues, so the workaround may be to redirect users to Locast when the detected location is wrong.

@tgorgdotcom
Copy link
Owner

Hello all. 0.6.7 includes @cklinker's client ID temporarily. This is live on GitHub and in docker

@craigarno
Copy link

Hello all. 0.6.7 includes @cklinker's client ID temporarily. This is live on GitHub and in docker

Yeah, it wasn't clear if each instance of Locast2Plex had to have its own ClientID, or if the ClientID belonged to the Locast2Plex Application. So far I'm assuming the later and also updated my running instance to use @cklinker 's provided ClientID (Thank you). If this is wrong, I suspect we'll hear about it.

My thinking is it wouldn't make sense that every user would have to sign up as a developer to obtain a ClientID. It makes much more sense that a single ClientID would be for deployment of the Developer's Application, in this case, Locast2Plex.

@cklinker
Copy link

Modify the code to use this client_id 9qXBrVzpTjUZmVGsZRnnWQ-7GvGeJ48QWtV9v+bsen4=

Would you mind sharing how you got that ID? I tried figuring out how the android app sent it, but had no luck sniffing traffic with a proxy. I didn't get lucky with trying to get it from decompiling some sources.

I created the Locast API. I have approved the requests for a client id as well and provided the client id I sent in this channel for all requests as well.

@jwarner75
Copy link

Hello @wouterdebie, you can get a new client ID by registering on https://www.locast.org/developers/apply. I'm working on getting one myself. If it's all right with everyone, I'll use the one @cklinker made for now...

The downside to registering is the potential of having to remove location override features from our scripts/apps (per the dev agreement). I think Locast support has been pretty good dealing with users in the past when they ask them to fix geolocation issues, so the workaround may be to redirect users to Locast when the detected location is wrong.

I just applied for a Client ID, Any Idea how long it takes to get approved?

For now I'm using the one that a member created just to keep my Recordings going I have set. Once mine comes in I'll edit the file and add my personal one in.

@mikesul76
Copy link

Many thanks to all who keep this working with the changes being made by Locast regarding login. Having a 'software based' DVR tuner that gives me whole house access and remote access (plex server is on 24/7 in my Locast location) is totally awesome! Who the heck wants to buy yet another piece of hardware for a DVR when we have this. THANK YOU!

@Ned-Racine
Copy link

Ditto to mikesul76! Much appreciations to all....

@mikedizzle
Copy link

Yes @mikesul76! This is awesome for those of us who don't have the chops to pull of emulating this function!

@jwarner75
Copy link

I applied for a Client_ID so I'd have one myself. I finally got it day before yesterday i believe it was.

Not sure if I did it wrong or what, But when I changed the Information where it needed to be changed. I ended up with an error, it wouldn't work.

Any Idea why that might be?

@jwarner75
Copy link

Modify the code to use this client_id 9qXBrVzpTjUZmVGsZRnnWQ-7GvGeJ48QWtV9v+bsen4=

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

@cklinker This is the very SAME Client_ID that was given to me when I signed up for one.

I tried this ID and my Script would NOT Run, kept getting failed log in attempts, so had to go back to the other one. Well the top one ending in +bsen4=. Not sure why it wasn't working.

@cklinker
Copy link

Modify the code to use this client_id 9qXBrVzpTjUZmVGsZRnnWQ-7GvGeJ48QWtV9v+bsen4=

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

@cklinker This is the very SAME Client_ID that was given to me when I signed up for one.

I tried this ID and my Script would NOT Run, kept getting failed log in attempts, so had to go back to the other one. Well the top one ending in +bsen4=. Not sure why it wasn't working.

The actual client_id you were provided is not url Encoded to be sent in the request. When I approved all these requests for locast2plex I provided the same client id for all users.

@jwarner75
Copy link

@cklinker Oh ok. I had to go back to using the one you provided in the code. I don't know anything about th eprogramming, I just follow the instructions and edit the files, copy and paste with Notepad++, at least that's what I use for my Raspberry Pi when editing some files.

@mikesul76
Copy link

A 93-year old judge made a ruling in a New York court today...
Honest to goodness, you have got to be kidding me, a 93-year old !!

He ruled "Error in function login: Forbidden" Very sad, very very sad.

@Nbr1Sniper
Copy link

Hopefully the ruling won’t effect those who already have access to Locast… It will however hurt expanding the service. They will need to apply for loans and hope they can get enough people to donate to pay it back in order to expand the service.

@chriselgee
Copy link

Well, looks like I'm not alone in getting this )-:

Error in function login: Forbidden
Invalid Locast Login Credentials. Exiting...

@mikesul76
Copy link

@chriselgee Ensure you have the latest version (v0.6.7) for this to work.

@chriselgee
Copy link

Ah - that was it! Thanks @mikesul76 . (-: docker pull...

@Nbr1Sniper
Copy link

Guess it doesn’t matter. Locast has shutdown

@jaimelalone
Copy link

Guess it doesn’t matter. Locast has shutdown

Yeah, I just got that email as well. Was going to link to a press release but the site hadn't been updated yet.

@Nbr1Sniper
Copy link

I got one yesterday saying no more donation requests then this morning saying immediately suspending all services. Nothing works and their site says 0 markets. Ugh!!!!!!! I used locast as a backup to my Tablo as my antenna goes out during lightning storms.

@ratherDashing
Copy link
Contributor

I got one yesterday saying no more donation requests then this morning saying immediately suspending all services. Nothing works and their site says 0 markets. Ugh!!!!!!! I used locast as a backup to my Tablo as my antenna goes out during lightning storms.

darn!

@ghost
Copy link

ghost commented Sep 2, 2021

I wish they would explain a bit more here. Should we shut our donations down? Are they dead-dead now?

@ratherDashing
Copy link
Contributor

I wish they would explain a bit more here. Should we shut our donations down? Are they dead-dead now?

i turned off my donations, they stopped providing their service, i stopped donating

@Nbr1Sniper
Copy link

I wish they would explain a bit more here. Should we shut our donations down? Are they dead-dead now?

i turned off my donations, they stopped providing their service, i stopped donating

Don’t blame you. I was about to start donating as I had just started using them. It’s all very confusing.
Now looking at just getting another tuner that I can use with plex.

@patrick-GH
Copy link

patrick-GH commented Sep 2, 2021 via email

@Nbr1Sniper
Copy link

More info here https://youtu.be/SI0lF3fJIXY

@ghost
Copy link

ghost commented Sep 2, 2021

Curious, what are other people thinking of falling back to? I've used Playon to record off the internet, but this doesn't help with local stations....

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