탐색으로 건너뛰기

How do I use a Channels share link, sph ID or export ID to research videos and comments?

Use a v2_…@finder ID to list an account’s videos and a numeric video ID to read comments on one video. If you only have a share link or an export/… identifier from WeChat Search, fetch the video details with data:wechat_channels.v2.fetch_video_detail first, verify the returned title and account, then use the returned numeric video ID for comments. An sph… account short ID needs conversion with data:wechat_channels.v2.fetch_channel_id_to_username before the account list.

Choose the next step from the identifier you have

Available informationFirst stepContinue with
A v2_…@finder account identifierUse the identifier directly for the account-video listVideo directory or account-topic search
An sph… account short ID from the appResolve the short ID with data:wechat_channels.v2.fetch_channel_id_to_usernameRetrieve the resolved account’s videos
A numeric video IDRetrieve the video with data:wechat_channels.v2.fetch_video_detailReview comments or use the returned account identifier
An export/… value from searchSupply the value as the detail request’s export_idUse the returned numeric video ID for comments
An https://weixin.qq.com/sph/… share linkSupply the link as the detail request’s share_urlConfirm video and account, then retrieve comments or the account list

An export/… value locates a video for the detail request; an export/… value is not a numeric comment-target ID. Keep the export/… string as copied: do not decode the string, and do not assume a fixed validity period.

When WeChat Search gives you only an export/… identifier, request the video detail with the export/… value. Save both the original search identifier and the verified numeric video ID. Request comments with the numeric video ID, and keep the search identifier to trace how you found the post.

Look up comments from a shared video

POST the body below to https://api.beatapi.io/v1/social-data/call with BeatAPI Bearer authentication. Replace the example link with the complete Channels share link you received.

{"action":"wechat_channels.v2.fetch_video_detail","params":{"share_url":"https://weixin.qq.com/sph/example","raw":false}}

For example, a colleague sends a product-introduction video, and you want to identify the video’s account and investigate viewer questions:

  1. Retrieve the video details with the share link, and confirm that the returned title and account match the target.
  2. Save data.id as the video ID and data.username as the account identifier, together with the collection time and the original response.
  3. Use the video ID for the comment workflow, or the account identifier for the account’s video directory.

Reuse the verified video ID and account identifier for later steps. Do not resolve the same link again just to organize a table.

For an assistant connected to BeatAPI:

Confirm this video’s title and publishing account, then review its available comments for questions about product eligibility. Keep the original wording and discussion context. If research needs the account’s other videos, first show relevant candidates.

data:wechat_channels.v2.fetch_video_detail applies its inputs in priority order: object_id, then export_id, then share_url. Supply only the one target you intend to inspect. Do not combine an old video ID with a new share link.

Keep account identifiers, video IDs and parent-comment IDs separate. object_nonce_id is an auxiliary detail locator, not a parent comment’s comment_id. To expand a reply thread, use the actual parent-comment identifier from the comments response.

Prepare one unambiguous target locally

channels_identity.py (below) prepares a request for one input type. After you save a real response, channels_identity.py prepares the account-list request or the comment request, keeps the sources and checks the returned identifiers. Creating the request files does not run any retrieval.

The same visible string is not a universal WeChat identifier, so choose one explicit input type:

  • A v2_…@finder account goes directly to the account-video list.
  • An sph… account short ID needs conversion first.
  • A numeric video ID, an export/… search identifier and an HTTPS Channels share link select the video-detail route.

channels_identity.py never treats an account name or account ID as a video ID, and never fills the three competing detail fields at once.

  1. Save the Python script at the end of this page as channels_identity.py.
  2. Run the one prepare command that matches your input. The commands only write JSON, and the values are placeholders:
python3 channels_identity.py prepare account 'COPIED_V2_USERNAME@finder' account-request
python3 channels_identity.py prepare channel 'COPIED_SPH_SHORT_ID' conversion-request
python3 channels_identity.py prepare export 'export/COPIED_EXACT_VALUE' detail-request
python3 channels_identity.py prepare video 'COPIED_NUMERIC_VIDEO_ID' detail-request
python3 channels_identity.py prepare link 'https://weixin.qq.com/sph/COPIED_SHARE_TOKEN' detail-request
  1. Replace the placeholder with the exact copied value; channels_identity.py rejects the placeholders. A real share URL must use the weixin.qq.com/sph/ host and path, with no query or fragment. Do not strip extra URL data silently, and do not infer a token from arbitrary sharing text. Treat export/… identifiers as opaque strings: do not decode an export/… value, change capitalization, or calculate an object_id from the string. No expiry duration is promised for export/… identifiers.
  2. Check the selected action in request.json, then estimate the resolution request plus the chosen list or comment request with current pricing. Skip resolution when a usable identifier is already available, and continue local processing from saved responses.
  3. For an approved conversion or detail request, save the full direct response once in a new directory:
mkdir captured-call &&
curl --fail-with-body -sS https://api.beatapi.io/v1/social-data/call -H "Authorization: Bearer $BEATAPI_API_KEY" -H 'Content-Type: application/json' --data-binary @detail-request/request.json -D captured-call/headers.txt -o captured-call/response.json

For an sph ID conversion, send conversion-request/request.json instead. Check the HTTP status and the saved response before verification, and do not rerun the request into the same files.

Turn the saved resolution into the correct next request

  1. Run python3 channels_identity.py verify detail-request/request.json captured-call/response.json identity-review. For an account conversion, substitute conversion-request/request.json.
  2. Check what channels_identity.py verify accepts:
    • With raw:false, the conversion response returns data.channel_id and data.username. channels_identity.py requires the channel_id echo to match the input and data.username to have the published finder format.
    • The detail response returns data.id and data.username. channels_identity.py accepts only an original nonzero digit-string ID or a safe positive integer; an unsafe numeric ID cannot be repaired after rounding. For a numeric input, the returned ID must match the requested ID exactly.
    • For an export or share-link input, compare the returned title and account with the intended video yourself. The local source hash does not prove which video the resolution returned.
  3. Read the private output folder identity-review. The folder keeps the exact source bytes and an identity audit, and contains an unexecuted account-videos-request.json. A valid video detail also produces comments-request.json with the video’s ID, an empty parent and the first-page cursor. account-videos-request.json and comments-request.json are alternative next steps; run only the one your research needs.

channels_identity.py verify stops without output on a conversion with no match, a wrong echo, a failed envelope, an invalid username or an unsafe video ID. A parsed conversion selects the matching account item; the conversion does not prove account ownership, and a similar display name is not enough to choose the next target.

After choosing and collecting either the account-video list or the comment step, export the results with the account-page exporter or the comment exporter. Keep the raw detail response private because the raw detail can contain media URL tokens and decoding keys that identifier handoff does not need. channels_identity.py never downloads or decrypts media. Source hashes check local byte consistency rather than server authenticity. Contract basis: the documented WeChat Channels v2 action input and response schemas.

import hashlib
import json
import os
import re
import sys
from pathlib import Path
os.umask(0o077)
DETAIL = 'wechat_channels.v2.fetch_video_detail'
CONVERT = 'wechat_channels.v2.fetch_channel_id_to_username'
LIST = 'wechat_channels.v2.fetch_user_videos'
def finder(value):
return isinstance(value, str) and 10 <= len(value) <= 256 and re.fullmatch(r'v2_[0-9a-fA-F]+@finder', value)
def numeric(value):
if type(value) is int and 0 < value <= 9007199254740991:
return str(value)
if isinstance(value, str) and re.fullmatch(r'[0-9]{1,32}', value) and any(c != '0' for c in value):
return value
raise ValueError('Require an original nonzero digit string or safe positive integer ID')
def prepare(kind, value):
params = {'raw': False}
if kind == 'account' and finder(value):
return {'action': LIST, 'params': {'username': value, 'raw': False, 'last_buffer': ''}}
if kind == 'channel' and len(value) <= 64 and re.fullmatch(r'sph[A-Za-z0-9_-]+', value):
return {'action': CONVERT, 'params': {'channel_id': value, 'raw': False}}
if kind == 'video':
params['object_id'] = numeric(value)
elif kind == 'export' and isinstance(value, str) and len(value) <= 2048 and re.fullmatch(r'export/[^\s]+', value):
params['export_id'] = value
elif kind == 'link' and len(value) <= 256 and re.fullmatch(r'https://weixin\.qq\.com/sph/[A-Za-z0-9]+/?', value):
params['share_url'] = value
else:
raise ValueError('Type does not match copied identifier; do not convert or infer it')
return {'action': DETAIL, 'params': params}
mode = sys.argv[1]
if mode == 'prepare':
kind, value, destination = sys.argv[2:5]
request = prepare(kind, value)
out = Path(destination)
files = {'request.json': request, 'audit.json': {'input_kind': kind, 'executed_calls': 0, 'target_review_required': True}}
archives = {}
elif mode == 'verify':
request_file, response_file, destination = map(Path, sys.argv[2:5])
request_bytes, raw = request_file.read_bytes(), response_file.read_bytes()
request, response = json.loads(request_bytes), json.loads(raw)
if not isinstance(request, dict) or set(request) != {'action', 'params'}:
raise ValueError('Use the saved prepared request')
action, params = request['action'], request['params']
if not isinstance(params, dict) or params.get('raw') is not False:
raise ValueError('This verifier requires explicit raw:false')
if action == CONVERT and set(params) == {'channel_id', 'raw'}:
expected = prepare('channel', params['channel_id'])
elif action == DETAIL:
fields = [key for key in ['object_id', 'export_id', 'share_url'] if key in params]
if len(fields) != 1 or set(params) != {'raw', fields[0]}:
raise ValueError('Exactly one target identifier; no priority ambiguity')
field = fields[0]
expected = prepare({'object_id':'video', 'export_id':'export', 'share_url':'link'}[field], params[field])
else:
raise ValueError('Verify only channel conversion or video detail here')
if request != expected:
raise ValueError('Prepared request changed')
if not isinstance(response, dict) or response.get('status') != 'succeeded' or response.get('action') != action or response.get('error') is not None:
raise ValueError('Expected successful matching action response')
rid, data = response.get('request_id'), response.get('data')
if not isinstance(rid, str) or not rid.strip() or not isinstance(data, dict) or data.get('error') not in (None, ''):
raise ValueError('Missing provenance, no match or invalid data')
username = data.get('username')
if not finder(username):
raise ValueError('No valid finder username; do not use display name instead')
if any(data.get(key) is not None and not isinstance(data[key], str) for key in ['nickname', 'title']):
raise ValueError('Expected text title/nickname')
audit = {'action': action, 'request_id': rid, 'request_sha256': hashlib.sha256(request_bytes).hexdigest(), 'response_sha256': hashlib.sha256(raw).hexdigest(), 'username': username, 'nickname': data.get('nickname'), 'title': data.get('title'), 'executed_calls': 0, 'target_review_required': True}
files = {'account-videos-request.json': prepare('account', username)}
if action == CONVERT:
if data.get('channel_id') != params['channel_id']:
raise ValueError('Conversion input echo does not match')
audit['channel_id'] = params['channel_id']
else:
object_id = numeric(data.get('id'))
if 'object_id' in params and object_id != params['object_id']:
raise ValueError('Returned object ID does not match requested video')
audit['object_id'] = object_id
audit['target_check'] = 'For export/share input, review returned title/account against intended video; a local hash does not prove resolution identity'
files['comments-request.json'] = {'action':'wechat_channels.v2.fetch_video_comments', 'params':{'object_id':object_id, 'comment_id':'', 'last_buffer':'', 'raw':False}}
files['identity-audit.json'] = audit
archives = {'source-request.json': request_bytes, 'source-response.json': raw}
out = destination
else:
raise ValueError('Use prepare TYPE VALUE OUTPUT or verify REQUEST RESPONSE OUTPUT')
out.mkdir(mode=0o700, exist_ok=False)
for name, value in files.items():
(out/name).write_text(json.dumps(value, ensure_ascii=False, indent=2), encoding='utf-8')
for name, value in archives.items():
(out/name).write_bytes(value)
print(str(out))