Skip to main content

a tool which signs your bars on Baidu Tieba

Project description

安装

$ sudo pip install mpsign

API

MPSIGN 的所有核心功能均在 mpsign.core 模块下。以下是一些示例。

  • 获取喜欢的吧

    >>> from mpsign.core import User
    >>> user = User('YOUR BDUSS')  # 此处的 BDUSS 可从 baidu.com 域下的 Cookies 找到
    >>> (user.bars[0].kw, user.bars[0].fid)
    ('chrome', '1074587')
  • 签到

    >>> from mpsign.core import User, Bar
    >>> user = User('YOUR BDUSS')
    >>> bar = Bar(kw='chrome', fid='1074587')
    >>> bar.sign(user)
    SignResult(message='亲,你之前已经签过了', exp=0, bar='chrome', code='160002')

    注: user.sign(bar)bar.sign(user) 等价。

    >>> [user.sign(bar) for bar in user.bars]
    ...a list of SignResult
  • 检验 BDUSS 是否合法

    >>> from mpsign.core import User
    >>> is_valid = User('AN INVALID BDUSS').verify()
    False
  • TBS

    >>> from mpsign.core import User
    >>> user = User('YOUR BDUSS')
    >>> user.tbs
    ...

命令行工具

MPSIGN 提供一个现成的命令行工具,自带一个轻量的用户管理系统。所有的用户信息都会被储存在 ~/.mpsign 之下。你可以配合 Linux Crontab 与此工具快速设置一个全自动的签到系统。

基本用法

$ mpsign --help
Usage:
  mpsign (new|set) <user> <bduss> [--without-verifying]
  mpsign (delete|update) [<user>]
  mpsign sign [<user>] [--delay=<second>]
  mpsign info [<user>]
  mpsign -h | --help
  mpsign -v | --version

Options:
  -h --help             Show this screen.
  -v --version          Show version.
  --without-verifying   Do not verify BDUSS.
  --bduss               Your Baidu BDUSS.
  --user                Your ID, used for identify.
  --delay=<second>      Delay for every single bar [default: 3].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpsign-1.3.tar.gz (5.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page