legoktm / supersimplemediawiki Goto Github PK
View Code? Open in Web Editor NEWA python3 interface with MediaWiki's API
A python3 interface with MediaWiki's API
Hi,
I wanted to use supersimplemediawiki โ since it is exactly what I needed, but I'm getting an Keyerror when running has_new_messages.py:
Traceback (most recent call last):
File "uploadimg.py", line 26, in <module>
enwp.login(settings.username, settings.password)
File "/home/michi/git/fremde/supersimplemediawiki/mw.py", line 60, in login
r2 = requests.post(self.api, params=data, headers=self.headers, cookies=r1.cookies)
File "/usr/lib/python3.3/site-packages/requests/api.py", line 88, in post
return request('post', url, data=data, **kwargs)
File "/usr/lib/python3.3/site-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3.3/site-packages/requests/sessions.py", line 327, in request
self.cookies = cookiejar_from_dict(cookies, cookiejar=self.cookies, overwrite=False)
File "/usr/lib/python3.3/site-packages/requests/cookies.py", line 410, in cookiejar_from_dict
cookiejar.set_cookie(create_cookie(name, cookie_dict[name]))
File "/usr/lib/python3.3/site-packages/requests/cookies.py", line 256, in __getitem__
return self._find_no_duplicates(name)
File "/usr/lib/python3.3/site-packages/requests/cookies.py", line 311, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name=Cookie(version=0, name='enwikiSession', value='0d4310fef7701c6aca7de88e4c49437a', port=None, port_specified=False, domain='en.wikipedia.org', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False), domain=None, path=None"
Any ideas whats going wrong?
Any request involving a token will fail with an 'invalidtoken' error.
For submission to pypi and easier installation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.