Skip to main content
RTILA Marketplace

Turn a public watch page into a metrics row and a clean, deduplicated comment dataset

Collect video metrics and top-level comments from public YouTube watch pages into CSV on your own machine.

Social Media Intermediate Stable v1.0.0 Updated Updated 2026-09-18 10 min read
Download
  • Windows x86_64

    BOT_youtube-metrics-comments-collector.exe

    64.5 MB

    Download
  • macOS Apple Silicon chmod +x

    BOT_youtube-metrics-comments-collector.sh

    58.0 MB

    Download
  • macOS Intel chmod +x

    BOT_youtube-metrics-comments-collector.sh

    64.9 MB

    Download
  • Linux x86_64 chmod +x

    BOT_youtube-metrics-comments-collector.sh

    82.3 MB

    Download

Do not rename the downloaded file - the filename carries the bot's configuration id.

This tab summarises what the bot does, what it costs, the technical requirements it places on your machine, and how the author is credited - the starting point before you download anything.

Key facts

What it does
Collect video metrics and top-level comments from public YouTube watch pages into CSV on your own machine.
What it outputs
BOT_youtube-metrics-comments-collector.exe
Difficulty
intermediate
Platforms
windows, macos, macos_intel, linux
Estimated run time
2-10 minutes per video depending on the comment target
Internet at launch
Required
On this page

Overview

The YouTube Metrics and Comments Collector is a YouTube comment scraper: a standalone desktop bot that opens a public watch page, reads the video’s own embedded metadata, scrolls the comment section to a target you set, and saves two datasets - one video_metrics row and one comments row per top-level thread - as CSV files on your machine.

What does the YouTube Metrics and Comments Collector do?

You give it three inputs before a run: video_url (one public watch page, or a list of them, one URL per line), comment_count (the target number of top-level comments, default 50), and sort_order (top for the popular ordering, recent for newest first). The bot then navigates to the video, pulls the title, channel, view count, like count, publish date and duration straight from the player JSON embedded in the page - the same data the page itself renders from, which is far more stable than scraping visible text - and scrolls the comments section until your target is met or the feed ends.

Everything lands locally. The configuration does not pin a custom export filename, so each dataset is written as a CSV named for its dataset key, video_metrics and comments, in the launcher’s output folder. Because the run happens on your desktop, your research interests - which channels you study, which videos you batch, what you do with the sentiment in the comments - never pass through anyone else’s servers.

Two honesty notes up front. First, this build collects top-level threads only; it never expands reply chains. Second, it ships without proxy rotation or CAPTCHA solving, so if a verification wall appears the run logs it and stops rather than fighting through - the failure paths are described further down.

Who uses a YouTube comment scraper or comment export tool?

The content strategist asks “what did the audience actually say about this launch video?” and needs a dated CSV of newest-first comments to code themes against, not a screenshot gallery. The academic researcher asks “can I build a reproducible corpus of comments on these twenty videos for a published study?” and needs batch list mode, exact field provenance and a dataset they collected themselves and can cite. The creator asks “how do my like counts and comment volumes compare across my last ten uploads?” and needs the metrics row per video, re-collected on a schedule they control. All three want an artifact they produced and can defend - rows with video_id, page_url and collection context attached - rather than a dashboard inside someone else’s web app.

How does a YouTube metrics collector run work, step by step?

Every command in the run is linked to its reference page. First, three set_cookie calls fire before any navigation: two consent cookies that preempt the EU cookie interstitial, and one pinning the interface to English. A set_viewport_size call fixes the window at 480x940, and goto loads the watch page - with image, media and font resources blocked for speed. A try_catch block dismisses any consent dialog that still appears, then wait_for_selector confirms the player shell has rendered.

Phase one is metrics: an execute_script step reads the embedded player response and initial-data objects, a bounded search digs out the like count, and eight set_variable calls park the values so the video_metrics dataset can capture them via variable selectors; extract_data writes the row. If the embedded JSON is ever unavailable, a METRICS_DEGRADED marker is logged and the run continues to comments.

Phase two prepares the scroll: a script strips the related-videos sidebar and footer so the document bottom is the end of the comments section, one scroll teleports there to hydrate every lazy sentinel, then a while loop climbs back in gradual 600-pixel steps - gated by is_visible checks for either the first comment thread or the comments-disabled message, capped at 40 tries - because the comment section only mounts when its sentinel is sampled by an intersection observer, never on a jump.

Phase three sorts: an if branch opens the sort menu and clicks Top comments or Newest first explicitly on every run, with scroll_into_view first and a text-based fallback behind the position-based click. Phase four collects: infinite_scroll drives the page with a two-second delay per step, its do block re-stripping the sidebar as insurance, re-extracting the deduplicated comments dataset each cycle, and issuing a break the moment the running total reaches comment_count. A final comment line logs the totals for the run.

Getting YouTube comments to CSV: what lands in each column

The metrics table mirrors the published sample output exactly:

video_idtitlechannelviewslikespublishedduration_seconds
abcdefghijkRestoring a 1972 field recorder - full teardownExample Field Notes18432292142026-08-14942

video_id and channel_id are the platform’s own stable identifiers - join on them across runs and batches rather than on titles, which creators edit. title, channel, views, likes, published and duration_seconds come from the embedded player JSON; views and likes are captured as displayed strings, so strip any formatting in your spreadsheet rather than expecting pre-parsed numbers. description is the open-graph summary, kept for context. page_url records the exact watch page the row came from, which is what makes a multi-video batch auditable.

The comments dataset carries its own columns:

authorauthor_urltextlikespublishedreplies
Example Viewerhttps://www.youtube.com/@exampleviewerGreat teardown - the belt replacement tip saved mine.423 weeks ago5 replies

author and text are trimmed verbatim. author_url is normalised to an absolute channel link by a transformation script. likes is the one normalised field: a script converts display shorthand (1.2K, 3M) into plain integers, defaulting to 0 when no count is shown. published is the platform’s relative label as displayed - “3 weeks ago” - kept raw so the run is auditable against the page. replies is the raw reply-toggle label, not reply content. Deduplication runs on author plus text plus published, which is what lets overlapping scroll batches append safely.

Can it serve as a video analytics scraper for channel research?

Yes, within its shape. A video analytics scraper ultimately answers “how did engagement on these videos move, and what are people saying?” - and a batch run over a channel’s recent uploads, re-run monthly, gives you exactly that: views, likes and comment volume per video_id over time, plus the newest-first comment corpus to read against the numbers. What it will not do is chart anything, alert you, or re-run itself; schedule the launcher with your OS scheduler and diff the CSVs. If you need live dashboards and automated reporting, that is a product category, not this bot - the trade is set out below.

How does it compare to manual copying and hosted collection?

Hand-copying comments works for twenty threads and collapses at two hundred, produces no like counts or timestamps worth trusting, and cannot be repeated identically next month. This bot produces the same deduplicated CSV on your own machine for nothing per run, and the workflow is a file you keep. Against hosted export websites and metered collection platforms - the ones that charge per comment, per record or per month and keep your exports in their cloud - the difference is structural: here the data lands on your disk, the retention and compliance decisions are explicitly yours, and a bigger comment target costs only your own time and bandwidth. Against the platform’s official developer API, the trade is different again: the API is the sanctioned route but runs on a shared daily unit budget that makes large comment pulls a quota-accounting exercise, and it requires a developer project at all. This bot reads the public page like a viewer. The honest costs of local collection: no dashboards, no scheduling, no history, and selector-level maintenance when the page changes.

How do you set it up on Windows, macOS and Linux?

Download the launcher for your platform from this page - a single raw file, no archive and no extraction step anywhere. On Windows, run the downloaded .exe directly; SmartScreen may ask for confirmation on first launch, and “More info” then “Run anyway” proceeds once you have verified the published checksum. On macOS, two launchers are published - check Apple menu, About This Mac for Apple Silicon or Intel and pick the matching one, since running the wrong build is the most common first-launch mistake. Make it executable with chmod +x, clear the Gatekeeper quarantine with xattr -d com.apple.quarantine /path/to/youtube-metrics-comments-collector, then launch. On Linux, the launcher is a single .sh file: chmod +x ./youtube-metrics-comments-collector then ./youtube-metrics-comments-collector - the executable bit can be lost in transfer, so keep the chmod step. Do not rename the file: the filename carries the configuration id. First run asks for the three inputs (video URL, comment target, sort order); for unattended repeats, schedule the launcher with Task Scheduler on Windows, launchd on macOS or cron on Linux.

What do I check when a run returns zero rows?

In order. Metrics empty: is the URL a public watch page that loads in an ordinary logged-out browser, or an embed, age-restricted or region-locked video? A METRICS_DEGRADED marker in the log means the embedded JSON route failed - the comments half may still be fine. Comments empty with a COMMENTS_UNAVAILABLE marker: the section is disabled, restricted, or never rendered in time - confirm by opening the page yourself. Fewer comments than the target but a non-zero file: the video simply has fewer top-level threads than you asked for, or the scroll cap derived from comment_count was reached - raise the target and re-run. Empty likes columns are normal: many threads display no like count, and the transformation defaults them to 0. A run that stops at a verification wall is honest, not broken - this build deliberately ships no solver, so the answer is to slow down, not to fight through. The contract throughout: failure is loud and logged, never fabricated data.

What are the limits of the bot?

It collects what a logged-out viewer can see on one watch page at a time: metrics from the embedded player data and top-level comment threads. It does not expand replies, collect channel pages, playlists, search results or Shorts-specific surfaces, and it does not download video or audio. It has no proxy rotation or CAPTCHA solving in this build, no scheduling of its own, and no alerting - it is a snapshotter, not a monitor. Batch mode processes URLs sequentially with one worker. The comment target is a floor guarantee, not an exact cut: expect overshoot of up to one loading batch. And the metrics route depends on the page’s embedded JSON staying present; when it does not, the bot says so in the log rather than guessing.

What is responsible comment collection?

Comments are user-posted content tied to named or pseudonymous accounts - unambiguously personal data under GDPR, UK GDPR and similar regimes. Establish your lawful basis before repurposing anything, honour deletion and opt-out requests immediately, and never use author names or channel links for unsolicited outreach, spam or profiling of individuals. Review the platform’s terms of service with open eyes: automated collection may conflict with them, and the decision to run is yours to own. Keep request rates at what a patient human could sustain - the two-second scroll delay and single-worker design are there for exactly that reason - and keep your corpus scoped to what your research or reporting actually needs. The acceptable-use policy applies in full before your first run.

#youtube#comments#video-metrics#social-media#scraping#csv-export

Sample output

The first rows a finished run produces. The Output tab documents every dataset and field.

video_idchannel_idtitlechannelviewslikespublishedduration_secondsdescriptionpage_url
abcdefghijkUCexamplechannelidRestoring a 1972 field recorder - full teardownExample Field Notes18432292142026-08-14942A complete teardown and repair of a vintage field recorder, including the sourcing of replacement parts.https://www.youtube.com/watch?v=abcdefghijk

Related resources

Technical details

Launcher version
1.0.0
Minimum runtime version
1.0.0
Internet required at launch
Yes
Update channel
live
Config encoding
plain

Requirements

  • Minimum launcher runtime version: 1.0.0.
  • Supported operating systems: Windows x86_64, macOS Apple Silicon, macOS Intel, Linux x86_64.
  • On macOS Apple Silicon and macOS Intel and Linux x86_64 the launcher is a shell script: if your system flags it as quarantined or strips the executable bit, grant execute permission with chmod +x BOT_youtube-metrics-comments-collector.sh and approve the launcher in Gatekeeper (macOS security settings) before the first run.
  • First launch requires an internet connection to fetch the bot's configuration by id.

Responsible use

See our acceptable use policy and takedown process.

Commands this bot uses

These are the commands the published configuration actually uses.

The count is how many times each command appears in the published configuration; it is derived from the project, not hand-authored.

Frequently asked questions

How do I export YouTube comments to CSV?
Set the video_url input to a public watch page, choose a comment target and a sort order, and run the launcher. The bot scrolls the comment section, extracts each thread into the comments dataset, and saves the result as a CSV in the launcher output folder on your machine - one row per top-level comment, with author, text, normalised like count, published label and the page URL. No cloud account and no conversion step are involved.
How many comments can one run collect?
As many as you ask for, bounded by what the video actually has. The comment_count input defaults to 50 top-level comments; the scroll cap is derived from it automatically (at least 12 scroll steps, plus roughly one step per ten requested comments). Raise the target for deep comment sections; the run stops as soon as the collected total reaches it.
Why does the final comment count exceed the target?
YouTube loads comments in batches of roughly twenty threads. The collector checks the total after each extracted batch and stops once the target is met, so the final file can overshoot by up to one batch - requesting 50 may save up to about 64 rows. This is deliberate: cutting mid-batch would silently drop comments the page had already rendered.
Does it collect comment replies?
No. The bot collects top-level comment threads only and never expands reply chains. The replies column records the raw label shown under a thread (the view-replies toggle text) where one exists, so you can see that replies exist and roughly how many, but reply content itself is out of scope for this build.
Can I scrape multiple videos at once?
Yes. The video_url input supports list mode: enable it and paste one watch-page URL per line, and the engine processes each URL in turn with the same comment target and sort order. Every output row carries its own page_url, video_id and channel_id, so a multi-video batch stays separable after export.
What happens when comments are disabled?
The run stays useful and fails loud. The mounting loop watches for the comments-disabled message; if it appears, or if no comment thread renders in time, the bot logs a COMMENTS_UNAVAILABLE marker and skips collection. The video metrics row is still saved, so you always get the statistics half of the dataset.
How do I sort comments by newest first?
Set the sort_order input to recent (the aliases new and newest are also accepted); the default top collects the popular ordering. The bot never trusts the channel default ordering - it opens the sort menu and clicks the matching entry on every run, with a position-based click first and an exact-English-text fallback second, because the English-locale cookie is pinned before navigation.
Why does the bot set cookies before loading the video?
Three cookies are set first: two consent cookies that preempt the EU cookie interstitial, and one that pins the interface language to English. This keeps runs unattended (no consent dialog to dismiss mid-scroll) and makes the English text fallbacks in the sort menu reliable. If an interstitial still appears, a try/catch block clicks the reject-all or accept-all button and carries on.
How are duplicate comments handled?
The comments dataset de-duplicates on the combination of author, text and published label. Because collection overlaps batches while scrolling - each cycle re-extracts everything currently rendered - deduplication is what makes appending safe: a comment seen in three cycles lands in the CSV exactly once.
Is scraping YouTube comments allowed?
That is your call to own, not the bot's. Automated collection may conflict with the platform's terms of service, and comment text plus author names are personal data under GDPR, UK GDPR and similar regimes. Review the terms, establish a lawful basis before repurposing anything, keep collection to what a patient human viewer could read, and never use the output for spam or profiling.
Does the bot need an internet connection to run?
Yes on first run: the launcher fetches its configuration by id from the backend at launch, so an internet connection is required at least the first time it starts.
Can I rename the downloaded file?
No. The downloaded file must keep its exact name - the filename carries the per-bot configuration id, and renaming it breaks the configuration fetch at launch.