observerss / pygodaddy

3rd Party Client Library for Manipulating Go Daddy DNS Records.
https://pygodaddy.readthedocs.org/
Other
37 stars 30 forks source link

CANNOT login to GoDaddy #17

Open iwanttobefreak opened 8 years ago

iwanttobefreak commented 8 years ago

Hello From several days ago I have this error: CANNOT login to GoDaddy

2015-12-14 17:57:53,680 Starting new HTTP connection (1): v4.ident.me 2015-12-14 17:57:54,753 My ip: x.x.x.x 2015-12-14 17:57:54,754 Starting new HTTPS connection (1): dns.godaddy.com 2015-12-14 17:57:55,597 Starting new HTTPS connection (1): idp.godaddy.com 2015-12-14 17:57:56,575 Starting new HTTPS connection (1): sso.godaddy.com 2015-12-14 17:57:58,243 Starting new HTTPS connection (1): mya.godaddy.com 2015-12-14 17:58:00,216 CANNOT login to GoDaddy

/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning

iwanttobefreak commented 8 years ago

Hello, I solve the warning of SSL, but I still can't login: 2015-12-18 11:05:13,718 CANNOT login to GoDaddy

Anyone more with this issue? Thanks!

ggogel commented 8 years ago

I'm getting this

2015-12-20 01:50:13,203 Starting new HTTPS connection (1): dns.godaddy.com 2015-12-20 01:50:14,250 Starting new HTTPS connection (1): idp.godaddy.com 2015-12-20 01:50:15,343 Starting new HTTPS connection (1): sso.godaddy.com 2015-12-20 01:50:16,587 Login routine broken, godaddy may have updated their login mechanism Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/pygodaddy/client.py", line 101, in login viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1) AttributeError: 'NoneType' object has no attribute 'group' 2015-12-20 01:50:16,589 Login failed!

I'm using the latest version of pygodaddy and python3.

With python2 I'm getting the same SSL warning. edit: BUT, finally it works again for me. So don't use python3 for now...

eXamadeus-zz commented 8 years ago

Same...

Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux

>>> client.login('<redacted>','<redacted>')
Login routine broken, godaddy may have updated their login mechanism
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/pygodaddy/client.py", line 101, in login
    viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
pickeld commented 8 years ago

Traceback (most recent call last): File "C:/Scripts/IpChange.py", line 7, in client.login(GODADDY_USERNAME, GODADDY_PASSWORD) File "C:\Python27\lib\site-packages\pygodaddy\client.py", line 99, in login r = self.session.get(self.default_url) File "C:\Python27\lib\site-packages\requests\sessions.py", line 480, in get return self.request('GET', url, _kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 468, in request resp = self.send(prep, _send_kwargs) File "C:\Python27\lib\site-packages\requests\sessions.py", line 597, in send history = [resp for resp in gen] if allow_redirects else [] File "C:\Python27\lib\site-packages\requests\sessions.py", line 195, in resolve_redirects _adapter_kwargs File "C:\Python27\lib\site-packages\requests\sessions.py", line 576, in send r = adapter.send(request, _kwargs) File "C:\Python27\lib\site-packages\requests\adapters.py", line 426, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host'))

ghost commented 8 years ago

@pickeld That's the first time I've seen the error "An existing connection was forcibly closed by the remote host" for this. Which version of PyGodaddy are you using?

armando-fandango commented 8 years ago

I am also getting the same error:

2016-02-02 14:11:32,259 Starting new HTTPS connection (1): dns.godaddy.com 2016-02-02 14:11:32,621 Starting new HTTPS connection (1): idp.godaddy.com 2016-02-02 14:11:33,861 Starting new HTTPS connection (1): sso.godaddy.com 2016-02-02 14:11:34,714 Login routine broken, godaddy may have updated their login mechanism Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygodaddy/client.py", line 101, in login viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1) AttributeError: 'NoneType' object has no attribute 'group'

jeffm1234 commented 8 years ago

I'm also getting that the login routine is broken. Any updates?

jiveman commented 8 years ago

Same issue ver 0.2.2 - python ver 2.7.6

iwanttobefreak commented 8 years ago

Hello Finally I founf the problem The login works, but doesn't work the check of the login. It searchs the line: id="menu-customer-name">(.*) And godaddy has changed the text.

In the file client.py change this line: self.logged_in = bool(re.compile(r'id="menu-customer-name">(.*)').search(html)) for: self.logged_in = bool(re.compile(r'Customer Number: ').search(html)) And it works

trkadi commented 8 years ago

Thanks cool! :+1:

hstubbs3 commented 8 years ago

Having problem still with login broken.

my client.py does not have line like r'id="menu-customer-name"

Have r'Welcome <span id="ctl00_lblUser ....

If helps using python 2.7 on CentOS 6.7 i686

iwanttobefreak commented 8 years ago

Maybe a diferent version of script.

When yo do the login:

Updated by Bryce Gough = URL is using AU for the region so maybe update this if you need another region.

    loginUri = 'https://sso.godaddy.com/v1/?path=%2Fdefault.aspx&app=mya&regionsite=au&marketid=en-AU'
    r = self.session.post(loginUri, data=data)
    return self.is_loggedin(r.text)

You can write the exit of the login page adding this line before the "return" line: print(r.text.encode('utf-8'))

You can see your login successful. Then find a string you want, for exemple id="menu-customer-name". Search test login function: def is_loggedin(self, html=None): """ Test login according to returned html, then set value to self.logged_in :param html: the html content returned by self.session.get/post :returns: True if there's welcome message, else False """ if html is None: html = self.session.get(self.default_url).text

I also changed the way it checks if you're logged in.

    self.logged_in = bool(re.compile(r'Customer Number: ').search(html))
    return self.logged_in

Change the line self.logged_in = bool(re.compile(r'Customer Number: ').search(html)) for the text you want, maybe your username if you want.

dark-vex commented 8 years ago

@iwanttobefreak Thanks a lot, your modification to client.py works for me!

2016-02-28 22:34:24,729 Starting new HTTP connection (1): ident.me 2016-02-28 22:34:24,856 My ip: XXX.XXX.XXX.XXX 2016-02-28 22:34:24,857 Starting new HTTPS connection (1): dns.godaddy.com 2016-02-28 22:34:25,658 Starting new HTTPS connection (1): idp.godaddy.com 2016-02-28 22:34:26,553 Starting new HTTPS connection (1): sso.godaddy.com 2016-02-28 22:34:28,586 Starting new HTTPS connection (1): mya.godaddy.com 2016-02-28 22:34:32,726 Update required: old 1.1.1.1, new XXX.XXX.XXX.XXX 2016-02-28 22:34:36,741 Update OK

babelon7 commented 8 years ago

I made the changes listed above to is_loggedin but still having issues just getting logged in

chris@neuromancer:~ $ python
Python 2.7.9 (default, Mar  8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygodaddy, logging
>>> logging.basicConfig()
>>> pygodaddy.GoDaddyClient().login('<someuser>', '<somepassword>')
ERROR:pygodaddy.client:Login routine broken, godaddy may have updated their login mechanism
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pygodaddy/client.py", line 103, in login
    viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
False
>>>
eXamadeus-zz commented 8 years ago

I feel bad for doing this, but it appears that @observerss has abandoned this repo (no update in over a year). I created an alternative solution to pygodaddy that uses the developer API instead of DOM transversal to send requests and get data. It eliminates the need to login and doesn't care about changes to the website layout construction. Downside is you need an API key, but that's pretty darn simple to get. Anyway, here it is...

https://github.com/eXamadeus/godaddypy

ggogel commented 8 years ago

@eXamadeus For me it's still working.

megaeverything commented 8 years ago

Hey guys,

Im new to python and this DDNS thing and i cannot get my script to work. I have tried some of the updated forks but i still get the error:

2016-04-06 02:01:58,191 ######## Godaddy DDNS update utility init ... 2016-04-06 02:01:58,287 Starting new HTTP connection (1): ident.me 2016-04-06 02:01:58,571 IP has been changed from "None" to "1.1.1.1" 2016-04-06 02:01:58,596 Starting new HTTPS connection (1): dns.godaddy.com 2016-04-06 02:01:59,403 Starting new HTTPS connection (1): idp.godaddy.com 2016-04-06 02:02:00,310 Starting new HTTPS connection (1): sso.godaddy.com 2016-04-06 02:02:01,175 Login routine broken, godaddy may have updated their login mechanism Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pygodaddy/client.py", line 101, in login viewstate = re.compile(r'id="__VIEWSTATE" value="([^"]+)"').search(r.text).group(1) AttributeError: 'NoneType' object has no attribute 'group'

Can anyone please explain to a noob how to get this working. I just bought a godaddy domain and need to get DDNS working. Any help is greatly appreciated.

babelon7 commented 8 years ago

@megaeverything, I was in the same boat as you. I gave up on this and used eXamadeus' alternative which was super easy to set up.

megaeverything commented 8 years ago

@babelon7 Can somebody help me set this up? Whatever i try it keeps giving me an error even if u use eXamadeus method....... I would like some instructions on how to use @eXamadeus solution because I have no clue what to do. If someone could give me an example script to make eXamadeus's method work, that would be great.

Thanks,

megaeverything commented 8 years ago

@babelon7 Can you post the code you have in your script?

eXamadeus-zz commented 8 years ago

@megaeverything This is what I use to do my autodns at home...Let me know if you have any issues with it.

from requests import get

import godaddypy

def main():
    my_acct = godaddypy.Account(api_key='YOUR_API_KEY_HERE', api_secret='YOUR_API_SECRET_HERE')
    client = godaddypy.Client(my_acct)

    ip = get('https://api.ipify.org').text

    client.update_ip(ip)

if __name__ == '__main__':
    main()
megaeverything commented 8 years ago

@eXamadeus Hello, I just tried to run what you gave me and this is the error I got. Any help would be greatly appreciated.

Thanks so much.

Traceback (most recent call last): File "start.py", line 14, in <module> main() File "start.py", line 11, in main client.update_ip(ip) File "/home/pi/godaddypy/godaddypy/client.py", line 125, in update_ip domains = self.get_domains() File "/home/pi/godaddypy/godaddypy/client.py", line 73, in get_domains data = self._get(url, headers=self._get_headers()).json() File "/home/pi/godaddypy/godaddypy/client.py", line 53, in _get self._validate_response_success(resp) File "/home/pi/godaddypy/godaddypy/client.py", line 48, in _validate_response_success raise BadResponse(response.json()) File "/home/pi/godaddypy/godaddypy/client.py", line 160, in __init__ super(*args, **kwargs) TypeError: super() takes at least 1 argument (0 given)