Does not work with new 2FA enabled
Reddit has implemented a 2FA option. If this is enabled on the account schreddit fails with:
Traceback (most recent call last):
File "/usr/local/bin/shreddit", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/shreddit/app.py", line 44, in main
shredder = Shredder(default_config, args.user)
File "/usr/local/lib/python2.7/dist-packages/shreddit/shredder.py", line 28, in __init__
self._connect()
File "/usr/local/lib/python2.7/dist-packages/shreddit/shredder.py", line 85, in _connect
raise ShredditError("Bad username or password")
shreddit.util.ShredditError: 'Bad username or password'
Disabling 2FA allows it to work again.
this is an issue with praw more so than shreddit. It is supported but a PITA.
Edit praw.ini and in the password field set it so it's password:2fa_code, then run shreddit
That worked one time. Thanks, @arbie65!
Sadly, it stopped working once the 2FA code renewed =/
Hmmm changing the PW field to a 2FA code did nothing for me. I mean, why would that work? Surely you need a password still.
Only way so far is to disable 2fa when you want to use shreddit. Pretty annoying but liveable.
No, you can do it like this: password:2facode
(first the password, then a colon, then the 2fa code)
But it only works once time. The next 2FA code change a minute or two later will break it.
@arcataroger you need to put in the updated 2fa code each time you want to run shreddit.
would it be too much to implement TOTP so a user would provide the shared secret instead of 2FA code? there are libraries for it out there. this is so we could use the script with cron.
@opark this is a request for praw-dev/praw which handles the authentication