Skip to main content

Zhihu QRCode Login

One line to login Zhihu by QRCode.

Usage

from zhihu_qrcode_login import login_handler
import logging

# if remember_me = True, the cookies will be saved in your disk, 
# and next time you can login without scanning QRCode.
# if you pass a logger into it, it can output some useful log.
# return requests.Session
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger('test')
session = login_handler.login(remember_me=True, logger=logger)
# and later you can also use get_session() to get the session.
# session = login_handler.get_session()

# use it!
# you can use get_visit_headers() to get the headers which can visit Zhihu successfully.
session.get('https://www.zhihu.com/collections/mine', headers=login_handler.get_visit_headers())

TODO

  1. Handle the condition that users scan the QRCode but cancel the login confirmation.
  2. Find more elegant approach to open and close the QRCode.

Metadata

Release files for Zhihu-QRCode-Login 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Zhihu-QRCode-Login 0.0.2
File Size Uploaded
Zhihu QRCode Login-0.0.2.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Zhihu-QRCode-Login 0.0.2
File Interpreter ABI Platform
Zhihu_QRCode_Login-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / Zhihu QRCode Login-0.0.2.tar.gz

Download URL Zhihu QRCode Login-0.0.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a516804f60e9134272ecf4f65b0800cf4cfdb424d485185a7de06bf8f9664aad
BLAKE2b-256 checksum
How to use checksums
36398dd9ac04accb027397692bb1977bc37e9fcf00f0157650d99d7dff6b7c34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.0

Release files / Zhihu_QRCode_Login-0.0.2-py3-none-any.whl

Download URL Zhihu_QRCode_Login-0.0.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa778890713cd9621a486423a204747377d79395544bab62729ce786b4a9a461
BLAKE2b-256 checksum
How to use checksums
976ded1d0018b7b746626818cbf4b8ae12f5f8b9d24085db347f20e71122a2b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page