Repository navigation
Conversation
Add 'profile policy show|edit|set' for profiles/<name>/moderation.md, built on the same show/edit/set code as 'profile brand'. Add an owner-only append-only JSONL log in the profile directory.
- comments list follows nextPageToken up to --limit - --status now applies together with --video - reject, publish and reply preview by default; --execute applies - the preview resolves ids from the API (thread, comment, held and spam queues), then from the local log; unknown ids stop the command - each batch is logged before the API call; on failure the command stops and reports applied and unapplied ids - -o json adds deterministic signals (links, duplicates, author channel id, impersonation suspect) - comments list --unanswered
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
+ Coverage 85.66% 86.40% +0.73%
==========================================
Files 15 16 +1
Lines 2686 2964 +278
Branches 401 458 +57
==========================================
+ Hits 2301 2561 +260
- Misses 258 264 +6
- Partials 127 139 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- catch network, timeout and httplib2 errors in the batch loop - report 5xx and network failures as status unknown, not as unapplied - duplicate_of points to the earliest qualifying earlier copy - preview passes the owner, so impersonation_suspect shows - rename off_channel_link to off_youtube_link - request textFormat=plainText on lookups and lists - write the moderation log through os.fdopen - docs: fallback cost, three result groups
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal for the v1 scope of #57. All items are in. The 0a live check is still open (see below), so this PR is "Part of" and not "Closes".
Changes per item
fetch_comments()followsnextPageTokenuntil--limit.-n 500now returns up to 500.--statustogether with--video.comments list -v X --status heldreturns the held queue of that video.profile policy show|edit|setforprofiles/<name>/moderation.md. Brand and policy now use one show/edit/set factory, so the two cannot drift.showprints the file verbatim.reject,publishandreplyare dry-run by default and need--execute.--banalso needs--execute. The preview gets author, text and video from the API. It searches for ids in this order:commentThreads.list(id=),comments.list(id=), the held and spam queues, then the local log. If the CLI cannot find an id, the command stops, also with--execute. Each batch of 50 goes tomoderation-log.jsonl(0600, fsync) before the API call, with anapplied,unknownorfailedline after it. If a batch fails, the command stops and exits with code 1. It prints three groups: applied, status unknown (5xx, timeout or network error, so check these) and not applied (never sent, or refused with a 4xx).-o jsonaddsauthor_channel_id,reply_count,has_link,link_hosts,off_youtube_link,duplicate_ofandimpersonation_suspect. The impersonation check strips the@of the handle and compares with the channel title and handle. It only flags authors that are not the owner.comments list --unanswered: published threads with no reply from the owner. It readspart=snippet,repliesand callscomments.list(parentId=)only whentotalReplyCountis higher than the inline replies.docs/api-quota.mdhas a new quota note. I updated the docs incomments.mdandprofiles.md.0a result
I did not do the 0a live check. The stored refresh token of the default profile is revoked ("Session expired or revoked"). A new login needs browser consent. I made no live calls. The resolver works for both outcomes. If
commentThreads.list(id=)does not return held comments, the preview finds them in the held or spam queue (1 unit per 100 comments). That is still API data and not text from the agent. Please run once afterytstudio login:If the preview shows the comment, the result answers 0a for this code path.
Release
Release this as 0.6.0 (0.5.0 is already on PyPI). The release notes must name the dry-run flip:
comments reject,comments publishandcomments replynow only preview. Scripts must add--executeto apply. I did not change the version in this PR.Open questions
replykeeps--execute, and an unknown id blocks the whole command.listrun. Cross-run detection needs stored state, which is out of scope for v1.Follow-ups
--unansweredreturns newest first. An oldest-first sort needs a full scan, because the API has no ascending order.Part of #57