folz / cleverbot.py

ARCHIVED - Use https://github.com/edwardslabs/cleverwrap.py instead.
BSD 2-Clause "Simplified" License
76 stars 41 forks source link

List index out of range #49

Closed Atomicbeast101 closed 7 years ago

Atomicbeast101 commented 7 years ago

List index out of range happens when I use the cleverbot API, assuming CleverBot API got changed again. Here's the error log:

File "/usr/local/lib/python3.5/dist-packages/cleverbot/cleverbot.py", line 125, in ask 
    parsed = self._parse(resp.text)
File "/usr/local/lib/python3.5/dist-packages/cleverbot/cleverbot.py", line 173, in _parse
    if parsed[0][1] == 'DENIED':
IndexError: list index out of range

Currently using Python v3.5.2 and Cleverbot v2.0.0

mrgigabyte commented 7 years ago

facing the same issue :(

jb3 commented 7 years ago

I think this is an issue with cleverbot as a lot of programs I have written have stopped working

Zenrac commented 7 years ago

Same

folz commented 7 years ago

Cleverbot recently changed their API policies to limit to 5k free calls per month, and have an official REST api. See https://www.cleverbot.com/api/#abovetitle

Beefywhale commented 7 years ago

Same :disappointed: Will this get fixed? :cry:

Zenrac commented 7 years ago

It must be never fixed, because it was an unofficial lib, and now there is an official. We can't use the unofficial anymore

folz commented 7 years ago

I mean I'm down to turn this into a wrapper for the official API but it'll take longer than a one-line change (which is all that was required when things broke in the past). In the meantime / if you can't wait, the link above a good place to start writing your own code.

mrgigabyte commented 7 years ago

https://github.com/mrgigabyte/cleverbot.py you can checkout this, i have already initiated a pull request. Just for those who missed that. Kudos to: https://github.com/wrxck/mattata-ai/commit/16ef32be0551774f164e03f2380662d37a2a9b10

Woopydo commented 7 years ago

With the above hack, cb = Cleverbot('ERASE ANYTHING HERE')

Zenrac commented 7 years ago

I think this hack don't work anymore

EhsanKia commented 7 years ago

Hmm, kinda annoying that we have to sign up for an API key, but at least there's an official API and it'll no longer break due to them trying to get rid of abuser who probably destroy their servers. I don't know about the other people here but 5000 a month is reasonable and enough for my use.

It should also be fairly easy to integrate as there's no more hacky cookie/header stuff. I can code a PR up this weekend if no one else has time for it.

mrgigabyte commented 7 years ago

https://github.com/mrgigabyte/cleverbot.py/commit/1e8b2a18bf2b9d74230488564b38f33b3568a4cb this works for now

jb3 commented 7 years ago

Does the boibot.com hack still work??

millerhooks commented 7 years ago

This might help y'all. The API is a lot simpler now.

https://gist.github.com/millerhooks/2db94c841603aea58cec31e668c7f501

EhsanKia commented 7 years ago

@mrgigabyte But that's boibot no? Isn't that an entirely different bot? I haven't tried it but is it comparable in quality to cleverbot?

@millerhooks thanks! Though it seems you pasted twice, might want to edit/fix that.

jb3 commented 7 years ago

I don't know what boibot actually is but I edited cleverbot.py's code to use it so now all my cleverbot scripts still work, it is just as good in comparison to cleverbot in my opinion

mrgigabyte commented 7 years ago

If you would have tried digging in a bit, you would have figured the answer to the question yourself. Boibot is a bot made my the very same team ( cleverbot ) so yeah.

edwardslabs commented 7 years ago

I went ahead and wrote a wrapper for the new API: https://github.com/edwardslabs/cleverwrap.py feel free to use it as you please.

Delivator commented 7 years ago

+1

folz commented 7 years ago

Closing as this project is now unmaintained - see https://github.com/edwardslabs/cleverwrap.py for a Python library to access the official API.