Open GoogleCodeExporter opened 9 years ago
I encountered the same problem. I commented out the following lines of code in
order to run the script.
util.py line 181
assert is_sha1(msg), 'Message id not a SHA1 hash'
voice.py line 241
assert is_sha1(msg), 'Message id not a SHA1 hash'
Original comment by abrahamn...@gmail.com
on 22 Sep 2012 at 7:37
Honestly, that sounds like a terrible solution. There has to be another way to
do this.
Original comment by sugarde...@gmail.com
on 15 Dec 2012 at 3:46
That's the only solution at the moment, as the library doesn't understand that
the Google API has changed to not *always* provide a valid SHA1 hash. It
appears to return two *different* forms of hashes; but BOTH of them work just
fine with the API. As long as the library doesn't check the IDs it's receiving
from the API, and just passes them directly back into the API, it seems to work
fine.
Of note, I'm using exactly the same script from Alex Brown on that
StackExchange site; and it works absolutely fine if you comment out the
temporarily-broken SHA1 checking.
Original comment by me@ell.io
on 3 Jan 2013 at 8:44
[deleted comment]
/usr/local/lib/python2.7/dist-packages/googlevoice/voice.py:
line 215: assert is_sha1(msg), 'Message id not a SHA1 hash'
I wrapped the assert statement like so:
try:
if not is_sha1(msg):
raise Exception('Message id not a SHA1 hash')
except Exception as e:
print(e)
pass
I think the culprit here is that the strings for the id's no longer match the
regex. Perhaps no longer sha1?
sha1_re = re.compile(r'^[a-fA-F0-9]{40}$')
def is_sha1(s):
"""
Returns ``True`` if the string is a SHA1 hash
"""
return bool(sha1_re.match(s))
An example id:
XGMJIXPKKXQUYHJOYUGUXZVRWKMTHGXGWUIKLUMT
So perhaps updating the sha1_re to something else would be the right way to fix
the issue? As mentioned above, but I really have no idea what format this is.
err... relevant:
http://stackoverflow.com/questions/1668619/is-there-a-google-voice-api
Which after some perusing the closest thing that I could find is this?
https://developers.google.com/+/hangouts/api/gapi.hangout.data#gapi.hangout.data
.getKeys
Which ... just a <string>?
Original comment by James.a....@gmail.com
on 12 Feb 2015 at 3:09
Original issue reported on code.google.com by
char...@charliemeyer.net
on 12 Sep 2012 at 6:33