You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何批量选中YouTube筹款页面的所有视频复选框?

可汗学院YouTube筹款页全选视频解决方案

由于页面未提供全选按钮,且YouTube使用自定义SVG复选框而非标准元素,可通过Chrome开发者工具控制台执行脚本实现批量选中:

方法一:选中已加载的未选视频

  1. 打开目标筹款页面,按下F12或Ctrl+Shift+I打开开发者工具,切换到Console标签
  2. 粘贴以下代码并回车执行:
// 定位所有未选中的视频选择器并触发点击
document.querySelectorAll('ytcp-video-selector:not([selected])').forEach(el => el.click());

方法二:自动加载全部视频后全选

如果视频数量过多,页面仅加载部分内容,可使用此脚本自动滚动加载所有视频后批量选中:

function loadAndSelectAll() {
  const currentScrollHeight = document.documentElement.scrollHeight;
  window.scrollTo(0, currentScrollHeight);
  setTimeout(() => {
    const newScrollHeight = document.documentElement.scrollHeight;
    if (newScrollHeight > currentScrollHeight) {
      loadAndSelectAll();
    } else {
      // 加载完成后批量选中未勾选的视频
      const unselectedItems = document.querySelectorAll('ytcp-video-selector:not([selected])');
      unselectedItems.forEach(el => el.click());
      console.log(`完成:共选中 ${unselectedItems.length} 个视频`);
    }
  }, 1200); // 滚动间隔可根据网络速度调整,单位毫秒
}

loadAndSelectAll();

注意事项

  • 若执行后仍有未选中的视频,可手动滚动加载剩余内容,再重新执行方法一的代码
  • 确保当前页面处于筹款视频选择界面,避免在其他YouTube页面执行脚本引发错误

内容的提问来源于stack exchange,提问作者Jeremy Schifeling

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 05:35:20