tshrinivasan / OCR4wikisource

OCR for WikiSource using Google Drive OCR
GNU General Public License v2.0
33 stars 24 forks source link

APIError ratelimited #59

Closed nasirkhan closed 8 years ago

nasirkhan commented 8 years ago

Got the following error while uploading this tool today. Any idea about the reason of this and ways to resolve it?

Uploading content for text_for_page_00017.txt
Traceback (most recent call last):
  File "mediawiki_uploader.py", line 226, in <module>
    page.edit(text=content,summary=edit_summary)
  File "/usr/local/lib/python2.7/dist-packages/wikitools/page.py", line 623, in edit
    result = req.query()
  File "/usr/local/lib/python2.7/dist-packages/wikitools/api.py", line 165, in query
    raise APIError(data['error']['code'], data['error']['info'])
wikitools.api.APIError: (u'ratelimited', u"You've exceeded your rate limit. Please wait some time and try again")
jayantanth commented 8 years ago

https://www.mediawiki.org/wiki/API:Errors_and_warnings

jayantanth commented 8 years ago

So if you increase the time.sleep(5) at mediawiki_uploader.py, you may be not seen this error.

ravidreams commented 8 years ago

Are you running many parallel sessions using the same wiki user login? Try using different wiki user logins. It may be also limited by IP address. So, it is better to get more people run the tool from different locations and user ids.

nasirkhan commented 8 years ago

@ravidreams , No, i am not running multiple sessions form the same account. Increased the sleep time, lets see.

tshrinivasan commented 8 years ago

@nasirkhan any update on this?

is increasing the sleep time helping?

nasirkhan commented 8 years ago

sorry did not updated here. Yes increased the sleep time and it is working fine.

tshrinivasan commented 8 years ago

What is the sleep time you set?

Shall we make it as default?