{"id":13492369,"url":"https://github.com/gera2ld/qqlib","last_synced_at":"2025-03-28T10:32:00.734Z","repository":{"id":30679878,"uuid":"34235742","full_name":"gera2ld/qqlib","owner":"gera2ld","description":"[DEPRECATED] QQ login library based on webqq","archived":true,"fork":false,"pushed_at":"2017-08-10T09:55:35.000Z","size":40,"stargazers_count":157,"open_issues_count":7,"forks_count":85,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-23T07:34:35.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gera2ld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-20T03:28:03.000Z","updated_at":"2025-01-24T08:49:44.000Z","dependencies_parsed_at":"2022-09-08T07:01:38.455Z","dependency_job_id":null,"html_url":"https://github.com/gera2ld/qqlib","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fqqlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fqqlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fqqlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gera2ld%2Fqqlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gera2ld","download_url":"https://codeload.github.com/gera2ld/qqlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246012538,"owners_count":20709464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:01:05.400Z","updated_at":"2025-03-28T10:32:00.295Z","avatar_url":"https://github.com/gera2ld.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"qqlib\n===\n[![PyPI](https://img.shields.io/pypi/v/qqlib.svg)]()\n\nPython版QQ登录库，兼容Python2.x和Python3.x。\n\n安装\n---\n``` sh\n$ pip install qqlib\n# or\n$ pip install git+https://github.com/gera2ld/qqlib.git\n```\n\n快速开始\n---\n``` sh\n$ python -m qqlib\n```\n\n高级用法\n---\n``` python\ndef login(qq):\n    # 不考虑验证码的情况，直接登录\n    qq.login()\n\nimport qqlib\nqq = qqlib.QQ(12345678, 'password')\nlogin(qq)\nprint('Hi, %s' % qq.nick)\n```\n\n登录时有可能出现需要验证码的情况，可以捕获到`qqlib.NeedVerifyCode`错误。这时`qq.need_verify`为`True`，需要获取验证码图片（`qq.verifier.fetch_image()`）进行处理，验证（`qq.verifier.verify(code)`）之后再继续登录。下面是支持输入验证码的`login`方法：\n``` python\ndef login(qq):\n    # 自动重试登录\n    while True:\n        try:\n            if qq.need_verify:\n                open('verify.jpg', 'wb').write(qq.verifier.fetch_image())\n                print('验证码已保存到verify.jpg')\n                # 输入验证码\n                vcode = input('请输入验证码：')\n                qq.verifier.verify(vcode)\n            qq.login()\n            break\n        except qqlib.NeedVerifyCode as exc:\n            if exc.message:\n                print('Error:', exc.message)\n```\n\nQZone：\n``` python\nfrom qqlib import qzone\nqq = qzone.QZone(12345678, 'password')\n# 登录流程同上\nlogin(qq)\nqq.feed('发一条说说')\n```\n\n测试\n---\n``` sh\n# Python 2\n$ python -m unittest discover\n\n# Python 3\n$ python3 -m unittest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fqqlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgera2ld%2Fqqlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgera2ld%2Fqqlib/lists"}