Hi,
I got the API URL by printing it in api.py. I also tried your method
and indeed, it sees me as anonymous. However, as soon as I try to save
a page, the call is made using the correct user. Clearing the cookies
did not help or hurt, the behavior is the same. Perhaps pywikibot only
sends the cookies when saving a page? I'll investigate further...
Strainu
2016-08-29 21:34 GMT+03:00 Merlijn van Deen (valhallasw) <valhallasw(a)arctus.nl>nl>:
Hi Strainu,
The easiest way to get more debug information is to add -v -v -debug as
parameters (or by passing those to pywikibot.handleArgs()). The logging
layer will then write lots of debug output to logs/<scriptname>-bot.log,
including the exact API queries (is that how you found the URL in your
message, or did you build that manually?). You could first try requesting
only 50 results; the API query should then be successful, and will include
the username (via prop=userinfo).
Finally, you can try clearing your cookies (rename/delete pywikibot.lwp),
and see if logging in again solves the issue.
Merlijn.
On 29 August 2016 at 12:48, Strainu <strainu10(a)gmail.com> wrote:
Hi,
I'm trying to retrieve 500 pages from a wiki at a time using
PreloadingGenerator and I receive the warning "Too many values
supplied for parameter 'pageids': the limit is 50".
I checked by using the query [1] when logged in as a bot and it works
(I do not get the warning), so I suppose the issue is with my
pywikibot.
I tried to make sure I was logged in [2], then ran the code again and
I still get the warning. On the other hand, page updates are done
correctly (with the bot username). The code I use is more or less the
following:
transGen = pagegenerators.ReferringPageGenerator(rowTemplate,
onlyTemplateInclusion=True,
step=1000)
filteredGen = pagegenerators.NamespaceFilterPageGenerator(transGen,
[namespace], site)
pregenerator = pagegenerators.PreloadingGenerator(filteredGen, 500)
Any ideas on how to debug further?
Thanks,
Strainu
[1]
https://commons.wikimedia.org//w/api.php?maxlag=5&rvprop=ids|flags|timeā¦
[2] I have a private app, so I added the access information directly
in user-config.py
_______________________________________________
pywikibot mailing list
pywikibot(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot
_______________________________________________
pywikibot mailing list
pywikibot(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot