129 questions
0
votes
1
answer
33
views
specialbots.UploadRobot().run(): looks like I cannot catch an exception?
In my script, I want to catch the case when user uploading a file to Commons that already exists.
My logs:
Uploading file to commons:commons...
WARNING: API error fileexists-no-change: The upload is ...
1
vote
1
answer
43
views
How can I notify a user using a Pywikibot script?
I wrote a Pywikibot script that adds a message to a user’s talk page if some conditions are detected. So far so good, but when my bot leaves the message, the user is not notified, which kind of ...
0
votes
0
answers
33
views
MediaWiki API Error: badrequest while attempting to change password using changeauthenticationdata
Description:
I am trying to use the MediaWiki API to change a user's password with the changeauthenticationdata module. However, every time I make the request, the API returns an error with code ...
0
votes
1
answer
85
views
Why does the CSRF token from the Wikimedia API only work for 1-2 hours after login, then stop working?
I am using the Wikimedia API with Basic Authorization and Cookie-based authentication. Initially, after logging in, I can retrieve the CSRF token without issues. However, after about 1-2 hours, any ...
0
votes
0
answers
23
views
batch add category to list of pages or files
I am using pywikibot 9.3.1, MediaWiki 1.42
I can add a category to a list of files in my mediawiki installation with the category script:
pwb category add -file:e:/in.txt -to:Bibliothek
after each ...
0
votes
0
answers
29
views
Using alive-progress together with pywikibot gives OSError: Target stream <stderr> is neither stdin (<stdout>) nor stderr (<stderr>)
I'm trying to use an alive-bar progress bar (see https://pypi.org/project/alive-progress/), keeping an eye on some PyWikiBot operations. Sadly, i've got the following error when PyWikiBot seems to ...
0
votes
1
answer
37
views
How do I use pywikibot to clone one page into multiple other pages?
I need help copying the content of one page into multiple other pages using pywikibot. I.e. I wrote page 1 and I need page 2 and 3 to have the same content.
I tried reading the documentation, but I ...
0
votes
0
answers
76
views
Code works when run through powershell but not when run through IDE
Comparison of running directly in visual studio vs terminal option in visual studio
I'm using a terminal profile with this command to set the venv:
-NoExit -Command "& { Import-Module "&...
0
votes
1
answer
144
views
Configuring Pywikibot to use a wikimedia install's bot
I have installed a wikimedia instance on a cloud server. I think the 'Family' is properly set up because I can, as an example, retrieve the content from the main page as:
# Set up the site
site = ...
0
votes
1
answer
93
views
Edits made by Pywikibot edits not showing up in Recent Changes
As the title says, I cannot see the edits made via the API with Pywikibot in Recent Changes, even with all filters removed. I can see the list of edits when I go to the User Contributions page of the ...
0
votes
1
answer
139
views
Matching specific Geonames IDs with Wikidata IDs using Pywikibot
I have an extensive list of Geonames IDs for which I want to find the matching Wikidata IDs. I would like to use Pywikibot and, if possible, iterate over the list.
The SPARQL query for an individual ...
0
votes
1
answer
120
views
Pywikibot: _lzma module missing
I've developped a Python script which use Pywikibot.
The scripts works fine on Windows 11 but i need to run it on Linux Server with CentOS 7.
But, there was an issue involving a missing module named ...
1
vote
0
answers
110
views
How do I set the API cache directory apicache-py3 and throttle.ctrl for pywikibot?
By default pywikibot makes a cache directory apicache-py3 and a file throttle.ctrl in the current directory, from where I run my Python script.
I would like pywikibot to put those elsewhere, e.g. in .....
2
votes
1
answer
206
views
how to work with custom wikibase using pywikibot
I have my family file, user-config.py and user-password.py in the directory that i am running the following script from
import os, sys
import pywikibot as pwb
pwb.config.register_families_folder(os....
0
votes
1
answer
97
views
How are you supposed to do admin/sysop actions with Pywikibot 8?
I have been using an outdated version of Pywikibot and Python 2 and finally got around to upgrading to Python 3 and Pywikibot 8. All support for "sysop" accounts seems to have been removed ...