|
@@ -9,8 +9,9 @@
|
|
|
⑤提交 submit_slice ownVideo/update?cover=2 → sliceId
|
|
⑤提交 submit_slice ownVideo/update?cover=2 → sliceId
|
|
|
⑥发布 do_publish ownVideo/publish;失败→ownVideo/delete 回滚(C线W7)
|
|
⑥发布 do_publish ownVideo/publish;失败→ownVideo/delete 回滚(C线W7)
|
|
|
⑦挂车 add_goods cps …/match/shelf/item/save(参数化,不残留作者常量)
|
|
⑦挂车 add_goods cps …/match/shelf/item/save(参数化,不残留作者常量)
|
|
|
- ⑧回写 publish_full 返回结果dict(ok/stage/err);publishvideo.state 由 run_dispatcher
|
|
|
|
|
- 流转(完成/失败);anchor.rizhi/jrfb 由集成方(accounts 模块)按结果处理
|
|
|
|
|
|
|
+ ⑧回写 publish_full 返回结果dict(ok/stage/err);run_dispatcher 流转 publishvideo.state
|
|
|
|
|
+ (完成/失败)并回写 anchor:成功记 jrfb、账号禁用置「账号违规异常」、
|
|
|
|
|
+ 挂车登录失效置「Cookie失效」(accounts.release_anchor,C线W6/W7)
|
|
|
|
|
|
|
|
混淆修正(依逆向报告裁决):
|
|
混淆修正(依逆向报告裁决):
|
|
|
- ownVideo/update 查询参数:镜像内被混淆为 caver=2,真实参数为 cover=2;
|
|
- ownVideo/update 查询参数:镜像内被混淆为 caver=2,真实参数为 cover=2;
|
|
@@ -25,7 +26,7 @@ import threading
|
|
|
import time
|
|
import time
|
|
|
from pathlib import Path
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
-from . import config, db, tasks
|
|
|
|
|
|
|
+from . import accounts, config, db, tasks
|
|
|
from .httpclient import KSClient, rand_sleep
|
|
from .httpclient import KSClient, rand_sleep
|
|
|
|
|
|
|
|
# 同 accounts.py/collect.py:契约层 db.exe() 持 _LOCK 调 conn(),而 conn() 内部
|
|
# 同 accounts.py/collect.py:契约层 db.exe() 持 _LOCK 调 conn(),而 conn() 内部
|
|
@@ -484,6 +485,25 @@ def _find_video(cfg, video_id):
|
|
|
return None
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+def _writeback_anchor(anchor_row, res):
|
|
|
|
|
+ """⑧ anchor 状态回写(C线W6/W7):
|
|
|
|
|
+ 发布成功 → 记 anchor.jrfb(「上传完成」时间);
|
|
|
|
|
+ 账号禁用(res.banned) → rizhi='账号违规异常';
|
|
|
|
|
+ 挂车返回「当前登录失效」 → rizhi='Cookie失效'。
|
|
|
|
|
+ 队列 cookie 反查不到 anchor(伪行,uid 为空)时跳过。"""
|
|
|
|
|
+ uid = _row_get(anchor_row, 'uid', '')
|
|
|
|
|
+ if not uid:
|
|
|
|
|
+ return
|
|
|
|
|
+ if res.get('banned'):
|
|
|
|
|
+ accounts.release_anchor(uid, '账号违规异常')
|
|
|
|
|
+ return
|
|
|
|
|
+ if res.get('stage') == 'goods' and 'CK失效' in str(res.get('err', '')):
|
|
|
|
|
+ accounts.release_anchor(uid, False) # → 「Cookie失效」
|
|
|
|
|
+ return
|
|
|
|
|
+ if res.get('ok'):
|
|
|
|
|
+ db.exe('UPDATE anchor SET jrfb=? WHERE uid=?', (db.now(), uid))
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
def run_dispatcher(cfg, max_rounds=None):
|
|
def run_dispatcher(cfg, max_rounds=None):
|
|
|
"""⑧ 定时发布调度线程(C线F3):循环取到期任务(liveTime<=now-10min,即
|
|
"""⑧ 定时发布调度线程(C线F3):循环取到期任务(liveTime<=now-10min,即
|
|
|
tasks.take_due)→ 组装 anchor/代理 → publish_full → 成功置'完成'、失败置'失败'
|
|
tasks.take_due)→ 组装 anchor/代理 → publish_full → 成功置'完成'、失败置'失败'
|
|
@@ -507,6 +527,7 @@ def run_dispatcher(cfg, max_rounds=None):
|
|
|
continue
|
|
continue
|
|
|
anchor = _anchor_for(cfg, row)
|
|
anchor = _anchor_for(cfg, row)
|
|
|
res = publish_full(cfg, anchor, video, row['goodsId'] or '')
|
|
res = publish_full(cfg, anchor, video, row['goodsId'] or '')
|
|
|
|
|
+ _writeback_anchor(anchor, res)
|
|
|
if res.get('ok'):
|
|
if res.get('ok'):
|
|
|
tasks.mark_state(vid, '完成')
|
|
tasks.mark_state(vid, '完成')
|
|
|
logger.info('任务%s:发布完成 photoId=%s', vid, res.get('photo_id'))
|
|
logger.info('任务%s:发布完成 photoId=%s', vid, res.get('photo_id'))
|