Skip to content

Instantly share code, notes, and snippets.

@geektheripper
Last active August 24, 2020 07:24
Show Gist options
  • Save geektheripper/5605dafe02df239e0fbb4108db8b2fcc to your computer and use it in GitHub Desktop.
Save geektheripper/5605dafe02df239e0fbb4108db8b2fcc to your computer and use it in GitHub Desktop.
傻月月直播间定时发千纸鹤脚本
const token = document.cookie.match(/bili_jct=(.+?);/)[1];
const uid = document.cookie.match(/DedeUserID=(.+?);/)[1];
const sendQzh = async () =>
await (
await fetch("https://api.live.bilibili.com/gift/v2/Live/send", {
headers: { "content-type": "application/x-www-form-urlencoded" },
referrer: "https://live.bilibili.com/4767523",
referrerPolicy: "no-referrer-when-downgrade",
body: `uid=${uid}&gift_id=30666&ruid=128912828&send_ruid=0&gift_num=1&coin_type=gold&bag_id=0&platform=pc&biz_code=live&biz_id=4767523&rnd=1598195851&storm_beat_id=0&metadata=&price=0&csrf_token=${token}&csrf=${token}&visit_id=`,
method: "POST",
mode: "cors",
credentials: "include",
})
).text();
setInterval(sendQzh, Number(prompt("请输入间隔时间(秒)", 30)) * 1000);
@geektheripper
Copy link
Author

使用方式:

  1. 打开直播间
  2. 充够金瓜子
  3. 按 F12,选择 Console 或者 控制台 选项卡
  4. 把上述代码贴上去
  5. 敲下万能的 Enter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment