Same here.
Taking the latest git snapshot from http://xmpppy.sourceforge.net/yahoo/
does not help.
Looks like yahoo transport is useless until new protocol support is
implemented :(
Yahoo servers like to send out these messages on the use of any protocol
command that the other side doesn't implement.
Ewan Marshall
Geek by Nature, Linux by choice.
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "py-transports" group.
> To post to this group, send email to py-tra...@googlegroups.com
> To unsubscribe from this group, send email to py-transport...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/py-transports?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
> Odd, it's working fine here...
>
> Yahoo servers like to send out these messages on the use of any protocol
> command that the other side doesn't implement.
Not working for me and no message. Connects for just a moment when tried.
Getting it working again could take a little working out. Of course,
really I want it to work as well as the others do, but that can wait...
--
Phil Reynolds
mail: emle...@gmail.com
GTalk/Jabber: emle...@hallam.tinsleyviaduct.com
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Kopete (at least KDE3 one) also can't connect to Yahoo server here.
However some people are able to connect. This very looks similar to ICQ
stories.
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 er...@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
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.
Stay tuned...
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.
I hope my mail client won't botch this...
Good luck!
--
-TimS
Tim Stewart
Stoo Research
t...@stoo.org
diff --git a/yahoo-transport/yahoo_helpers.py b/yahoo-transport/
yahoo_helpers.py
index 2760c08..61a89b6 100644
--- a/yahoo-transport/yahoo_helpers.py
+++ b/yahoo-transport/yahoo_helpers.py
@@ -46,6 +46,7 @@ Y_chtmsg = 168 # Chat Message
Y_avatar = 188 # Avatar Image update
Y_statusupdate = 198 #update of status (like away/back etc)
Y_advstatusupdate = 199 #update of advanced status (like avatar etc)
+Y_statusupdate15 = 240 # Protocol 15: status update (away/back, etc.)
Y_cloud = 241 # 0 = Yahoo!, 2 = LiveID (WLM)
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)
+ if challenge:
+ if self.dumpProtocol: printpacket(challenge)
+ self.sock.send(challenge)
elif s[3] == Y_login: #85
# login ok
self.ymsg_login(s,t)
@@ -748,6 +891,10 @@ class YahooCon:
self.ymsg_init()
elif s[3] == Y_chatlogout:
self.chatlogin = False
+ elif s[3] == Y_statusupdate15: #240
+ self.ymsg_statusupdate15(s, t)
+ elif s[3] == Y_cloud: #241
+ self.ymsg_cloud(s,t)
else:
pass
#print "remove packet"
> Hello again.
>
> I think the last mailing was botched. I'll attach the file instead.
Just applied this - now I get a password error!
I will investigate further.
On Sep 30, 2009, at 6:13 PM, Phil Reynolds wrote:
>> I think the last mailing was botched. I'll attach the file instead.
>
> Just applied this - now I get a password error!
>
> I will investigate further.
Yes, please let me know what you find!
Was the error a stack trace of some sort, or just Yahoo telling you
your password was incorrect?
> Was the error a stack trace of some sort, or just Yahoo telling you
> your password was incorrect?
The latter. It wouldn't take my password on site either.
Changed it and got site back but no messenger. Changed it again to one
slightly less secure and all restored.
If ever we meet, I owe you one!
On Sep 30, 2009, at 6:49 PM, Phil Reynolds wrote:
> Quoting "Tim Stewart" <t...@stoo.org>:
>
>> Was the error a stack trace of some sort, or just Yahoo telling you
>> your password was incorrect?
>
> The latter. It wouldn't take my password on site either.
>
> Changed it and got site back but no messenger. Changed it again to one
> slightly less secure and all restored.
Ah, glad to hear it worked!
> If ever we meet, I owe you one!
Hey, no worries. I was very motivated by the many users at my company
that use PyYIM-t every day :)
Cheers,
On Oct 1, 2009, at 3:05 AM, Vishal wrote:
> I applied the patch and got the following:
>
> Traceback (most recent call last):
> File "C:\yahoo-t-0.4\yahoo.py", line 18, in <module>
> import config, roomlist, xmlconfig, ylib
> File "C:\yahoo-t-0.4\ylib.py", line 151
> ymsgr = resp[1][resp[1].index('=') 1:]
> ^
> SyntaxError: invalid syntax
>
> Can you kindly suggest whats to be done?
Did you apply the version that I mailed out as an attachment? I'm
pretty sure that the one included inline in the mail is corrupt.
Also, were there any warnings during the patch run itself?
On Sep 30, 2009, at 4:49 PM, Tim Stewart wrote:
> I think the last mailing was botched. I'll attach the file instead.
I've found a bug in my code that will occasionally crash an individual
connection (not the whole transport). I'll update with a new patch
soon.
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.
Norman,
On Sep 30, 2009, at 12:02 AM, Norman Rasmussen wrote:
> ... snip ...
>I've found the GitHub page for yahoo-transport, but I've been tracking
> 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)
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.
On Oct 2, 2009, at 2:22 PM, Norman Rasmussen wrote:
> On Thu, Oct 1, 2009 at 11:13 AM, 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.
>
> Do you have a github account, if you don't please create one and
> I'll give
> you push access to http://github.com/normanr/yahoo-transport
I do. My username is `skeeziks.'
>> 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?
>
> yes CVS is deprecated, to add to the confusion there's a git repo on
> sf.netwhich has all the projects under separate branches (this will be
> replaced with multiple repos once the sf.net supports multi-repo -
> coming soon)
OK, I'll start using GitHub as my primary source.
>> 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.
>>
>
> The easiest for me is to add you to the github repo, and let you push
> directly.
Sounds good!
I'm not absolutely positively sure that this patch applies cleanly
against the latest Git source since I was working from the CVS repo at
the time. I'll be patching against Git (and pushing that patch up to
the main tree, thanks Norman), and I'll send out a mail when I've done
that and you can try the latest version from GitHub at that time.
> Thanks for writing this patch. I am not currently using git. Can you
> post the updated files to this forum so I can replace the current
> files?
If you're not using the Git version, which version of yahoo-transport
are you running? It's possible that the files I have will not be
appropriate for your version of the code if it's not based on a recent
Git checkout.
Does your password work elsewhere within Yahoo? Mine had stopped
working altogether.
On Oct 2, 2009, at 3:21 PM, joeuser wrote:
> On Oct 2, 1:50 pm, Tim Stewart <t...@stoo.org> wrote:
>> On Oct 1, 2009, at 4:12 PM, joeuser wrote:
>>
>>> Thanks for writing this patch. I am not currently using git. Can
>>> you
>>> post the updated files to this forum so I can replace the current
>>> files?
>>
>> If you're not using the Git version, which version of yahoo-transport
>> are you running? It's possible that the files I have will not be
>> appropriate for your version of the code if it's not based on a
>> recent
>> Git checkout.
>
> The version information in my yahoo.py says:
> # $Id: yahoo.py,v 1.73 2009/02/13 09:39:10 normanr Exp $
> version = 'CVS ' + '$Revision: 1.73 $'.split()[1]
>
> Would your patch work with the version I am using?
Hmm, it is pretty recent, so perhaps it would work OK.
Once I finish the current version of the patch I'll send you a copy of
the two changed files and you can give it a shot.
So, the verdict is that you're able to log in now?
I know I had some initial trouble because I was logging in and out a
bunch and Yahoo ended up locking my account for a while :) Oddly
enough I could still log in via the web interface even though the
transport and the official Yahoo client were giving me password
errors. Interestingly, the errors I look for in the transport are
more descriptive than the official client, which has a single catch-
all "login failure" message.
On Oct 2, 2009, at 9:50 PM, Mike Markley wrote:
> It does appear that there are issues handling MSN contacts in the git
> version (but I don't know if that's a protocol 16 issue or not since
> I'd previously been running 0.4).
I suspect this is at least partly related to YMSG16, since I'm not
sure if older versions of the protocol would even show you your MSN
contacts. But I don't really know for sure.
> Every time I log in, it shows all
> the MSN contacts I've added to Yahoo as online, even when I know
> they're not. More annoying, there are three IM spammers who I've
> previously rejected and for whom I now get authorization requests each
> time I log in. But overall, it does seem to be working just fine for
> Yahoo contacts.
Perhaps I'll add some MSN contacts to my test account and see if I can
parse them correctly as well.
I'll be working on the MSN contacts today, and I've also fixed a crash
in the previous YMSG16 patch (backtraces due to missing key `10').
Stay tuned! If things go well and the patch works well for everyone
then I'll commit it upstream.
I'll also mail copies of the source files to those who were having
trouble with the patch.
Thanks,
--
-TimS
Tim Stewart
Stoo Research
t...@stoo.org
> nice work tim,
Thanks!
Keep a lookout for the official version that will make it into the
official Git repo in the very near future.
On Oct 9, 2009, at 2:17 PM, wik wrote:
> I just pulled updates from github, now getting:
> "Login Failed to Yahoo! service. The Yahoo! Service returned a bad
> password error Please use the registration function to check your
> password is correct."
>
> Tried the same as Phil did, but with no luck in my case...
Sorry, the update is not in Git yet. I'm working it out as we speak.
You can either apply the patch earlier in this chain or wait a few
hours for the fix to be in Git.
On Oct 14, 2009, at 2:29 PM, suso wrote:
> On 9 oct, 20:26, Tim Stewart <t...@stoo.org> wrote:
>> On Oct 9, 2009, at 2:17 PM, wik wrote:
>>
>>> I just pulled updates from github, now getting:
>>> "Login Failed to Yahoo! service. The Yahoo! Service returned a bad
>>> password error Please use the registration function to check your
>>> password is correct."
>>
>>> Tried the same as Phil did, but with no luck in my case...
>>
>> Sorry, the update is not in Git yet. I'm working it out as we speak.
>> You can either apply the patch earlier in this chain or wait a few
>> hours for the fix to be in Git.
>
> Which patch do you mean?
I have written a patch to fix lack of old Yahoo protocol support in
Yahoo's servers, required for connecting to Yahoo via PyYIMt these days.
I'm about to submit the patch into the Git source tree. I was
supposed to do it several days ago but Life got in the way and delayed
my submission.
On Oct 10, 2009, at 11:40 AM, Chain wrote:
> Which patch do you mean? I think I got a bit confused in this thread.
> Otherwise, please tell us, when you're finished pushing the patch into
> git. Would be nice to have YIM working again :)
I have pushed the patch into Norman's Git repository. Two things to
note:
1) I added code that ignores any buddy name with an `@', except for
`@yahoo.com', in an attempt to disable MSN contacts. They don't seem
to work well (one-way comms and presence problems).
2) Presence for newly-added buddies seems to be broken. You can still
converse but you will not see them change status. Old contacts seem
to work fine. I'm guessing you could manage your list with the web or
official client, though.
I'm sorry it's not complete, given the two notes above, but it's the
best I can do with the time I have right now. I expect the solutions
to both 1) and 2) are probably unimplemented message types but I have
not researched them yet.
On Nov 11, 2009, at 5:07 AM, pvgoran wrote:
> I'm currently using the GIT version of the transport. It mostly works,
> though there are some problems.
>
> First, the connection sometimes gets lost and I have to switch status
> to offline and then back to online to get it working again - but this
> may be due to different reasons (including insufficient system memory
> and outdated pyxmpp components).
>
> Second, I couldn't add the new Yahoo contact to the roster. Or, more
> precisely, I couldn't exchange authorization with the contact (the
> messages were going through fine). I was able to authorize the contact
> using Pidgin 2.6.3, and then it worked OK with the transport.
I see this behavior as well.
> By the way, Pidgin was working fine with Yahoo ever since this
> protocol mess began, so it must have the new protocol version
> implemented, and its code can be used to complete the new protocol
> support in pyyim-t. :)
I did use the Pidgin source for some guidance when implementing what little YMSG16 support is in the transport thus far.
I don't expect to have much time in the next week or two to look back into this. I'll see what I can do, however.
Hello again.
I think the last mailing was botched. I'll attach the file instead.
Good luck,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "py-transports" group.
To post to this group, send email to py-tra...@googlegroups.com
To unsubscribe from this group, send email to py-transport...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/py-transports?hl=en
-~----------~----~----~----~------~----~------~--~---