A baidu tieba Library, easy to use and Dama2 connected.
- python3 (requests Lib, rsa Lib)
- Dama2 Account(optional)
You can initialize a Tieba instance by
user = Tieba("username", "password")
First it will check cookies in cookies.json
({"BDUSS": "xxxx"}
), if it's still active, than everything is OK, or it will try to log in. In case of annoying verify code, you should first initialize your Dama2 account:
dmt = DamatuApi("username", "password")
user = Tieba("username", "password", dmt)
This way the program will upload the verify code to Dama2 and try to log in.
Or you can switch to enter verify code manually, just leave dmt = None
user = Tieba("username", "password", None)
So when a verify code is needed, the program will save the captcha in verifycode.png
, and you will be prompted to enter the verify code.
Once you're log-in, you can do such things
Sign to a specific Tieba.
user.sign("kingdomrush")
Get all Tiebas that User's likes
user.get_likes()
Reply to a specific post.
user.reply('3986970534', "test")
You can also use the statement below
user.reply('http://tieba.baidu.com/p/3986970534', "test content")
Commit a theme post to the Tieba.
user.commit('vb2012', 'test title', 'test content')
###Python Console ADD SOME descriptions????
sys.path.append(r".\BaiduLibrary")
from main import Tieba
user = Tieba("username", "password")
user.sign("steam")
And more operations is on the way……