-1

For various reasons I can't use login.py to log me in so I was wondering if anyone knew code so that I could log in to Wikipedia with my script without running a separate script? Cheers!

  • please, specify what script, maybe show the code behind the login.py script and specify what's the actual problem? :) and what does "can't use" mean? – kender May 26 '09 at 11:26

2 Answers2

1

The answer is going to be simple: you can't use pywikipedia without being able to run login.py.

That file not only provides a nice User-interface to try your configuration: it contains all the authentication primitives that we use in the framework to log in. Without logging-in, you can't do much, so no.

If you want a more helpful answer, you'll have to be more precise: as in, why you can't use login.py, and what operations you do need to do with Pywikipedia.

Nicolas Dumazet
  • 7,147
  • 27
  • 36
0

One alternative that worked for me, when I wasn't able to interactively use my remote server (and thus not enter my password), was to copy my credentials to the remote server.

By default your remote permissions are stored in ~/.pywikibot/pywikibot.lwp, and it has worked for me in the past to log in locally, then copy this .lwp file to the remote server, and then I no longer had to enter my password on the remote server.

I don't claim this method to be secure at all, but it is a hack.

notconfusing
  • 2,556
  • 3
  • 22
  • 26
  • Any idea how `~/.pywikibot/pywikibot.wp` gets created? That directory exists but is empty in my pywikibot installation on Fedora 23. – wallyk Jan 30 '16 at 22:55
  • @wallyk, `~/.pywikibot/pywikibot.lwp` is a cookie file, and is created once you successfully log in. If you haven't logged in yet, you probably don't have a `.lwp`. – notconfusing Feb 01 '16 at 02:52
  • Indeed, I logged in months ago and have run a pywikibot script every day. Just a few days ago it prompted for the password again. I was looking for a way to persistently satisfy it, perhaps by putting the password in a config file. – wallyk Feb 01 '16 at 03:51