A few hours ago (perhaps around midnight UTC, but that's a guess),
Yahoo started failing on connect with the following (logged) message.
<body xmlns="jabber:client">You are using an older version of Yahoo!
Messenger that is no longer supported. Please upgrade by downloading
the newest version by going to: http://messenger.yahoo.com/download.php</body>
Does anyone have a notion how much needs to be changed to have the
Transport use (or at least pretend to use) a new version of the
protocol?
> Looks like yahoo transport is useless until new protocol support is > implemented :(
> --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups "py-transports" group. > To post to this group, send email to py-transports@googlegroups.com > To unsubscribe from this group, send email to py-transports+unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/py-transports?hl=en > -~----------~----~----~----~------~----~------~--~---
I am also unable to connect to Yahoo services with PyYIMt, CVS
version 1.73 2009/02/13, but with a different message when I try to
register with the Transport. Is anyone else seeing this error? It
says:
A remote server or service specified as part or all of the JID of the
intended recipient (or required to fulfill a request) could not be
contacted within a reasonable amount of time.
A remote server or service specified as part or all of the JID of the
intended recipient could not be contacted within a reasonable amount
of time.
On Sep 29, 12:26 am, "Nikita V. Youshchenko" <yo...@cs.msu.su> wrote:
If I strace the transport, I see both XMPP messages (my client doesn't
seem to pass them along in a form that I can view directly). It then
appears that the socket is closed by Yahoo.
On Sep 29, 1:01 pm, joeuser <l...@uark.edu> wrote:
> I am also unable to connect to Yahoo services with PyYIMt, CVS
> version 1.73 2009/02/13, but with a different message when I try to
> register with the Transport. Is anyone else seeing this error? It
> says:
> A remote server or service specified as part or all of the JID of the
> intended recipient (or required to fulfill a request) could not be
> contacted within a reasonable amount of time.
> A remote server or service specified as part or all of the JID of the
> intended recipient could not be contacted within a reasonable amount
> of time.
> On Sep 29, 12:26 am, "Nikita V. Youshchenko" <yo...@cs.msu.su> wrote:
> > > A few hours ago (perhaps around midnight UTC, but that's a guess),
> > > Yahoo started failing on connect with the following (logged) message.
Yea, I was warned a while ago by someone who knew about yahoo's server
upgrade that the servers running the older protocol were going away. I
haven't had time to see what needs changing, and no one has posted any
patches that I know about. Additionally most people I need to IM with are
on a jabber capable network, so I don't bother to log into yahoo much
anymore.
If anyone produces a patch to make the transport work with the latest
servers, send it my way, and I'll apply it to git (or I'll just give you git
commit access)
On Tue, Sep 29, 2009 at 4:07 AM, Nikita V. Youshchenko <yo...@cs.msu.su>wrote:
I had exactly same symptoms as Phil mentioned, i.e. connects for just
a moment...
And here is quick workaround I found:
# in ylib.py, line #30,
# replace:
hostlist = socket.gethostbyname_ex('scs.msg.yahoo.com')[2]
# to:
hostlist = socket.gethostbyname_ex('cn.scs.msg.yahoo.com')[2]
> And here is quick workaround I found: > # in ylib.py, line #30, > # replace: > hostlist = socket.gethostbyname_ex('scs.msg.yahoo.com')[2] > # to: > hostlist = socket.gethostbyname_ex('cn.scs.msg.yahoo.com')[2]
- > And here is quick workaround I found: - > # in ylib.py, line #30, - > # replace: - > hostlist = socket.gethostbyname_ex('scs.msg.yahoo.com')[2] - > # to: - > hostlist = socket.gethostbyname_ex('cn.scs.msg.yahoo.com')[2] - - This worked for me as well, thanks.
Beware, that connects to a Yahoo server in China. (as might be suggested by the hostname.)
-- Eric Schnoebelen e...@cirr.com http://www.cirr.com Fourth Law of Thermodynamics, the Law of Conservation of Bureaucracy: For every practical engineering solution, there is an equal and contradictory obstacle put forward by a regulator because the politics cannot be overcome. -- Adam H. Kerman
On Sep 30, 12:02 am, Norman Rasmussen <norm...@gmail.com> wrote:
> If anyone produces a patch to make the transport work with the latest
> servers, send it my way, and I'll apply it to git (or I'll just give you git
> commit access)
I'm working on a patch right now. I've already succeeded in
authenticating using version 16 of the protocol (the HTTPS method).
However, now that I'm advertising support for the new protocol in the
client I am receiving message types that pyyimt doesn't yet know how
to handle. So far I've seen types 190, 239, 240, and 241, and they
appear to be related to buddy's online status and possibly the roster.
On Sep 30, 11:04 am, skeeziks <t...@stoo.org> wrote:
> I'm working on a patch right now. I've already succeeded in
> authenticating using version 16 of the protocol (the HTTPS method).
> However, now that I'm advertising support for the new protocol in the
> client I am receiving message types that pyyimt doesn't yet know how
> to handle. So far I've seen types 190, 239, 240, and 241, and they
> appear to be related to buddy's online status and possibly the roster.
> I'll keep you guys updated with my progress.
This sounds great, Tim. I'll offer my assistance though I don't know
much about the yahoo protocol itself. I have delved into the
transport code, so I do have a slight grasp of it. Definitely willing
to test anything whole or partial you might end up with.
> On Sep 30, 11:04 am, skeeziks <t...@stoo.org> wrote: >> I'm working on a patch right now. I've already succeeded in >> authenticating using version 16 of the protocol (the HTTPS method). >> However, now that I'm advertising support for the new protocol in the >> client I am receiving message types that pyyimt doesn't yet know how >> to handle. So far I've seen types 190, 239, 240, and 241, and they >> appear to be related to buddy's online status and possibly the >> roster.
>> I'll keep you guys updated with my progress.
> This sounds great, Tim. I'll offer my assistance though I don't know > much about the yahoo protocol itself. I have delved into the > transport code, so I do have a slight grasp of it. Definitely willing > to test anything whole or partial you might end up with.
I've finished with the initial version of the patch and it seems to be working within my test environment. I'm able to sign on, the roster gets updated, I can send and receive messages, and buddy status changes seem to work.
I'll package up what I have and send out a patch against the latest version in source control.
Here's a patch against the latest versions of ylib.py and yahoo_helper.py. This is enough to make my transport behave in the tests I've run; hopefully it's complete enough to work for everyone. Please test it and see how it works for you.
Yahoosep = '\xc0\x80' diff --git a/yahoo-transport/ylib.py b/yahoo-transport/ylib.py index 9731057..fccdb24 100644 --- a/yahoo-transport/ylib.py +++ b/yahoo-transport/ylib.py @@ -7,6 +7,9 @@ import socket, time import avatar import re import random +import httplib +import md5 +import base64
def printpacket(packet): @@ -30,7 +33,7 @@ class YahooCon: hostlist = socket.gethostbyname_ex('scs.msg.yahoo.com')[2] #hostlist = ['cs1 .msg.dcn.yahoo.com ','cs2 .msg.dcn.yahoo.com ','cs3 .msg.dcn.yahoo.com ','cs4 .msg.dcn.yahoo.com ','cs5 .msg.dcn.yahoo.com ','cs6 .msg.dcn.yahoo.com ','cs7 .msg.dcn.yahoo.com ','cs8 .msg.dcn.yahoo.com ','cs9 .msg.dcn.yahoo.com ','cs10 .msg.dcn.yahoo.com ','cs11 .msg.dcn.yahoo.com ','cs12 .msg.dcn.yahoo.com ','cs13 .msg.dcn.yahoo.com ','cs14 .msg.dcn.yahoo.com ','cs15 .msg.dcn.yahoo.com ','cs16 .msg.dcn.yahoo.com ','cs17 .msg.dcn.yahoo.com ','cs18 .msg.dcn.yahoo.com ','cs40 .msg.dcn.yahoo.com ','cs41 .msg.dcn.yahoo.com ','cs42 .msg.dcn.yahoo.com ','cs43 .msg.dcn.yahoo.com ','cs44 .msg.dcn.yahoo.com ','cs45 .msg.dcn.yahoo.com ','cs46 .msg.dcn.yahoo.com ','cs50 .msg.dcn.yahoo.com','cs51.msg.dcn.yahoo.com','cs52.msg.dcn.yahoo.com'] port = 5050 - version = 0x000c0000 + version = 0x00100000 sock = None # a dictionary of groups and members buddylist = {} @@ -111,8 +114,74 @@ class YahooCon: session = hdr[5] self.session=session chalstr = pay[0][94] - (crypt1, crypt2) = YahooMD5.curphoo_process_auth (self.username,self.password,chalstr) - npay = ymsg_mkargu({6:crypt1,96:crypt2,0:self.username, 1:self.username,2:self.username,135:'5,6,0,1358',148:'360'}) + + # Do HTTPS login. + h = httplib.HTTPSConnection('login.yahoo.com') + h.request('GET', '/config/pwtoken_get?src=ymsgr&ts=&login= %s&passwd=%s&chal=%s' % (self.username, self.password, chalstr)) + resp = h.getresponse().read().splitlines() + code = resp[0] + if code != '0': + # Interpret login problems. These should broken out into individual conditionals and given + # more specific messages in yahoo.py. + if code == '100' or code == '1212' or code == '1235': + # Username or password is missing (100), username or password is incorrect (1212), + # or username does not exist (1235). + if self.handlers.has_key('loginfail'): + self.handlers['loginfail'](self,'badpassword') + return None + + elif code == '1013': + # Username contains @yahoo.com or similar which needs removing. + if self.handlers.has_key('loginfail'): + self.handlers['loginfail'](self,'badusername') + return None + + elif code == '1213' or code == '1214' or code == '1236' or code == '1218': + # Security lock on account due to failed login attempts (1213 and 1236), general security + # lock (1214), or account deactivated by Yahoo! (1218). + if self.handlers.has_key('loginfail'): + self.handlers['loginfail'](self,'locked') + return None + + else: + # Other error not listed. + if self.handlers.has_key('loginfail'): + self.handlers['loginfail'](self) + return None + + # No error in code, so get remaining fields. + ymsgr = resp[1][resp[1].index('=') + 1:] + partnerid = resp[2][resp[2].index('=') + 1:] + if self.dumpProtocol: print "HTTPS pwtoken_get response {code: %s, ymsgr: %s, partnerid: %s}" % (code, ymsgr, partnerid) + + # Login successful, grab our crumb. + h.request('GET', '/config/pwtoken_login?src=ymsgr&ts=&token= %s' % ymsgr) + resp = h.getresponse().read().splitlines() + code = resp[0] + crumb = resp[1][resp[1].index('=') + 1:] + y_crumb = resp[2][resp[2].index('=') + 1:] + t_crumb = resp[3][resp[3].index('=') + 1:] + validfor = resp[4][resp[4].index('=') + 1:] + if self.dumpProtocol: print "HTTPS pwtoken_login response {code: %s, crumb: %s, y_crumb: %s, t_crumb: %s, validfor: %s}" % (code, crumb, y_crumb, t_crumb, validfor) + + # Calculate hash of crumb and challenge string. + mhash = md5.new() + mhash.update(crumb) + mhash.update(chalstr) + bhash = base64.encodestring(mhash.digest()).replace('+', '.').replace('/', '_').replace('=', '-').strip() + + # Assemble response packet. + npay = ymsg_mkargu({ + 1: self.username, + 0: self.username, + 277: y_crumb, + 278: t_crumb, + 307: bhash, + 244: '2097087', + 2: self.username, + 2: '1', + 98: 'us', + 135: '9.0.0.1389'}) nhdr = ymsg_mkhdr(self.version,len(npay),Y_challenge, 0x5a55aa55,self.session) return nhdr+npay
@@ -224,6 +293,9 @@ class YahooCon: self.handlers['offline'] (self,pay[each][7]) if not self.resources.has_key(pay[each][7]) or self.resources[pay[each][7]] == []: self.roster[pay[each][7]]=('unavailable', None, None) + if self.handlers.has_key('offline'): + self.handlers['offline'](self,pay[each][7]) + elif len(pay[0].keys()) == 0: if self.handlers.has_key('closed'): self.handlers['closed'](self) @@ -443,6 +515,76 @@ class YahooCon: if self.handlers.has_key('roommessagefail'): self.handlers['roommessagefail'](self, pay[0] [109], pay[0][104], msg)
+ def ymsg_cloud(self, hdr, pay): + # Loop through the payload entries and pull out groups and buddy names. The odd loop construct is to make + # sure the entries are parsed in order; I'm not convinced (yet) that dict's .values() will always iterate + # in the desired order. + group = 'Top Level' + i = 0 + while pay.has_key(i): + entry = pay[i] + i = i + 1 + + # Entry is a group. + if entry.has_key(65): + group = entry[65] + self.buddylist[group] = [] + + # Entry is a buddy. + if entry.has_key(300) and entry.has_key(7): + buddy = entry[7] + self.buddylist[group].append(buddy) + if not self.roster.has_key(buddy): + self.roster[buddy]=('unavailable',None, None) + if self.handlers.has_key('subscribe'): + self.handlers['subscribe'](self, buddy, 'XXX Test message XXX') + + def ymsg_statusupdate15(self, hdr, pay): + # If we're here then buddy is online in some sense. Let's figure out how online they are. This message may + # contain more than one buddy status (this seems to happen right after login). + for entry in pay.values(): + if not entry.has_key(7): + continue + + buddy = entry[7] + typ = int(entry[10]) + + # Grab status message, if any. + status = '' + if entry.has_key(19): + status = entry[19] + + # Determine idle/away status. + away = 0 + idle = 0 + if typ > 0 and typ < 12: + away = 1 + if entry.has_key(47) and int(entry[47]) > 0: + away = 1 + if typ == 999: + idle = 1 + + # Update roster and presence. + if typ < 1000 and typ != 12: + # Buddy is online... + if away == 1: + # ... but away. + self.roster[buddy] = ('available', 'dnd', status) + elif idle == 1: + # ... but idle. + self.roster[buddy] = ('available', 'away', status) + else: + # ... and not idle or away. + self.roster[buddy] = ('available', None, status) + + if self.handlers.has_key('online'): + self.handlers['online'](self, buddy, '') + else: + # Buddy is offline. + self.roster[buddy] = ('unavailable', None, None) + if self.handlers.has_key('offline'): + self.handlers['offline'](self, buddy) + def ymsg_init(self): try: challenge = self.ymsg_send_challenge() @@ -688,8 +830,9 @@ class YahooCon: if s[3] == Y_chalreq: #87 # give salt challenge = self.ymsg_challenge(s,t) - if self.dumpProtocol: printpacket(challenge) - self.sock.send(challenge) +
Thanks for your inputs. I tried the emailed attatchment only. There
are no other warnings. Can you kindly email the excat patched
yahoo_helpers.py and ylib.py file so that i can just replace the
existing 2 files and test this out?
Thanks once again
Regards
Vishal
On Oct 1, 5:42 pm, Tim Stewart <t...@stoo.org> wrote:
On Sep 30, 2009, at 12:02 AM, Norman Rasmussen wrote:
> ... snip ...
> If anyone produces a patch to make the transport work with the > latest servers, send it my way, and I'll apply it to git (or I'll > just give you git commit access)
I've found the GitHub page for yahoo-transport, but I've been tracking all of xmpppy's changes via CVS for some time now, including the yahoo- transport subdirectory.
For both Git and CVS I see that the latest yahoo-transport change was ``Added support for large buddies list fragmentation. Thanks to Donald Town,'' so it looks like Git and CVS are in sync. Do you plan to retire the CVS version in the future?
The patch I wrote seems to be working well but I've got a new version coming that fixes an occasional error. I'll send out the new one to the list once it's done. Or, I could commit it directly if that's what you prefer.