mediawiki-utilities / python-mwapi

Simple Python Wrapper around MediaWiki API
http://pythonhosted.org/mwapi
MIT License
31 stars 11 forks source link

adds support for OATH two factor #28

Closed halfak closed 7 years ago

halfak commented 7 years ago
$ python demo_queries.py 
Log into https://en.wikipedia.org
Username: Halfak (WMF)
Password: 
Please enter verification code from your mobile app
Token(OATHToken): 555555
whoami?
     {'query': {'userinfo': {'name': 'Halfak (WMF)', 'id': 15119974}}, 'batchcomplete': True} 
halfak commented 7 years ago

Works fine with non-2-factor accounts too

$ python demo_queries.py 
Log into https://en.wikipedia.org
Username: Wiki labeler
Password: 
whoami?
     {'batchcomplete': True, 'query': {'userinfo': {'name': 'Wiki labeler', 'id': 25080938}}}