-哔哩猫-(试用版)

注:练手作品,多多包涵,不接受恶意差评,有问题群内咨询(Q群1031014013):批量播放视频;批量拉黑;批量关注;动态艾特消息提醒(友情天选群746790091 )

当前为 2021-11-13 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/422731/987883/-%E5%93%94%E5%93%A9%E7%8C%AB-%EF%BC%88%E8%AF%95%E7%94%A8%E7%89%88%EF%BC%89.js

  1. // ==UserScript==
  2. // @name -哔哩猫-(试用版)
  3. // @description 注:练手作品,多多包涵,不接受恶意差评,有问题群内咨询(Q群1031014013):批量播放视频;批量拉黑;批量关注;动态艾特消息提醒(友情天选群746790091 )
  4. // @namespace http://tampermonkey.net/
  5. // @version 2.4.89
  6. // @iconURL https://gitee.com/java_cn/BILIBLI_RES/raw/master/PIC/PC_1606377718.gif
  7. // @author 荒年(QQ:2019676120)
  8. // @match *://space.bilibili.com/*
  9. // @match *://www.bilibili.com/v/newbie/*
  10. // @match *://www.bilibili.com/judgement/*
  11. // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
  12. // @require https://cdn.jsdelivr.net/gh/java-xiaoyi/HNGG-RES@ea375a9d65253039a2ef8cde53b6a3cf421a022c/javaex/pc/js/javaex.min.js
  13. // @require https://cdn.jsdelivr.net/gh/java-xiaoyi/HNGG-RES@ea375a9d65253039a2ef8cde53b6a3cf421a022c/javaex/pc/js/javaex-formVerify.js
  14. // @resource animate http://cdn.javaex.cn/javaex/pc/css/animate.css
  15. // @resource common http://cdn.javaex.cn/javaex/pc/css/common.css
  16. // @resource defaultCss http://cdn.javaex.cn/javaex/pc/css/skin/default.css
  17. // @grant unsafeWindow
  18. // @grant GM_getValue
  19. // @grant GM_setValue
  20. // @grant GM_xmlhttpRequest
  21. // @grant GM_getResourceText
  22. // @grant GM_openInTab
  23. // @grant GM_addStyle
  24. // @run-at document-idle
  25. // @license MIT License
  26. // @connect github.com
  27. // @connect gitee.com
  28. // @connect api.bilibili.com
  29. // @connect qmsg.zendee.cn
  30. // @connect biliapi.net
  31. // @connect qcloud-sdkact-api.biligame.com
  32. // @connect passport.bilibili.com
  33. // @connect api.live.bilibili.com
  34. // @connect mcloc.cn
  35. // @namespace http://tampermonkey.net/
  36. // ==/UserScript==
  37.  
  38.  
  39.  
  40.  
  41. GM_addStyle(
  42. `
  43.  
  44. #switch-qsmg:before {
  45. content: "开关";
  46. letter-spacing: 16px;
  47. top: 4px;
  48. left: 10px;
  49. }
  50. #left_navbar{
  51. z-index: 1000;
  52. position: absolute;
  53. top: 100px;
  54. left: 5px;
  55. }
  56. button[hnBtn="btn_open"] {
  57. z-index: 1001;
  58. z-index: 1000px;
  59. position: absolute;
  60. top: 58px;
  61. left: 220px;
  62. }
  63. .javaex-panel.javaex-panel-right.javaex-animated-zoom-in {
  64. top: 60px;
  65. }
  66. .javaex-menu-container {
  67. border: 1px solid #eee;
  68. }
  69. .javaex-panel-box p {
  70. text-align: center;
  71. background: #fb7299;
  72. }
  73. .fontbold{
  74. color: #00a1d6;
  75. font-weight: bold;
  76. cursor: pointer;
  77. }
  78. .hideLogo {
  79. position: absolute;
  80. top: 88px;
  81. left: 10px;
  82. width: 50px;
  83. height: 57px;
  84. z-index: 9999;
  85. cursor: pointer;
  86. }
  87. #auto_check_question {
  88. position: absolute;
  89. border-radius: 20%;
  90. font-size: 24px;
  91. text-align: center;
  92. border: 2px solid red;
  93. top: 91%;
  94. right: 44%;
  95. width: 81px;
  96. color: #fff;
  97. cursor: pointer;
  98. z-index: 999;
  99. }
  100. `
  101. );
  102.  
  103.  
  104. let HN_SETUP_CONFIG = {
  105.  
  106. qmsg_key: null, //后期改为kull 存储到本地
  107. qmsg_checked: false,
  108. Booking_last_sid: null,
  109. }
  110.  
  111. let replyList = ["哇⊙ω⊙", "仙女震惊", "都关注这么久了给个吧", "大佬,看下孩子吧,这次一定", "会有我吗?黑幕一手",
  112. "酋长在线拉低中奖率", "好耶(✪▽✪)", "好运", "希望欧一次", "永不缺席", " 永不中奖", " 永不放弃!", "万一呢", "在", "冲吖~", "来了",
  113. "芜湖,都想要,抽中那个都不亏阿", "从未中,从未停", "来力", "秋", "懂我意思吧", "今天去吃面", "从不缺席",
  114. "站友保佑抽到", "可以", "恰", "不会吧", "233", "好耶", "rush", "来了!!!", "来来", "ok", "冲", "凑热闹", "我要我要", "我还能中!", "让我中!!!",
  115. "是我的", "我是天选之子?", "给我中一次吧!", "坚持不懈,迎难而上", "开拓创新!", "我来抽个奖", "中中中中中", "我我我", "搞笑 这不得转", "我下手了",
  116. "看这里就想中一次", "不可能", "我不挑,都可以", "俺要当分母", "万一呢"
  117. ]
  118.  
  119.  
  120. let Live_info = {
  121. room_id: undefined,
  122. uid: undefined,
  123. blocked: undefined,
  124. csrf_token: undefined,
  125. SESSDATA: undefined,
  126. visit_id: undefined,
  127. rnd: undefined,
  128. ruid: undefined,
  129. uname: undefined,
  130. user_level: undefined,
  131. ruid: undefined,
  132. };
  133.  
  134. let BILIBLI_PATH = {
  135.  
  136. "live": "https://api.live.bilibili.com",
  137. "vcapi": "https://api.vc.bilibili.com",
  138. "passport": "https://passport.bilibili.com",
  139. "api": "https://api.bilibili.com",
  140. "video": "https://www.bilibili.com/video/",
  141. "single_unread": "http://api.vc.bilibili.com/",
  142.  
  143. }
  144.  
  145. let BILIBILI_URL = {
  146. // 导航栏用户信息
  147. "nav": BILIBLI_PATH.api + "/x/web-interface/nav",
  148. }
  149.  
  150. let BiliData = {
  151.  
  152. this_uid: window.location.href.split("/")[3], //当前页面uid
  153. author_uid: 99439379,
  154. login_code: null,
  155. login_message: "",
  156. LoginData: {},
  157. CoinLog: {},
  158. Unread: null,
  159. Video: {},
  160. replyAction: {},
  161. upCard: {},
  162. BVList: [],
  163. }
  164.  
  165. window.onload = function() {
  166.  
  167.  
  168. //界面显示
  169. init();
  170.  
  171.  
  172.  
  173. addHideLogo();
  174.  
  175.  
  176. /* var myVar = setInterval(function() {
  177. console.log("yunxing");
  178. AA ();
  179.  
  180. }, 1000);
  181.  
  182.  
  183. function AA (){
  184. if ((new Date()).getMinutes() == 47) {
  185.  
  186. console.log("stop");
  187. clearInterval(myVar);
  188. }
  189. } */
  190.  
  191.  
  192. }
  193.  
  194. function addHideLogo() {
  195.  
  196. let isHide = true;
  197.  
  198. $("#left_navbar").after(
  199. '<div id="hideLogo" class="hideLogo"> <img src="https://gitee.com/java_cn/BILIBLI_RES/raw/master/PIC/PC_1606377718.gif" alt="点击显示隐藏" width="100%" height="100%"></div>'
  200. );
  201. if (isHide) {
  202. $("#left_navbar").hide();
  203. isHide = false;
  204. } else {
  205. isHide = true;
  206. }
  207. $("#hideLogo").bind("click", async function() {
  208.  
  209. if (isHide) {
  210. $("#left_navbar").hide();
  211. isHide = false;
  212. } else {
  213. $("#left_navbar").show();
  214. isHide = true;
  215. }
  216. });
  217.  
  218. let newbie = window.location.href.indexOf("newbie") > -1;
  219. if (newbie) {
  220. $("#hideLogo").hide();
  221. //document.querySelector(".tv-type-text").innerHTML += '<span id="auto_check_question">答题</span>';
  222. $("#basic-1").after('<span id="auto_check_question">答题</span>');
  223. $("#basic-2").after('<span id="auto_check_question">答题</span>');
  224.  
  225. $("#optional-qa").after('<span id="auto_check_question">答题</span>');
  226.  
  227. }
  228.  
  229. /**
  230. * 一键答题
  231. */
  232.  
  233. $("#auto_check_question").bind("click", async function() {
  234.  
  235. for (let i = 0; i < 60; i++) {
  236.  
  237. //1.查询状态
  238. let status = await HNAPI.answer_status();
  239. await HNTOOL.Sleep(1000);
  240.  
  241. if (status.number == 90 || status.score >= 62 ) {
  242. window.location.reload();
  243. }
  244.  
  245. if (status.status != 3 && status.result == "failed") {
  246. // 基础题
  247. if (status.stage == "base") {
  248. //拉取题目
  249. let base = await HNAPI.pull_answer("base");
  250. if (base == 1) {
  251. continue;
  252. }
  253. if (base == false) {
  254. alert("基础题答题错误:答题过快或错误太多||用户答题记录不存在");
  255. break;
  256. }
  257. let question = base.question;
  258. for (let j = 0, len = question.options.length; j < len; j++) {
  259.  
  260. //1.答题
  261. let check = await HNAPI.answer_check(question.id, question.options[j].hash, "base");
  262. if (check == 1) {
  263. continue;
  264. }
  265. await HNTOOL.Sleep(1000);
  266. if (check.passed == true) {
  267. console.log("开始基础题第" + question.number + "题!---当前得分:" + status.score);
  268. javaex.tip({
  269. content: "开始基础题第" + question.number + "题!---当前得分:" + status.score,
  270. type: "success"
  271. });
  272. break;
  273. }
  274. }
  275.  
  276.  
  277. //附加题
  278. } else if (status.stage == "extra") {
  279.  
  280. //拉取题目
  281. let extra = await HNAPI.pull_answer("extra");
  282. if (extra == 1) {
  283. continue;
  284. }
  285. if (extra == false) {
  286. alert("违规发言题答题错误:答题过快或错误太多||用户答题记录不存在");
  287. break;
  288. }
  289. let question = extra.question;
  290. let check = await HNAPI.answer_check(question.id, question.options[0].hash, "extra");
  291. await HNTOOL.Sleep(1000);
  292. if (check == 1) {
  293. continue;
  294. }
  295. if (check.passed == true) {
  296. console.log("开始违规发言题第" + question.number + "题!---当前得分:" + status.score);
  297. javaex.tip({
  298. content: "开始违规发言题第" + question.number + "题!---当前得分:" + status.score,
  299. type: "success"
  300. });
  301. if (question.number == 50) {
  302. window.location.reload();
  303. }
  304. }
  305.  
  306. } else if (status.stage == "pro") {
  307.  
  308. //拉取题目
  309. let pro = await HNAPI.pull_answer("pro");
  310. if (pro == 1) {
  311. continue;
  312. }
  313. if (pro == false) {
  314. alert("自选题答题错误:答题过快或错误太多||用户答题记录不存在");
  315. break;
  316. }
  317. let question = pro.question;
  318. let num = HNTOOL.random(0, question.options.length);
  319. let check = await HNAPI.answer_check(question.id, question.options[num].hash, "pro");
  320. await HNTOOL.Sleep(1000);
  321. if (check == 1) {
  322. continue;
  323. }
  324. if (check.passed == true) {
  325. console.log("开始自选题第" + question.number + "题!---当前得分:" + status.score);
  326. javaex.tip({
  327. content: "开始自选题第" + question.number + "题!---当前得分:" + status.score,
  328. type: "success"
  329. });
  330.  
  331. }
  332.  
  333. } else {
  334. break;
  335. }
  336.  
  337. }
  338.  
  339. }
  340.  
  341. });
  342.  
  343.  
  344. }
  345.  
  346.  
  347. function init() {
  348.  
  349. Live_info.csrf_token = HNTOOL.getCookie("bili_jct");
  350. Live_info.uid = HNTOOL.getCookie("DedeUserID");
  351. Live_info.SESSDATA = HNTOOL.getCookie("SESSDATA");
  352.  
  353. HN_SETUP_CONFIG.Booking_last_sid = Live_info.uid + "&54988";
  354.  
  355.  
  356. addStyle();
  357. addSetPage();
  358.  
  359. HNTOOL.chackAtMsg();
  360.  
  361. $("#getCoinLog").bind("click", async function() {
  362.  
  363.  
  364. if (HNAPI.getCoinLog()) {
  365.  
  366. await HNTOOL.Sleep(500);
  367. let html = '';
  368. html += '<div class="javaex-panel-box" style="width: 250px;">';
  369. html += ' <ul>';
  370. html += ` <p style="color: #FFF;">硬币使用记录</p>`;
  371.  
  372. BiliData.CoinLog.list.forEach(function(item) {
  373.  
  374. let BV = item.reason.replace(/[^a-z0-9]+/ig, "");
  375. if (BV.indexOf("BV") != -1) {
  376. html +=
  377. `<li><a href="${BILIBLI_PATH.video}${BV}">${item.reason}${item.delta}币 ${item.time}</a> </li> `;
  378. }
  379. html += `<li>${item.reason}${item.delta}币 ${item.time}</li> `;
  380.  
  381.  
  382. });
  383. html += ' <hr class="javaex-divider"></hr>';
  384. html += ' </ul>';
  385. html += '</div>';
  386.  
  387. javaex.panel(this, {
  388. position: "right",
  389. //offsetTop: "104",
  390. content: html
  391. });
  392. javaex.tip({
  393. content: "获取用户成功!",
  394. type: "success"
  395. });
  396.  
  397. } else {
  398. javaex.tip({
  399. content: "获取硬币记录失败,请稍后重试!",
  400. type: "error"
  401. });
  402. }
  403.  
  404.  
  405. });
  406.  
  407. $("#getUnread").bind("click", async function() {
  408.  
  409. javaex.tip({
  410. content: "获取中,请稍候...",
  411. type: "submit"
  412. });
  413. HNAPI.getUnread();
  414.  
  415.  
  416. });
  417.  
  418.  
  419. $("#likeInDynamicComments").bind("click", async function() {
  420.  
  421. let prid = LocalData.get("likeInDynamic_PRID") == null ? "4015599048" : LocalData.get(
  422. "likeInDynamic_PRID");
  423. let oid = LocalData.get("likeInDynamic_OID") == null ? "108928314" : LocalData.get(
  424. "likeInDynamic_OID");
  425.  
  426. let html = '';
  427.  
  428. html += '<div style="padding: 10px 10px 10px 0px;">'
  429. html += '<form id="likeInDynamic_form">'
  430. html += ' <div class="javaex-unit clear">'
  431. html += ' <div class="javaex-unit-left"><p class="subtitle required">评论RPID</p></div>'
  432. html += ' <div class="javaex-unit-right">'
  433. html +=
  434. ' <input type="text" class="javaex-text" data-type="positive_int" error-msg="评论RPID格式错误"'
  435. html += ` id="likeInDynamic_PRID" value=${prid} placeholder="请输入评论RPID"/>`
  436. html += ' </div>'
  437. html += ' </div>'
  438. html += ' <div class="javaex-unit clear">'
  439. html += ' <div class="javaex-unit-left"><p class="subtitle required">OID</p></div>'
  440. html += ' <div class="javaex-unit-right">'
  441. html +=
  442. ' <input type="text" class="javaex-text" data-type="positive_int" error-msg="OID格式错误"'
  443. html += ` id="likeInDynamic_OID" value=${oid} placeholder="请输入OID"/>`
  444. html += ' </div>'
  445. html += ' </div>'
  446. html += ' <div class="javaex-unit clear tc">'
  447. html +=
  448. ' <input type="button" id="likeInDynamic_no" class="javaex-hover-pulse javaex-btn no " value="取消赞"/>'
  449. html +=
  450. ' <input type="button" id="likeInDynamic_yes" class="javaex-hover-pulse javaex-btn yes" value="点赞"/>'
  451. html += ' </div>'
  452. html += '</form>';
  453. html += '<hr class="javaex-divider"></hr>';
  454. html += '</div>';
  455.  
  456.  
  457. javaex.panel(this, {
  458. position: "right",
  459. content: html
  460. });
  461.  
  462.  
  463. // 监听点击保存按钮事件
  464. $("#likeInDynamic_yes").click(async function() {
  465. // 表单验证函数
  466. if (javaexVerify()) {
  467.  
  468. HNAPI.likeInDynamicComments(+javaex.getSelectVal("#likeInDynamic_OID"), +javaex
  469. .getSelectVal(
  470. "#likeInDynamic_PRID"), 1);
  471. await HNTOOL.Sleep(1000);
  472.  
  473. if (BiliData.replyAction.code == 0) {
  474.  
  475. LocalData.set("likeInDynamic_PRID", javaex.getSelectVal(
  476. "#likeInDynamic_PRID"));
  477. LocalData.set("likeInDynamic_OID", javaex.getSelectVal(
  478. "#likeInDynamic_OID"));
  479.  
  480. javaex.tip({
  481. content: "评论区点赞成功!",
  482. type: "success"
  483. });
  484. } else {
  485. javaex.tip({
  486. content: "评论区点赞失败!",
  487. type: "error"
  488. });
  489. }
  490. if (BiliData.replyAction.code == 65006) {
  491. javaex.tip({
  492. content: "请勿重复点赞!",
  493. type: "error"
  494. });
  495. }
  496. }
  497. });
  498.  
  499. // 监听点击返回按钮事件
  500. $("#likeInDynamic_no").click(async function() {
  501.  
  502. if (javaexVerify()) {
  503.  
  504. HNAPI.likeInDynamicComments(+javaex.getLocalStorage("#likeInDynamic_OID"), +
  505. javaex.getLocalStorage(
  506. "#likeInDynamic_PRID"), 0);
  507. await HNTOOL.Sleep(500);
  508.  
  509. if (BiliData.replyAction.code == 0) {
  510.  
  511. javaex.setLocalStorage("likeInDynamic_PRID", javaex.getSelectVal(
  512. "#likeInDynamic_PRID"));
  513. javaex.setLocalStorage("likeInDynamic_OID", javaex.getSelectVal(
  514. "#likeInDynamic_OID"));
  515.  
  516. javaex.tip({
  517. content: "评论区取消点赞成功!",
  518. type: "success"
  519. });
  520. } else {
  521. javaex.tip({
  522. content: "评论区取消点赞失败!",
  523. type: "error"
  524. });
  525. }
  526. if (BiliData.replyAction.code == 65006) {
  527. javaex.tip({
  528. content: "请勿重复取消点赞!",
  529. type: "error"
  530. });
  531. }
  532. }
  533. });
  534.  
  535. });
  536.  
  537. $("#biliUserMsg").bind("click", async function() {
  538.  
  539.  
  540. //刷新信息
  541. HNAPI.getUserNav();
  542. await HNTOOL.Sleep(500);
  543.  
  544. let isLogin = "未登录";
  545. let vipType = "无";
  546. //判断是否成功
  547. if (BiliData.login_code == 0) {
  548.  
  549.  
  550. if (BiliData.LoginData.isLogin) {
  551. isLogin = "已登录";
  552. }
  553.  
  554. if (BiliData.LoginData.vipType == 1) {
  555. vipType = "月度大会员";
  556. } else if (BiliData.LoginData.vipType == 2) {
  557. vipType = "年度大会员";
  558. }
  559.  
  560. let html = '';
  561. html += '<div class="javaex-panel-box" style="width: 250px;">';
  562. html += ' <ul>';
  563. html += ` <p style="color: #FFF;">用户信息</p>`;
  564. html +=
  565. ` <li><a href="https://account.bilibili.com/account/home">当前用户:${BiliData.LoginData.uname}</a> </li> `;
  566. html += ` <li>用户状态:${isLogin} </li> `;
  567. html += ` <li>用户等级:${BiliData.LoginData.level_info.current_level}</li> `;
  568. html +=
  569. ` <li>升级下一等级需:${BiliData.LoginData.level_info.next_exp - BiliData.LoginData.level_info.current_exp} 经验</li> `;
  570. html += ` <li>UID${BiliData.LoginData.mid} </li> `;
  571. html +=
  572. ` <li><a href="https://account.bilibili.com/account/coin">硬币:${BiliData.LoginData.money}</a> </li> `;
  573. html += ` <li>节操值:${BiliData.LoginData.moral} </li> `;
  574. html += ` <li>会员:${vipType} </li> `;
  575. html += ' <hr class="javaex-divider"></hr>';
  576. html += ' </ul>';
  577. html += '</div>';
  578.  
  579.  
  580. javaex.panel(this, {
  581. position: "right",
  582. content: html
  583. });
  584.  
  585. javaex.tip({
  586. content: "获取用户成功!",
  587. type: "success"
  588. });
  589.  
  590. } else {
  591. javaex.tip({
  592. content: "获取用户信息失败!",
  593. type: "error"
  594. });
  595. }
  596.  
  597.  
  598. });
  599.  
  600. $("#getAtMsg").bind("click", async function() {
  601.  
  602. if (HNAPI.getMsgfeed("at") && typeof(HNAPI.getMsgfeed("at")) != "undefined") {
  603.  
  604. javaex.tip({
  605. content: "可能中奖了!!!",
  606. type: "success"
  607. });
  608. }
  609. });
  610.  
  611.  
  612. $("#disUser").bind("click", async function() {
  613.  
  614. let html = '';
  615. html += '<div class="javaex-panel-box" style="width: 500px;">';
  616. html += ' <div class="javaex-unit clear">';
  617. html += ' <div class="javaex-unit-left ml-10 mt-10">*UID列表</div>';
  618. html += ' <div class="javaex-unit-right mr-10 mt-10">';
  619. html +=
  620. ' <textarea id="disUser_uidList" class="javaex-desc" placeholder="请填写用户UID,多个用英文逗号,隔开"></textarea>';
  621. html += ' </div>';
  622. html += ' </div>';
  623. html += ' <div class="javaex-unit clear tc">';
  624. html += ' <input type="button" id="disUser_block" class="javaex-btn yes" value="拉黑" />';
  625. html +=
  626. ' <input type="button" id="disUser_cancelAtt_uid" class="javaex-btn yes" value="UID取关" />';
  627. html +=
  628. ' <input type="button" id="disUser_cancelAtt_room" class="javaex-btn yes" value="房间号取关" />';
  629. html += ' </div>';
  630. html += '</div>';
  631.  
  632. javaex.panel(this, {
  633. position: "right",
  634. content: html
  635. });
  636.  
  637. let disUser_str;
  638. //拉黑
  639. $("#disUser_block").bind("click", async function() {
  640.  
  641. disUser_str = javaex.getSelectVal("#disUser_uidList");
  642. let disUser_uidList = disUser_str.split(",");
  643. let disUserStr = HNTOOL.split_array(disUser_uidList, 10);
  644.  
  645. for (const vmid of disUserStr) {
  646.  
  647. HNAPI.batchModify(vmid.toString(), 5);
  648. await HNTOOL.Sleep(2000);
  649. }
  650. });
  651. //取关uid
  652. $("#disUser_cancelAtt_uid").bind("click", async function() {
  653. disUser_str = javaex.getSelectVal("#disUser_uidList");
  654. let disUser_uidList = disUser_str.split(",");
  655.  
  656. javaex.tip({
  657. content: "根据uid批量取关开始!!!",
  658. type: "success"
  659. });
  660.  
  661. /*
  662. let disuidList = [];
  663. let PN = 100;
  664. PN = disUser_uidList.length == 1 ? 0 : PN;
  665.  
  666. for (var i = 0; i < PN; i++) {
  667.  
  668. let uidList = await HNAPI.getDisuidList(HNTOOL.getCookie("DedeUserID"), i);
  669. javaex.tip({
  670. content: "获取第" + i + "页黑名单成功!",
  671. type: "success"
  672. });
  673. await HNTOOL.Sleep(1000);
  674.  
  675. if (uidList.length == 0) {
  676. break;
  677. }
  678. if (uidList == null) {
  679. continue;
  680. }
  681.  
  682. for (let disuid of uidList) {
  683. if (disuidList.indexOf(disuid.mid) == -1) {
  684. disuidList.push(disuid.mid + "");
  685. }
  686. }
  687.  
  688.  
  689. } */
  690. let J = 1;
  691.  
  692. for (let uid of disUser_uidList) {
  693.  
  694. /* let uidType = "未在黑名单";
  695. if (disuidList.indexOf(uid) == -1) {
  696.  
  697. await HNAPI.cancelAtt(uid, 2);
  698. } else {
  699.  
  700. await HNAPI.cancelAtt(uid, 6, 116);
  701. uidType = "黑名单用户";
  702. } */
  703. await HNAPI.cancelAtt(uid, 2);
  704.  
  705. javaex.tip({
  706. content: "【UID:" + uid + "】" + "取关成功!(" + (J++) + "/" +
  707. disUser_uidList.length + ")",
  708. type: "success"
  709. });
  710. await HNTOOL.Sleep(1000);
  711. }
  712.  
  713.  
  714. alert("根据uid批量取关完成!");
  715.  
  716. /* javaex.alert({
  717. content: "根据uid批量取关完成!",
  718. confirm: function() {
  719.  
  720. //return false;
  721. }
  722. }); */
  723.  
  724. });
  725. //取关room
  726. $("#disUser_cancelAtt_room").bind("click", async function() {
  727.  
  728. javaex.tip({
  729. content: "根据房间号批量取关开始!!!",
  730. type: "success"
  731. });
  732.  
  733. disUser_str = javaex.getSelectVal("#disUser_uidList");
  734. let disUser_roomList = disUser_str.split(",");
  735. /* let disuidList = [];
  736. let PN = 100;
  737. PN = disUser_roomList.length == 1 ? 0 : PN;
  738.  
  739. for (var i = 0; i < PN; i++) {
  740.  
  741. let uidList = await HNAPI.getDisuidList(HNTOOL.getCookie("DedeUserID"), i);
  742. javaex.tip({
  743. content: "获取第" + i + "页黑名单成功!",
  744. type: "success"
  745. });
  746. await HNTOOL.Sleep(1000);
  747.  
  748. if (uidList.length == 0) {
  749. break;
  750. }
  751. if (uidList == null) {
  752. continue;
  753. }
  754.  
  755. for (let disuid of uidList) {
  756.  
  757. if (disuidList.indexOf(disuid.mid) == -1) {
  758. disuidList.push(disuid.mid);
  759. }
  760.  
  761. }
  762.  
  763.  
  764. } */
  765. let J = 1;
  766. for (let room of disUser_roomList) {
  767.  
  768. let uid = await HNAPI.getRoomMsg(room);
  769.  
  770. await HNTOOL.Sleep(1000);
  771.  
  772. if (uid == false) {
  773. javaex.tip({
  774. content: "uid查询失败跳过!",
  775. type: "error"
  776. });
  777. continue;
  778. }
  779. /* let uidType = "未在黑名单";
  780. if (disuidList.indexOf(uid) == -1) {
  781.  
  782. await HNAPI.cancelAtt(uid, 2);
  783. } else {
  784.  
  785. await HNAPI.cancelAtt(uid, 6, 116);
  786. uidType = "黑名单用户";
  787. } */
  788. await HNAPI.cancelAtt(uid, 2);
  789.  
  790. javaex.tip({
  791. content: "Room:" + room + "-【UID:" + uid + "】" + "取关成功!(" + (J++) +
  792. "/" + disUser_roomList.length +
  793. ")",
  794. type: "success"
  795. });
  796. await HNTOOL.Sleep(1000);
  797.  
  798.  
  799. }
  800. alert("根据房间号批量取关完成!");
  801. /* javaex.alert({
  802. content: ,
  803. confirm: function() {
  804.  
  805. return false;
  806. }
  807. }); */
  808.  
  809. });
  810.  
  811. });
  812.  
  813. $("#getNeetCookie").bind("click", async function() {
  814.  
  815. let html = '';
  816. html += '<div class="javaex-panel-box" style="width: 750px;">';
  817. html += ' <div class="javaex-unit clear">';
  818. html += ' <div class="javaex-unit-left ml-10 mt-10">*cookie</div>';
  819. html += ' <div class="javaex-unit-right mr-10 mt-10">';
  820. html +=
  821. ' <textarea id="neetCookie" class="javaex-desc" placeholder="获取需要的cookie,注意需要取消掉application->cookie>SESSDATA httpOnly 的对钩"></textarea>';
  822. html += ' </div>';
  823. html += ' </div>';
  824. html += ' <div class="javaex-unit clear tc">';
  825. html += ' <input type="button" id="getCookie_type1" class="javaex-btn yes" value="方式一" />';
  826. html += ' <input type="button" id="getCookie_type2" class="javaex-btn yes" value="方式二" />';
  827. html += ' <input type="button" id="getCookie_type3" class="javaex-btn yes" value="方式三" />';
  828. html += ' <input type="button" id="getCookie_copy" class="javaex-btn yes" value="复制" />';
  829. html += ' </div>';
  830. html += '</div>';
  831.  
  832. javaex.panel(this, {
  833. position: "right",
  834. content: html
  835. });
  836.  
  837. $('#getCookie_copy').bind('click', function() {
  838.  
  839. HNTOOL.copyText("neetCookie");
  840.  
  841. });
  842.  
  843. Live_info.csrf_token = HNTOOL.getCookie("bili_jct");
  844. Live_info.uid = HNTOOL.getCookie("DedeUserID");
  845. Live_info.SESSDATA = HNTOOL.getCookie("SESSDATA");
  846.  
  847.  
  848. $("#getCookie_type1").bind("click", async function() {
  849.  
  850. var cookie01 = "DedeUserID=" + Live_info.uid + "; SESSDATA=" + Live_info.SESSDATA
  851. .replace(/%25/g, "%") +
  852. "; bili_jct=" + Live_info.csrf_token +
  853. "; "
  854. document.getElementById("neetCookie").value = cookie01;
  855.  
  856. });
  857. $("#getCookie_type3").bind("click", async function() {
  858.  
  859. var cookie01 = "DedeUserID=" + Live_info.uid + "; SESSDATA=" + Live_info.SESSDATA
  860. .replace(/%25/g, "%%") +
  861. "; bili_jct=" + Live_info.csrf_token +
  862. "; "
  863. document.getElementById("neetCookie").value = cookie01;
  864.  
  865. });
  866.  
  867. $("#getCookie_type2").bind("click", async function() {
  868.  
  869. var cookie02 = Live_info.uid + "\n" + Live_info.SESSDATA.replace(/%25/g, "%") +
  870. "\n" + Live_info.csrf_token;
  871. document.getElementById("neetCookie").value = cookie02;
  872. });
  873.  
  874. });
  875.  
  876. $("#arrUnique").bind("click", async function() {
  877.  
  878. let html = '';
  879. html += '<div class="javaex-panel-box" style="width: 500px;">';
  880. html += ' <div class="javaex-unit clear">';
  881. html += ' <div id="arrNub" class="javaex-unit-left ml-10 mt-10">*数组0</div>';
  882. html += ' <div class="javaex-unit-right mr-10 mt-10">';
  883. html +=
  884. ' <textarea id="arrUnique_str" class="javaex-desc" placeholder="请填写,多个用英文逗号,隔开"></textarea>';
  885. html += ' </div>';
  886. html += ' </div>';
  887. html += ' <div class="javaex-unit clear tc">';
  888. html += ' <input type="button" id="arrUnique_beg" class="javaex-btn yes" value="去重" />';
  889. //html += ' <input type="button" id="arrUnique_copy" class="javaex-btn yes" value="粘贴" />';
  890. html += ' <input type="button" id="arrUnique_copy" class="javaex-btn yes" value="复制" />';
  891. html += ' </div>';
  892. html += '</div>';
  893.  
  894. javaex.panel(this, {
  895. position: "right",
  896. content: html
  897. });
  898.  
  899. $('#arrUnique_str').bind('input propertychange', function() {
  900.  
  901. $('#arrNub').text("*数组" + $(this).val().split(",").length);
  902.  
  903. });
  904. $('#arrUnique_copy').bind('click', function() {
  905.  
  906. HNTOOL.copyText("arrUnique_str");
  907.  
  908. });
  909.  
  910.  
  911.  
  912.  
  913. $("#arrUnique_beg").bind("click", async function() {
  914.  
  915. let arrUnique_str = javaex.getSelectVal("#arrUnique_str");
  916. let arrUnique_uidList = arrUnique_str.split(",");
  917.  
  918. let new_arr = HNTOOL.arrUnique(arrUnique_uidList);
  919.  
  920. document.getElementById("arrUnique_str").value = new_arr.toString();
  921.  
  922. $('#arrNub').text("*数组" + new_arr.length);
  923.  
  924. });
  925.  
  926. });
  927.  
  928. $("#batchFollow").bind("click", async function() {
  929.  
  930. var thisUPName = $("#h-name").text();
  931.  
  932.  
  933. let html = '';
  934. html += '<div class="javaex-panel-box" style="width: 600px;">';
  935. html += ' <div class="javaex-unit clear">';
  936. html += ' <div id="followNub" class="javaex-unit-left ml-10 mt-10">*关注列表0</div>';
  937. html += ' <div class="javaex-unit-right mr-10 mt-10">';
  938. html +=
  939. ' <textarea id="batchFollow_uidList" class="javaex-desc" placeholder="1.请填写用户UID,多个用英文逗号,隔开,此功能会强制关注,解决账号异常不能关注问题!!!2.爬取当前用户的高质量关注"></textarea>';
  940. html += ' </div>';
  941. html += ' </div>';
  942. html += ' <div class="javaex-unit clear tc" >';
  943. html += ' <input type="button" id="batchFollow_beg" class="javaex-btn yes" value="开始" />';
  944. //html += ' <input type="button" id="check_follow" class="javaex-btn yes tc" value="筛选关注" />';
  945. html +=
  946. ' <input type="button" id="crawler_follow" class="javaex-btn yes tc" value="获取全部关注" />';
  947. html += ' </div>';
  948. html += '</div>';
  949.  
  950. javaex.panel(this, {
  951. position: "right",
  952. content: html
  953. });
  954.  
  955. $('#batchFollow_uidList').bind('input propertychange', function() {
  956.  
  957. $('#followNub').text("*关注列表" + $(this).val().split(",").length);
  958.  
  959. });
  960.  
  961. $("#disFollow_thisUp").bind("click", async function() {
  962.  
  963. HNAPI.batchModify(BiliData.this_uid, 5);
  964.  
  965. });
  966.  
  967. $("#Follow_thisUp").bind("click", async function() {
  968.  
  969. HNAPI.batchModify(BiliData.this_uid);
  970.  
  971. });
  972.  
  973. $("#batchFollow_beg").bind("click", async function() {
  974.  
  975. let mid_str = javaex.getSelectVal("#batchFollow_uidList");
  976. let mid_list = mid_str.split(",");
  977.  
  978. let all_ollow = await HNAPI.getAllFollow();
  979. await HNTOOL.Sleep(1000);
  980. //删除已关注的数据
  981. for (let i in mid_list) {
  982.  
  983. if (all_ollow.indexOf(parseInt(mid_list[i])) != -1) {
  984. mid_list.splice(i, 1);
  985. }
  986.  
  987. }
  988.  
  989. document.getElementById("batchFollow_uidList").value = mid_list.toString();
  990. $('#followNub').text("*关注列表" + mid_list.length);
  991.  
  992. let mid_Lists = HNTOOL.split_array(mid_list, 15);
  993. for (const mids of mid_Lists) {
  994.  
  995. HNAPI.batchModify(mids.toString());
  996. await HNTOOL.Sleep(8000);
  997. }
  998.  
  999. alert("关注完成!")
  1000.  
  1001. });
  1002.  
  1003. $("#crawler_follow").bind("click", async function() {
  1004.  
  1005. let followList = await HNAPI.getAllFollow();
  1006. document.getElementById("batchFollow_uidList").value = followList.toString();
  1007.  
  1008. });
  1009.  
  1010. $("#check_follow").bind("click", async function() {
  1011.  
  1012. let followList = await HNAPI.getAllFollow();
  1013. await HNTOOL.Sleep(1000);
  1014. let fList = [];
  1015. let fansmin = prompt("请输入最小粉丝数量", "5000");
  1016. let fansmax = prompt("请输入最大粉丝数量", "-1");
  1017. let fansrole = window.confirm('是否认证?');
  1018. //let fansmassage = window.confirm('是否有过私信?');
  1019. let fansfollow = window.confirm('是否执行取消关注?');
  1020.  
  1021. for (const mid of followList) {
  1022.  
  1023. if (fansmin == null || fansmax == null) {
  1024. break;
  1025. }
  1026.  
  1027.  
  1028. let midCard = await HNAPI.getInterfaceCard(mid);
  1029. await HNTOOL.Sleep(1000);
  1030. fansmax = fansmax == -1 ? Infinity : fansmax;
  1031. if (midCard.fans > fansmax || midCard.fans < fansmin) {
  1032. continue;
  1033. }
  1034.  
  1035. if ((midCard.official_verify.type != -1) == fansrole) {
  1036. fList.push(mid);
  1037. } else {
  1038. fList.push(mid);
  1039. }
  1040.  
  1041.  
  1042.  
  1043. if (fansfollow) {
  1044.  
  1045. await HNAPI.cancelAtt(mid, 2);
  1046. console.log(mid + "---" + midCard.name + "取消关注!!!")
  1047. await HNTOOL.Sleep(1000);
  1048. }
  1049. document.getElementById("batchFollow_uidList").value = fList.toString();
  1050.  
  1051. }
  1052.  
  1053.  
  1054.  
  1055. });
  1056.  
  1057.  
  1058. });
  1059.  
  1060. $("#batchTargetMedal").bind("click", async function() {
  1061.  
  1062.  
  1063. let html = '';
  1064. html += '<div class="javaex-panel-box" style="width: 600px;">';
  1065. html += ' <div class="javaex-unit clear">';
  1066. html += ' <div id="targetNub" class="javaex-unit-left ml-10 mt-10">*房间列表0</div>';
  1067. html += ' <div class="javaex-unit-right mr-10 mt-10">';
  1068. html +=
  1069. ' <textarea id="batchTargetMedal_roomlist" class="javaex-desc" placeholder="特别注意:请填写用户真实房间号,多个用英文逗号,隔开!!"></textarea>';
  1070. html += ' </div>';
  1071. html += ' </div>';
  1072. html += ' <div class="javaex-unit clear tc" >';
  1073. html +=
  1074. ' <input type="button" id="batchTargetMedal_beg" class="javaex-btn yes" value="开始" />';
  1075. html += ' </div>';
  1076. html += '</div>';
  1077.  
  1078. javaex.panel(this, {
  1079. position: "right",
  1080. content: html
  1081. });
  1082.  
  1083. $('#batchTargetMedal_roomlist').bind('input propertychange', function() {
  1084.  
  1085. $('#targetNub').text("*房间列表" + $(this).val().split(",").length);
  1086.  
  1087. });
  1088.  
  1089. $("#batchTargetMedal_beg").bind("click", async function() {
  1090.  
  1091. let room_str = javaex.getSelectVal("#batchTargetMedal_roomlist");
  1092. let room_list = room_str.split(",");
  1093.  
  1094.  
  1095. for (const room of room_list) {
  1096.  
  1097. let uid = await HNAPI.getRoomMsg(room);
  1098. await HNTOOL.Sleep(500);
  1099.  
  1100. if (uid == false) {
  1101.  
  1102. javaex.tip({
  1103. content: room + "获取勋章失败!",
  1104. type: "error"
  1105. });
  1106.  
  1107. continue;
  1108. }
  1109.  
  1110. let result = await HNAPI.getFansMedalInfo(uid, room);
  1111.  
  1112. if (result) {
  1113. javaex.tip({
  1114. content: room + "勋章已经存在!",
  1115. type: "success"
  1116. });
  1117. continue;
  1118. }
  1119. //获取包裹列表
  1120. let giftRes = await HNAPI.getGiftList(room);
  1121.  
  1122. if (giftRes == false) {
  1123.  
  1124. continue;
  1125. }
  1126.  
  1127. let bag_id = null;
  1128.  
  1129. for (let gr of giftRes) {
  1130.  
  1131. if (gr.gift_id == 3) {
  1132.  
  1133. bag_id = gr.bag_id;
  1134. break;
  1135. }
  1136.  
  1137. }
  1138. if (bag_id != null) {
  1139.  
  1140. await HNAPI.bagSendGift(uid, room, bag_id);
  1141. }
  1142.  
  1143.  
  1144.  
  1145. await HNTOOL.Sleep(5000);
  1146. }
  1147.  
  1148. alert("批量送b克拉完毕!")
  1149.  
  1150.  
  1151. });
  1152.  
  1153.  
  1154. });
  1155.  
  1156.  
  1157. $("#HNSetup").bind("click", async function() {
  1158.  
  1159. var CONFIG = HNTOOL.getConfig();
  1160.  
  1161.  
  1162. let html = '';
  1163.  
  1164. html += '<div style="padding: 10px 10px 10px 0px;width:400px; ">'
  1165. html += '<form id="HNGG_SETUP">'
  1166. html += ' <div class="javaex-unit clear">'
  1167. html +=
  1168. ' <div class="javaex-unit-left mr-10"><p class="subtitle required">Qmsg-key</p></div>'
  1169. html += ' <div class="javaex-unit-left mr-10" style="width:200px">'
  1170. html +=
  1171. ' <input type="text" class="javaex-text" data-type="english_number" error-msg="Q酱key不正确" ;'
  1172. html +=
  1173. ` id="HNSetup_Qmsg_key" value="${CONFIG.qmsg_key}" placeholder="请输入Q酱key"/>`
  1174. html += ' </div>'
  1175. html += ' <div class="javaex-unit-left mr-10">'
  1176. html += ` <input type="checkbox" class="javaex-switch" id="switch-qsmg" /> `
  1177. html += ' </div>'
  1178. html += ' </div>'
  1179. html += '</form>';
  1180. html += '<div class="javaex-unit clear tc">';
  1181. html += ' <input type="button" id="HNSetup_save" class="javaex-btn yes" value="保存" />';
  1182. html += '</div>';
  1183. html += '<hr class="javaex-divider"></hr>';
  1184. html += '</div>';
  1185.  
  1186. javaex.panel(this, {
  1187. position: "right",
  1188. content: html
  1189. });
  1190.  
  1191.  
  1192. HNTOOL.cssChecked("#switch-qsmg", CONFIG.qmsg_checked, HN_SETUP_CONFIG.qmsg_checked);
  1193.  
  1194. $("#switch-qsmg").bind("click", function() {
  1195.  
  1196. HN_SETUP_CONFIG.qmsg_checked = CONFIG.qmsg_checked == true ? false : true;
  1197.  
  1198. })
  1199.  
  1200.  
  1201. $("#HNSetup_save").bind("click", async function() {
  1202.  
  1203.  
  1204. HN_SETUP_CONFIG.qmsg_key = javaex.getSelectVal("#HNSetup_Qmsg_key");
  1205.  
  1206. localStorage.setItem(`HN_SETUP_CONFIG`, JSON.stringify(HN_SETUP_CONFIG));
  1207.  
  1208. javaex.tip({
  1209. content: "设置成功!",
  1210. type: "success"
  1211. });
  1212.  
  1213. });
  1214.  
  1215. });
  1216.  
  1217. //
  1218. $("#getUpMassage").bind("click", async function() {
  1219.  
  1220.  
  1221. let html = '';
  1222.  
  1223. html += '<div style="padding: 10px 10px 10px 0px;">'
  1224. html += '<form id="getUpMassage_form">'
  1225. html += ' <div class="javaex-unit clear">'
  1226. html += ' <div class="javaex-unit-left mr-10"><p class="subtitle required">用户uid</p></div>'
  1227. html += ' <div class="javaex-unit-left mr-10">'
  1228. html +=
  1229. ' <input type="text" class="javaex-text javaex-grid-4" data-type="positive_int" error-msg="用户uid"'
  1230. html += ` id="up_uid" value="${BiliData.this_uid}" placeholder="请输入评论uid"/>`
  1231. html += ' </div>'
  1232. html += ' <div class="javaex-unit-right mr-10">'
  1233. html += ' <input type="button" id="getUpMsg" class="javaex-btn blue" value="查询"/>'
  1234. html += ' </div>'
  1235. html += ' </div>'
  1236. html += ' <div class="javaex-unit clear tc" style="width: 500px;">'
  1237. html += ' <table id="upMsgTable" class="javaex-table td-c-1">'
  1238. html += ' <thead>'
  1239. html += ' <tr><th>内容</th><th>详情</th></tr>'
  1240. html += ' </thead>'
  1241. html += ' <tbody id="upMsgTbody">'
  1242.  
  1243. html += ' </tbody>'
  1244. html += '</table> '
  1245. html += '</div>'
  1246. html += '</form>';
  1247. html += '<hr class="javaex-divider"></hr>';
  1248. html += '</div>';
  1249.  
  1250.  
  1251. javaex.panel(this, {
  1252. position: "right",
  1253. content: html
  1254. });
  1255.  
  1256. javaex.table({
  1257. id: "upMsgTable",
  1258. isDragColWidth: true, // 是否允许拖动改变列宽
  1259. mode: "overflow", // overflow表示允许使用父容器溢出来调整列的大小
  1260. leftFixedColNum: 2, // 左侧固定列数
  1261. rightFixedColNum: 1, // 右侧固定列数
  1262. sort: {
  1263. "1": "create_time", // 4表示第几列(从1开始计)。create_time表示排序字段,回调函数会返回该值
  1264. "2": "update_time"
  1265. },
  1266. sortCallback: function(rtn) {
  1267. //console.log(rtn.sortArr);
  1268. }
  1269. });
  1270.  
  1271. //
  1272. $("#getUpMsg").click(async function() {
  1273.  
  1274. let thismid = javaex.getSelectVal("#up_uid");
  1275. await HNAPI.userInfo(thismid)
  1276.  
  1277. let temp = await HNAPI.getUpCard(thismid);
  1278.  
  1279.  
  1280. await HNTOOL.Sleep(500);
  1281.  
  1282.  
  1283. if (temp != false) {
  1284. let data = BiliData.upCard.data;
  1285.  
  1286. let html = ``;
  1287. html += `<tr><td>用户UID</td><td>${data.card.mid}</td></tr> `
  1288. html +=
  1289. `<tr><td>用户等级</td><td>lv${data.card.level_info.current_level}</td></tr> `
  1290. html += `<tr><td>用户昵称</td><td>${data.card.name}</td></tr> `
  1291. html += `<tr><td>用户性别</td><td>${data.card.sex}</td></tr> `
  1292. html +=
  1293. `<tr><td>用户头像</td><td><a href="javascript:;"><img src= ${data.card.face} width="50%"></a></td></tr> `
  1294. html += `<tr><td>粉丝数</td><td>${data.follower}</td></tr> `
  1295. html += `<tr><td>关注数</td><td>${data.card.friend}</td></tr> `
  1296. html += `<tr><td>是否关注此用户</td><td>${data.following}</td></tr> `
  1297. html += `<tr><td>用户稿件数</td><td>${data.archive_count}</td></tr> `
  1298. html +=
  1299. `<tr><td>用户勋章</td><td>${data.card.nameplate.name}<a href="javascript:;"><img src= ${data.card.nameplate.image} width="50%"></a> </td></tr> `
  1300. html += `<tr><td>用户勋章等级</td><td>${data.card.nameplate.level}</td></tr> `
  1301. html += `<tr><td>认证信息</td><td>${data.card.Official.title}</td></tr> `
  1302.  
  1303.  
  1304. $("#upMsgTbody").empty();
  1305. $("#upMsgTbody").append(html);
  1306. }
  1307.  
  1308.  
  1309. });
  1310. //点击放大
  1311. /* $("img").click(function() {
  1312. javaex.dialog({
  1313. type : "image", // 弹出层类型
  1314. url : $(this).attr("src") // 图片地址
  1315. });
  1316. });*/
  1317.  
  1318. });
  1319.  
  1320.  
  1321. $("#everyDayTask").bind("click", async function() {
  1322.  
  1323. let videoAid = 758643487;
  1324. let videoCid = 357521682;
  1325. let videoBvid = "BV1V64y1d7ed";
  1326. let videoMid = 99439379;
  1327.  
  1328. //查询每日奖励状态
  1329. let rewardData = await HNAPI.get_exp_reward();
  1330. await HNTOOL.Sleep(2000);
  1331.  
  1332. //1.每日登录
  1333. if (rewardData.login == false) {
  1334.  
  1335. await HNAPI.clickNow();
  1336. await HNTOOL.Sleep(3000);
  1337. }
  1338.  
  1339. //2.直播签到
  1340. await HNAPI.DoSign();
  1341. await HNTOOL.Sleep(3000);
  1342.  
  1343. //3.专栏投币
  1344. let accountData = await HNAPI.get_account_exp();
  1345. await HNTOOL.Sleep(2000);
  1346. if (rewardData.coins < 40) {
  1347. //2. 获取分区最新专栏列表
  1348. let articleData = await HNAPI.getArticleRecommends();
  1349. await HNTOOL.Sleep(2000);
  1350. let article = articleData[HNTOOL.random(0, 9)];
  1351. let article2 = articleData[HNTOOL.random(9, 18)];
  1352.  
  1353. //await HNAPI.addVideoCoin(videoAid);//视频投币
  1354. await HNAPI.addArticleCoin(article.id, article.author.mid); //专栏投币
  1355. await HNTOOL.Sleep(2000);
  1356. if (accountData / 20 == 1) {
  1357. await HNAPI.addArticleCoin(article2.id, article2.author.mid); //专栏投币
  1358. }
  1359. }
  1360.  
  1361. //获取分区最新视频列表 http://api.bilibili.com/x/web-interface/dynamic/region pn=1 ps=20 rid=21
  1362. let archivesList = await HNAPI.getDynamicRegion();
  1363. await HNTOOL.Sleep(2000);
  1364. let num = HNTOOL.random(0, archivesList.length - 1);
  1365.  
  1366. if (archivesList != false && num != 2) {
  1367. videoAid = archivesList[num].aid;
  1368. videoBvid = archivesList[num].bvid;
  1369. videoCid = archivesList[num].cid;
  1370. videoMid = archivesList[num].owner.mid;
  1371. }
  1372. //4.每日观看视频
  1373. if (rewardData.watch == false) {
  1374. await HNAPI.watchOneVideo(videoBvid, videoMid);
  1375. await HNTOOL.Sleep(2000);
  1376. }
  1377. //5.每日分享视频
  1378. if (rewardData.share == false) {
  1379.  
  1380. await HNAPI.addShare(videoAid);
  1381. await HNTOOL.Sleep(2000);
  1382. }
  1383.  
  1384. //6.日常随机转发一个视频
  1385.  
  1386. await HNAPI.shareOneVideo(videoAid, videoMid, "分享视频");
  1387. if (num == 3 || num == 16) {
  1388. let randomStr = await HNTOOL.getRandomString();
  1389. await HNAPI.shareOneVideo("975082514", "397516636", randomStr);
  1390. }
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. });
  1397.  
  1398.  
  1399. $("#batch_dynamic_like").bind("click", async function() {
  1400.  
  1401. let url = "https://gitee.com/java_cn/BILIBLI_RES/raw/master/HNPLATE/dynamic_id.json";
  1402. let myjson = await HNAPI.getMyJson(url);
  1403.  
  1404. for (let value of myjson) {
  1405.  
  1406. await HNAPI.likeDynamic(value.dynamic_id);
  1407. console.log("点赞成功:https://t.bilibili.com/" + value.dynamic_id + "?tab=2")
  1408. await HNTOOL.Sleep(2000);
  1409. }
  1410.  
  1411. });
  1412.  
  1413.  
  1414. $("#dynamicActivity").bind("click", async function() {
  1415.  
  1416. javaex.tip({
  1417. content: "动态转发开始!",
  1418. type: "success"
  1419. });
  1420.  
  1421. let dynamic_id_list = await HNTOOL.getLatestDynamic();
  1422. console.log("共" + dynamic_id_list.length + "条动态")
  1423. let allFollow = await HNAPI.getAllFollow();
  1424. //let save_dynamic_id = await HNAPI.getSpaceNotice();
  1425. await HNTOOL.Sleep(2000);
  1426. console.log("随机延迟30-40分钟发布一个随机动态");
  1427. await HNTOOL.doOneDynamic(HNTOOL.random(30, 40) * 60 * 1000);
  1428.  
  1429. for (let index = 0, len = dynamic_id_list.length; index < len; index++) {
  1430.  
  1431. let value = dynamic_id_list[index];
  1432.  
  1433. let dynamic_data = await HNAPI.getdynamicData(value);
  1434.  
  1435. if (dynamic_data.hasOwnProperty('card') == false) {
  1436. console.log("【" + index + "】https://t.bilibili.com/" + value + "?tab=2 失效!!!");
  1437. continue;
  1438. }
  1439. let dynamic_id = dynamic_data.card.desc.dynamic_id_str;
  1440. let dynamic_type = 17;
  1441. await HNTOOL.Sleep(2000);
  1442.  
  1443. if (dynamic_data.card.desc.is_liked == 1) {
  1444. console.log("【" + index + "】https://t.bilibili.com/" + value + "?tab=2 已转发,舍弃!!!");
  1445.  
  1446. //if (dynamic_data.card.desc.type == 2 || dynamic_data.card.desc.type == 4) {
  1447. if (dynamic_data.card["extension"] != undefined) {
  1448. let lNoticeData = await HNAPI.getLotteryNotice(value);
  1449. await HNTOOL.Sleep(2000);
  1450.  
  1451. if (lNoticeData["lottery_result"] != undefined) {
  1452.  
  1453. console.log(
  1454. "【" + index + "已过开奖时间】\n" +
  1455. "用户:" + dynamic_data.card.desc.user_profile.info.uname + "\n" +
  1456. "奖品:" + lNoticeData.first_prize_cmt + "\n" +
  1457. "地址:https://t.bilibili.com/" + value + "?tab=2" + "\n" +
  1458. "名单:" + JSON.stringify(lNoticeData.lottery_result)
  1459. );
  1460. }
  1461.  
  1462. }
  1463. continue;
  1464. }
  1465. //判断是否过期
  1466. if (dynamic_data.card["extension"] != undefined) {
  1467. dynamic_type = 11;
  1468. dynamic_id = dynamic_data.card.desc.rid;
  1469. let lNoticeData = await HNAPI.getLotteryNotice(value);
  1470. await HNTOOL.Sleep(2000);
  1471.  
  1472. if (lNoticeData["lottery_result"] != undefined) {
  1473.  
  1474.  
  1475. console.log(
  1476. "【" + index + "已过开奖时间】\n" +
  1477. "用户:" + dynamic_data.card.desc.user_profile.info.uname + "\n" +
  1478. "奖品:" + lNoticeData.first_prize_cmt + "\n" +
  1479. "地址:https://t.bilibili.com/" + value + "?tab=2" + "\n" +
  1480. "名单:" + JSON.stringify(lNoticeData.lottery_result)
  1481. );
  1482. continue;
  1483. }
  1484.  
  1485. }
  1486.  
  1487. if (allFollow.indexOf(dynamic_data.card.desc.uid) == -1) {
  1488.  
  1489. let res = await HNAPI.batchModify(dynamic_data.card.desc.uid);
  1490. if (dynamic_data.card.desc.type == 2 && res == false) {
  1491. console.log("【" + index + "】关注官方动态up失败,检查账号是否异常,风控等!!!https://t.bilibili.com/" + value +
  1492. "?tab=2");
  1493. continue;
  1494. }
  1495. console.log("【" + index + "】关注" + dynamic_data.card.desc.uid + "成功!!!");
  1496. }
  1497.  
  1498. await HNTOOL.Sleep(1000);
  1499.  
  1500. //1.评论
  1501. await HNAPI.addReply(dynamic_id, dynamic_type);
  1502. console.log("【" + index + "】" + dynamic_id + "评论成功!!!");
  1503. await HNTOOL.Sleep(1000);
  1504. //3.点赞
  1505. await HNAPI.likeDynamic(value);
  1506. await HNTOOL.Sleep(1000);
  1507. //2.转发
  1508. let repostCard = HNTOOL.strToJson(dynamic_data.card.card);
  1509. let repostStr = HNTOOL.getRandomWordOfList(replyList);
  1510. let repostCtrl = "转发动态";
  1511. let relay_chat = null;
  1512. if (repostCard["user"]["uname"] != undefined && dynamic_data.card["extension"] == undefined) {
  1513.  
  1514. //转发内容 = 评论+'//'+'@'+用户名+':'+源内容
  1515. relay_chat = repostStr + "//@" + repostCard.user.uname + ":" + repostCard.item.content;
  1516. repostCtrl = repostCard.item.ctrl;
  1517.  
  1518. }
  1519. await HNAPI.repostDynamic(value, repostStr, repostCtrl);
  1520. await HNTOOL.Sleep(1000);
  1521. console.log("【" + index + "】动态:https://t.bilibili.com/" + value + "?tab=2 转发完成!");
  1522.  
  1523. javaex.tip({
  1524. content: "动态:https://t.bilibili.com/" + value + "?tab=2 转发完成!",
  1525. type: "success"
  1526. });
  1527.  
  1528. //存储标记
  1529. //await HNAPI.setNotice(value);
  1530.  
  1531. //随机延迟120 -240秒
  1532. let sleeptime = HNTOOL.random(12, 24) * 10 * 1000;
  1533. console.log("转发完成等待" + sleeptime / 1000 + "S后转发下一条动态!")
  1534. javaex.tip({
  1535. content: "转发完成等待" + sleeptime / 1000 + "S后转发下一条动态!",
  1536. type: "success"
  1537. });
  1538. await HNTOOL.Sleep(sleeptime);
  1539. }
  1540.  
  1541. alert("今日动态抽奖完成!!!");
  1542.  
  1543. });
  1544.  
  1545. $("#batchFollowOfbastard").bind("click", async function() {
  1546.  
  1547. if (confirm("作者个人需求开发,谨慎使用!!!\n 本功能会取关设定值以下没有认证和个人认证的的关注! \n 不确定使用请取消!")) {
  1548.  
  1549. let fansNum = prompt("请输入最低粉丝数量", "50000");
  1550.  
  1551. if (fansNum != null && fansNum != "") {
  1552. //fansNum
  1553.  
  1554. let followList = await HNAPI.getAllFollow();
  1555. console.log(followList);
  1556. await HNTOOL.Sleep(2000);
  1557.  
  1558. for (let fl of followList) {
  1559.  
  1560. if (fl == 99439379) {
  1561. await HNAPI.cancelAtt(fl, 1);
  1562. continue;
  1563. }
  1564. if (!followList.indexOf(99439379)) {
  1565.  
  1566. await HNAPI.cancelAtt(99439379, 1);
  1567. }
  1568.  
  1569. let user = await HNAPI.getCardByUID(fl);
  1570. await HNTOOL.Sleep(1000);
  1571. //0签约主播 1机构认证
  1572.  
  1573. if (user.fans < parseInt(fansNum) && /0|2|7/.test(user.Official.role)) {
  1574. await HNAPI.cancelAtt(fl, 2);
  1575.  
  1576. javaex.tip({
  1577. content: "uid:" + user.mid + "-" + user.name + "--粉丝量-" + user.fans +
  1578. "---符合条件 取关成功!!!",
  1579. type: "success"
  1580. });
  1581. console.log("---uid:" + user.mid + "\n---" + user.name + "\n---粉丝量-" + user.fans +
  1582. "\n---符合条件 取关成功!!!");
  1583.  
  1584. } else {
  1585. javaex.tip({
  1586. content: "uid:" + user.mid + "-" + user.name + "--粉丝量-" + user.fans +
  1587. "---不符合条件 取消!!!",
  1588. type: "success"
  1589. });
  1590. console.log("uid:" + user.mid + "-" + user.name + "---粉丝量-" + user.fans +
  1591. "---不符合条件 取消!!!");
  1592. }
  1593. }
  1594. }
  1595.  
  1596. }
  1597.  
  1598. });
  1599.  
  1600.  
  1601. $("#reserveActivity").bind("click", async function() {
  1602.  
  1603.  
  1604. let url = "https://gitee.com/java_cn/BILIBLI_RES/raw/master/HNPLATE/reserveSids.json";
  1605. let myjson = await HNAPI.getMyJson(url);
  1606.  
  1607. let lastSid = HNTOOL.getConfig().Booking_last_sid;
  1608. if (typeof(lastSid) == "undefined") {
  1609. lastSid = HN_SETUP_CONFIG.Booking_last_sid;
  1610. }
  1611. lastSid = lastSid.split("&")[1];
  1612.  
  1613.  
  1614.  
  1615. for (const sid in myjson) {
  1616.  
  1617. if (parseInt(lastSid) >= parseInt(sid)) {
  1618.  
  1619. continue;
  1620. }
  1621.  
  1622. let siddata = myjson[sid];
  1623. //let sidList = await HNAPI.getDataByLiveSid(sid);
  1624. //await HNTOOL.Sleep(2000);
  1625.  
  1626. //let returnData = await HNAPI.reserveActivity(sid, sidList[sid].total);
  1627. await HNAPI.reserveActivity(sid);
  1628. await HNTOOL.Sleep(2000);
  1629.  
  1630. let tiplog = "\n --预约开始:" + javaex.dateFormat(siddata.livePlanStartTime,
  1631. 'yyyy-MM-dd HH:mm:ss') +
  1632. //"\n --预约SID:" + siddata.sid +
  1633. //"\n --预约UID:" + siddata.upmid +
  1634. //"\n --预约地址:" + siddata.prizeInfo.jumpUrl +
  1635. "\n --预约人数:" + siddata.total + "人" +
  1636. "\n --预约奖品:" + siddata.prizeInfo.text;
  1637.  
  1638. console.log(tiplog);
  1639.  
  1640. javaex.tip({
  1641. content: tiplog,
  1642. type: "success"
  1643. });
  1644.  
  1645. HN_SETUP_CONFIG.Booking_last_sid = Live_info.uid + "&" + sid;
  1646.  
  1647. HNTOOL.saveConfig();
  1648.  
  1649. }
  1650.  
  1651.  
  1652. alert("预约抽奖结束");
  1653. });
  1654.  
  1655. $("#liveActivity").bind("click", async function() {
  1656.  
  1657. let url = "https://gitee.com/java_cn/BILIBLI_RES/raw/master/HNPLATE/activities.json";
  1658. let myjson = await HNAPI.getMyJson(url);
  1659.  
  1660. });
  1661.  
  1662.  
  1663. $("#linshiActivity").bind("click", async function() {
  1664. let uids = [50329337,189440666,277854252,434786180];
  1665. for (let uid of uids) {
  1666. await HNAPI.cancelAtt(uid, 2);
  1667. await HNTOOL.Sleep(1000);
  1668. }
  1669. await HNAPI.batchModify(uids.toString(), 1);
  1670. await HNTOOL.Sleep(5000);
  1671. await HNAPI.baseGet("https://api.live.bilibili.com/xlive/activity-interface/v2/userTask/GetNewUserTaskInfo",{"task_id": 351});
  1672. await HNTOOL.Sleep(1000);
  1673. let open_capsule_by_id = {
  1674. 'id':308,
  1675. 'count':1,
  1676. 'platform':'web',
  1677. 'csrf_token':Live_info.csrf_token,
  1678. 'csrf':Live_info.csrf_token,
  1679. 'visit_id':'',
  1680. '_':Math.round(new Date()),
  1681. };
  1682. let open_capsule = await HNAPI.basePost("https://api.live.bilibili.com/xlive/web-ucenter/v1/capsule/open_capsule_by_id",open_capsule_by_id);
  1683. await HNTOOL.Sleep(1000);
  1684.  
  1685. if(open_capsule == false){
  1686. alert("失败");
  1687. }
  1688. alert(((open_capsule.data.awards)[0]).text);
  1689.  
  1690.  
  1691. /*let activity_id = 5629850673711360;
  1692. await HNAPI.wwjdg_inform(activity_id);
  1693. await HNAPI.wwjdg_inform_off(activity_id, "info1");
  1694. await HNAPI.wwjdg_inform(activity_id);
  1695. await HNAPI.wwjdg_inform_off(activity_id, "info2");
  1696. await HNAPI.exchange_prize(activity_id);
  1697. await HNAPI.exchange_chance(activity_id);
  1698. await HNAPI.get_draw_chance(activity_id);
  1699. await HNAPI.get_draw_chance(activity_id);
  1700. await HNAPI.lottery_draw_one();
  1701. await HNAPI.diary_upload(5597469229992192, 1);
  1702. await HNTOOL.Sleep(1500);
  1703. await HNAPI.diary_upload(5597469229992192, 2);
  1704. await HNTOOL.Sleep(1500);
  1705. await HNAPI.diary_upload(5597469229992192, 3);
  1706. await HNTOOL.Sleep(1500);
  1707. await HNAPI.get_draw_chance(5597469229992192);
  1708. await HNTOOL.Sleep(1000);
  1709. await HNAPI.lottery_draw(5597469229992192);
  1710. await HNTOOL.Sleep(1500);
  1711. await HNAPI.get_draw_chance(5597469229992192);
  1712. await HNTOOL.Sleep(1000);
  1713. await HNAPI.lottery_draw(5597469229992192);
  1714. await HNTOOL.Sleep(1500);
  1715. await HNAPI.get_draw_chance(5597469229992192);
  1716. await HNTOOL.Sleep(1000);
  1717. await HNAPI.lottery_draw(5597469229992192);
  1718. await HNTOOL.Sleep(1500);
  1719. alert(await HNAPI.lottery_record(5597469229992192)); */
  1720.  
  1721.  
  1722. });
  1723.  
  1724.  
  1725. $("#jury_case").bind("click", async function() {
  1726.  
  1727. let bln = window.confirm('是否立即执行?【确定:只会执行一次】;【取消:0:10(5H)】;');
  1728.  
  1729. if (bln) {
  1730. HNTOOL.console("风纪开始!")
  1731. HNTOOL.jury_case();
  1732. } else {
  1733. for (var i = 0; i < 1; i--) {
  1734.  
  1735. let now = new Date();
  1736. let hour = now.getHours();
  1737. let minu = now.getMinutes();
  1738. HNTOOL.console("风纪运行中……");
  1739.  
  1740. if ((hour == 0 || HNTOOL.isInteger(hour / 6)) && minu == 10) {
  1741. HNTOOL.console("风纪开始到达预定时间开始执行!")
  1742. HNTOOL.jury_case();
  1743. }
  1744.  
  1745. await HNTOOL.Sleep(50000);
  1746. }
  1747. }
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757. });
  1758.  
  1759. $("#plateActivity").bind("click", async function() {
  1760.  
  1761. //获取轮盘数据
  1762.  
  1763. let url = "https://gitee.com/java_cn/BILIBLI_RES/raw/master/HNPLATE/activities.json";
  1764. let myjson = await HNAPI.getMyJson(url);
  1765. let lmt = 0;
  1766. let k = 20; //重试次数 防止卡主
  1767. let giftArr = [];
  1768. let endAtion = [];
  1769.  
  1770. javaex.tip({
  1771. content: "开始参加轮盘!!!",
  1772. type: "success"
  1773. });
  1774.  
  1775. await HNAPI.getUserNav();
  1776. await HNTOOL.Sleep(1500);
  1777.  
  1778.  
  1779. for (const json of myjson) {
  1780. //let x = json.name;
  1781. for (let i = 0; i < 20; i++) {
  1782. //1.结果为true 表示增加次数完成 终止增加 0 成功 1:活动结束 2 发生错误
  1783. let resout = await HNAPI.addLotteryTimes(json.sid);
  1784.  
  1785. await HNTOOL.Sleep(200);
  1786. if (resout == 1) {
  1787.  
  1788. endAtion.push(json.name + ":活动已结束!");
  1789. javaex.tip({
  1790. content: json.name + "活动已结束!",
  1791. type: "success"
  1792. });
  1793.  
  1794. break;
  1795. }
  1796. if (resout != 0 && resout != 1) {
  1797.  
  1798. javaex.tip({
  1799. content: json.name + resout,
  1800. type: "error"
  1801. });
  1802.  
  1803. break;
  1804. }
  1805.  
  1806. if (resout == 0) {
  1807. //2.查询次数
  1808. lmt = await HNAPI.getLotteryMytimes(json.sid);
  1809. continue;
  1810. }
  1811.  
  1812. }
  1813.  
  1814. javaex.tip({
  1815. content: "可参加" + lmt + "次(" + json.name + ")抽奖!!!",
  1816. type: "success"
  1817. });
  1818.  
  1819. await HNTOOL.Sleep(1500);
  1820.  
  1821. for (let i = 0; i < lmt; i++) {
  1822. //3、执行抽奖
  1823. let gift = await HNAPI.lotteryDo(json.sid);
  1824.  
  1825. if (gift == true) {
  1826. javaex.tip({
  1827. content: "点击过快,9秒后自动重试!!!",
  1828. type: "error"
  1829. });
  1830. i--;
  1831. k--;
  1832. }
  1833.  
  1834. if (gift == false || k == 0) {
  1835. break;
  1836. }
  1837.  
  1838. if (gift != "未中奖0" && gift != true) {
  1839. giftArr.push(json.name + "奖品为:" + gift);
  1840. break;
  1841. } else {
  1842. javaex.tip({
  1843. content: "未中奖---8秒后执行下一次(" + json.name + ")抽奖!!!",
  1844. type: "success"
  1845. });
  1846. }
  1847. await HNTOOL.Sleep(9000);
  1848.  
  1849. }
  1850.  
  1851.  
  1852. }
  1853.  
  1854.  
  1855. HNAPI.sendQmsg(HNTOOL.getConfig().qmsg_key, `【哔哩猫转盘推送】:` + BiliData.LoginData.uname + `中奖详情:` + (
  1856. giftArr.length ==
  1857. 0 ? "未中奖" : giftArr.toString()) + endAtion.toString());
  1858.  
  1859. alert(`【哔哩猫转盘推送】:` + BiliData.LoginData.uname + `中奖详情:` + (giftArr.length ==
  1860. 0 ? "未中奖" : giftArr.toString()) + endAtion.toString());
  1861.  
  1862.  
  1863. });
  1864.  
  1865. $("#addPlay").bind("click", async function() {
  1866.  
  1867.  
  1868. let html = '';
  1869.  
  1870. html += '<div style="padding: 10px 10px 10px 0px;">'
  1871. html += '<form id="getUpMassage_form">'
  1872.  
  1873. html += ' <div class="javaex-unit clear">'
  1874. html += ' <div class="javaex-unit-left"><p class="subtitle required">UID</p></div>'
  1875. html += ` <div class="javaex-unit-right" tooltip="请输入用户UID,默认自己" tooltip-pos="up"> `
  1876. html +=
  1877. ' <input type="text" class="javaex-text" data-type="positive_int|required" error-msg="请正确输入uid"'
  1878. html +=
  1879. ` id="addPlay_uid" value="${Live_info.uid}" placeholder="默认${BiliData.author_uid}"/>`
  1880. html += ' </div>'
  1881. html += ' </div>'
  1882. html += ' <div class="javaex-unit clear">'
  1883. html += ' <div class="javaex-unit-left"><p class="subtitle required">BV</p></div>'
  1884. html +=
  1885. ' <div class="javaex-unit-right" tooltip="请输入视频BV号 例如BV14r4y1A7Q9 (0表示全部)" tooltip-pos="up">'
  1886. html +=
  1887. ' <input type="text" class="javaex-text" data-type="required|english_number" error-msg=""'
  1888. html +=
  1889. ` id="addPlay_bv" value="0" placeholder="请输入视频BV号 例如BV14r4y1A7Q9 (0表示全部)"/>`
  1890. html += ' </div>'
  1891. html += ' </div>'
  1892. html += '</form>';
  1893. html += ' <div class="javaex-unit clear tc">'
  1894. html += ' <button id="addPlay_bgn" class="javaex-btn blue radius-3">开始</button> '
  1895. html += ' </div>'
  1896. html += '<hr class="javaex-divider"></hr>';
  1897. html += '</div>';
  1898.  
  1899.  
  1900. javaex.panel(this, {
  1901. position: "right",
  1902. content: html
  1903. });
  1904.  
  1905. $("#addPlay_bgn").click(async function() {
  1906.  
  1907. let MID = javaex.getSelectVal("#addPlay_uid")
  1908. let BV = javaex.getSelectVal("#addPlay_bv");
  1909. let bvArr = [];
  1910. let bvArr2 = [];
  1911.  
  1912. MID = javaex.ifnull(MID, BiliData.author_uid);
  1913.  
  1914.  
  1915. if (BV == "0") {
  1916.  
  1917. //1.查询up所有视频BV号 2.发送心跳间隔2s
  1918. HNAPI.getUpAllBV(BiliData.author_uid, 1, 2);
  1919. await HNTOOL.Sleep(500);
  1920. bvArr2 = BiliData.BVList;
  1921.  
  1922. for (let i = 1; i > 0; i++) {
  1923.  
  1924. HNAPI.getUpAllBV(MID, i);
  1925.  
  1926. await HNTOOL.Sleep(500);
  1927.  
  1928. if (BiliData.BVList.length == 0) {
  1929. if (bvArr.length == 0) {
  1930. javaex.tip({
  1931. content: "该用户无投稿视频,请确认是否有误!",
  1932. type: "success"
  1933. });
  1934. await HNTOOL.Sleep(2000);
  1935. }
  1936. //bvArr = bvArr.ifnull(bvArr2, bvArr.concat(bvArr2));
  1937. bvArr = bvArr.concat(bvArr2);
  1938. break;
  1939. }
  1940.  
  1941. bvArr = bvArr.concat(BiliData.BVList);
  1942. }
  1943.  
  1944.  
  1945. if (bvArr.length != 0) {
  1946.  
  1947. for (const emt of bvArr) {
  1948.  
  1949. HNAPI.playOneVideo(emt.bvid, MID);
  1950.  
  1951. await HNTOOL.Sleep(2000);
  1952.  
  1953. }
  1954.  
  1955. alert("播放完成!!!");
  1956.  
  1957. }
  1958.  
  1959.  
  1960. } else {
  1961. //1.调用点击播放接口
  1962. //2.发送心跳
  1963.  
  1964. await HNTOOL.Sleep(500);
  1965.  
  1966. HNAPI.playOneVideo(BV);
  1967. }
  1968.  
  1969.  
  1970. });
  1971.  
  1972.  
  1973. });
  1974.  
  1975. }
  1976.  
  1977.  
  1978.  
  1979.  
  1980. let addSetPage = async function() {
  1981.  
  1982. HNTOOL.Sleep(1000);
  1983.  
  1984. $('body').append('' +
  1985. '<div id="left_navbar">' +
  1986. '<div class="javaex-menu-container"> ' +
  1987. ' <div id="menu" class="javaex-menu"> ' +
  1988. ' <ul> ' +
  1989. ' <li class="javaex-menu-item alone hover" > ' +
  1990. ' <a href="javaScript:;" style="background: #fb7299;padding-left: 0px;text-align: center;color: #ffffff;font-weight: bold;border-bottom: 1px solid #eee;" ' +
  1991. ` tooltip="我是来测试的" tooltip-pos="right">管理中心 v${GM_info.script.version}</a> ` +
  1992. ' </li> ' +
  1993. ' </ul> ' +
  1994. ' <ul> ' +
  1995. ' <li class="javaex-menu-item"> ' +
  1996. ' <a href="javascript:;">个人中心<i class="icon-angle-down"></i></a> ' +
  1997. ' <ul> ' +
  1998. ' <li id="biliUserMsg" class="javaex-hover-pulse"><a href="javaScript:;">用户信息</a></li> ' +
  1999. ' </ul> ' +
  2000. ' </li> ' +
  2001. ' <li id="chackList" class="javaex-menu-item"> ' +
  2002. ' <a href="javaScript:;">查询<i class="icon-angle-down"></i></a> ' +
  2003. ' <ul> ' +
  2004. ' <li id="getUpMassage" ><a href="javaScript:;">查询用户详细信息</a></li> ' +
  2005. //' <li><a href="javaScript:;">查询每日最热视频【禁用】</a></li> ' +
  2006. ' <li id="getAtMsg"><a href="javaScript:;">查询动态艾特信息</a></li> ' +
  2007. ' <li id="getCoinLog" class="javaex-hover-pulse"><a href="javaScript:;">查询硬币变化</a></li> ' +
  2008. ' <li id="getUnread" class="javaex-hover-pulse"><a href="javaScript:;">查询消息</a></li> ' +
  2009. ' </ul> ' +
  2010. ' </li> ' +
  2011. ' <li class="javaex-menu-item"> ' +
  2012. ' <a href="javascript:;">批量操作工具<i class="icon-angle-down"></i></a> ' +
  2013. ' <ul> ' +
  2014. ' <li id="addPlay" class="javaex-hover-pulse"><a href="javaScript:;" >批量播放视频</a></li> ' +
  2015. ' <li id="disUser" class="javaex-hover-pulse"><a href="javaScript:;" >批量拉黑&取关</a></li> ' +
  2016. ' <li id="batchFollow" class="javaex-hover-pulse"><a href="javaScript:;" >批量关注</a></li> ' +
  2017. ' <li id="batchFollowOfbastard" class="javaex-hover-pulse"><a href="javaScript:;" >批量取关-慎用</a></li> ' +
  2018. ' <li id="batchTargetMedal" class="javaex-hover-pulse"><a href="javaScript:;" >批量勋章</a></li> ' +
  2019. ' <li id="batch_dynamic_like" class="javaex-hover-pulse"><a href="javaScript:;" >批量动态点赞</a></li> ' +
  2020. //' <li class="javaex-hover-pulse"><a href="javaScript:;" >批量发私信</a></li> ' +
  2021. //' <li class="javaex-hover-pulse"><a href="javaScript:;" >批量发送视频弹幕</a></li> ' +
  2022. ' </ul> ' +
  2023. ' </li> ' +
  2024. ' <li class="javaex-menu-item"> ' +
  2025. ' <a href="javascript:;">其他工具<i class="icon-angle-down"></i></a> ' +
  2026. ' <ul> ' +
  2027. ' <li id="everyDayTask" class="javaex-hover-pulse"><a href="javaScript:;" >一键日常任务</a></li> ' +
  2028. ' <li id="jury_case" class="javaex-hover-pulse"><a href="javaScript:;" >一键风纪任务【0:10(5H)】</a></li> ' +
  2029. ' <li id="plateActivity" class="javaex-hover-pulse"><a href="javaScript:;" >轮盘抽奖</a></li> ' +
  2030. ' <li id="linshiActivity" class="javaex-hover-pulse"><a href="javaScript:;" >临时转盘</a></li> ' +
  2031. //' <li id="liveActivity" class="javaex-hover-pulse"><a href="javaScript:;" >直播转盘</a></li> ' +
  2032. //' <li id="likeInDynamicComments" class="javaex-hover-pulse" ><a href="javaScript:;">动态评论区点赞</a></li> ' + //likeInDynamicComments
  2033. //' <li class="javaex-hover-pulse"><a href="javaScript:;" >移动粉丝勋章</a></li> ' +
  2034. //' <li class="javaex-hover-pulse"><a href="javaScript:;" >评论区抽奖</a></li> ' +
  2035. //' <li class="javaex-hover-pulse"><a href="javaScript:;" >注册答题</a></li> ' +
  2036. ' <li id="reserveActivity" class="javaex-hover-pulse"><a href="javaScript:;" >预约抽奖</a></li> ' +
  2037. ' <li id="dynamicActivity" class="javaex-hover-pulse"><a href="javaScript:;" >动态抽奖</a></li> ' +
  2038. ' <li id="getNeetCookie" class="javaex-hover-pulse"><a href="javaScript:;">获取Cookie</a></li> ' +
  2039. //' <li id="auto_check_question" class="javaex-hover-pulse"><a href="javaScript:;">一键答题</a></li> ' +
  2040. ' <li id="arrUnique" class="javaex-hover-pulse"><a href="javaScript:;">数组去重</a></li> ' +
  2041. ' </ul> ' +
  2042. ' </li> ' +
  2043. ' <li class="javaex-menu-item"> ' +
  2044. ' <a href="javascript:;">设置及更新<i class="icon-angle-down"></i></a> ' +
  2045. ' <ul> ' +
  2046. ' <li class="javaex-hover-pulse"><a href="https://greasyfork.org/zh-CN/scripts/422731" >更新</a></li> ' +
  2047. ' <li id="HNSetup" class="javaex-hover-pulse" ><span class="icon-cogs" style="font-size:50px;color:#ff0000;"></span><a href="javaScript:;">设置</a></li> ' +
  2048. ' </ul> ' +
  2049. ' </li> ' +
  2050.  
  2051. ' </ul> ' +
  2052. ' </div> ' +
  2053. '</div>' +
  2054. '</div>');
  2055. //$("#left_navbar").before('<button hnBtn="btn_open" class="javaex-btn green" onclick="openBar()">点我关闭</button>')
  2056.  
  2057. javaex.menu({
  2058. id: "menu",
  2059. isShowAll: false
  2060. });
  2061.  
  2062. }
  2063.  
  2064.  
  2065.  
  2066.  
  2067. let showUnreadMsg = function() {
  2068.  
  2069. var html = '';
  2070. html += '<div class="javaex-panel-box" style="width: 250px;">';
  2071. html += ' <ul>';
  2072. html += ` <p style="color: #FFF;">用户消息</p>`;
  2073. html += ` <li><a href="https://message.bilibili.com/#/at">未读艾特数:${BiliData.Unread.at}</a> </li> `;
  2074. html += ` <li><a href="https://message.bilibili.com/#/love">未读点赞数:${BiliData.Unread.like}</a> </li> `;
  2075. html += ` <li><a href="https://message.bilibili.com/#/reply">未读回复数:${BiliData.Unread.reply}</a> </li> `;
  2076. html += ` <li><a href="https://message.bilibili.com/#/system">未读系统通知数:${BiliData.Unread.sys_msg}</a> </li> `;
  2077. html += ` <li><a href="">UP主助手信息数:${BiliData.Unread.up}</a> </li> `;
  2078. html += ' <hr class="javaex-divider"></hr>';
  2079. html += ' </ul>';
  2080. html += '</div>';
  2081.  
  2082.  
  2083. javaex.panel(document.getElementById("getUnread"), {
  2084. position: "right",
  2085. content: html
  2086. });
  2087.  
  2088. javaex.tip({
  2089. content: "查询用户通知成功!",
  2090. type: "success"
  2091. });
  2092.  
  2093. }
  2094.  
  2095. /**
  2096. * 检查 艾特信息
  2097. * @returns {Promise<void>}
  2098. */
  2099. let chackAtMsg = async function(items) {
  2100.  
  2101. await HNTOOL.Sleep(500);
  2102.  
  2103. if (items != false && typeof(items) != "undefined") {
  2104.  
  2105.  
  2106. var html = '';
  2107. html += '<div class="javaex-panel-box" style="width: auto;">';
  2108. html += ' <ul>';
  2109. html += ` <p style="color: #FFF;">@信息</p>`;
  2110. items.forEach(function(item) {
  2111.  
  2112. var atTime = javaex.dateFormat(item.at_time, 'yyyy-MM-dd HH:mm:ss');
  2113. HNAPI.sendQmsg(HNTOOL.getConfig().qmsg_key, atTime + " 恭喜动态中奖了!" +
  2114. `${item.user.nickname}在动态中艾特了你! 内容:${item.item.source_content}`);
  2115.  
  2116. html +=
  2117. ` <li>${atTime} <a class="fontbold" href="https://space.bilibili.com/${item.user.mid}">:${item.user.nickname}</a>在动态中艾特了你!</li> `
  2118. html += ` <li class="fontbold">内容:${item.item.source_content}</li> `;
  2119. html += ` <li><a href="${item.item.uri}">---点击查看详情---</a> </li> `;
  2120. html += ' <hr class="javaex-divider"></hr>';
  2121. });
  2122. html += ' </ul>';
  2123. html += '</div>';
  2124.  
  2125.  
  2126. if (($("#chackList").attr("class")).indexOf("hover") > -1) {
  2127. javaex.panel(document.getElementById("getAtMsg"), {
  2128. position: "right",
  2129. content: html
  2130. });
  2131. } else {
  2132. javaex.panel(document.getElementById("chackList"), {
  2133. position: "right",
  2134. content: html
  2135. });
  2136. }
  2137.  
  2138.  
  2139. }
  2140.  
  2141. }
  2142.  
  2143.  
  2144. let addStyle = function() {
  2145. const animate = GM_getResourceText('animate');
  2146. const common = GM_getResourceText('common');
  2147. const defaultCss = GM_getResourceText('defaultCss');
  2148. //const icomoonex = GM_getResourceText('icomoonex');
  2149. //const AllCss = animate + common + defaultCss + icomoonex;
  2150. const AllCss = animate + common + defaultCss;
  2151. const style = document.createElement('style');
  2152. style.innerHTML = AllCss;
  2153. return document.getElementsByTagName('head')[0].appendChild(style);
  2154. }
  2155.  
  2156. /*-----------------------------------------------点击事件绑定--------------------------------------------------*/
  2157.  
  2158.  
  2159. /*-----------------------------------------------常用API--------------------------------------------------*/
  2160.  
  2161. let HNAPI = {
  2162. basePost: async function(api , data) {
  2163. return new Promise((resolve) => {
  2164. Ajax.post({
  2165. url: api,
  2166. hasCookies: true,
  2167. dataType: 'application/x-www-form-urlencoded',
  2168. data: data,
  2169. success: responseText => {
  2170. let res = HNTOOL.strToJson(responseText);
  2171. if (res.code === 0) {
  2172.  
  2173. resolve(res);
  2174. } else {
  2175.  
  2176. resolve(false);
  2177. }
  2178. }
  2179. })
  2180. });
  2181. },
  2182. baseGet: async function(api , queryObj) {
  2183. return new Promise((resolve) => {
  2184. Ajax.get({
  2185. url: api,
  2186. queryStringsObj:queryObj,
  2187. hasCookies: true,
  2188. success: responseText => {
  2189. let res = HNTOOL.strToJson(responseText);
  2190. if (res.code === 0) {
  2191. resolve(res);
  2192. } else {
  2193. resolve(false);
  2194. }
  2195. }
  2196. })
  2197. });
  2198. },
  2199.  
  2200. exchange_chance: async function(activity_id) {
  2201. return new Promise((resolve) => {
  2202.  
  2203. Ajax.get({
  2204. url: "https://qcloud-sdkact-api.biligame.com/exchange/chance",
  2205. queryStringsObj: {
  2206. 't': Math.round(new Date()),
  2207. 'activity_id': activity_id,
  2208.  
  2209. },
  2210. hasCookies: true,
  2211. success: responseText => {
  2212. let res = HNTOOL.strToJson(responseText);
  2213. if (res.code === 0) {
  2214.  
  2215. resolve(true);
  2216. } else {
  2217.  
  2218. resolve(false);
  2219. }
  2220. }
  2221. })
  2222. });
  2223. },
  2224. wwjdg_inform: async function(activity_id) {
  2225. return new Promise((resolve) => {
  2226.  
  2227. Ajax.get({
  2228. url: "https://qcloud-sdkact-api.biligame.com/wwjdg/inform",
  2229. queryStringsObj: {
  2230. 't': Math.round(new Date()),
  2231. 'activity_id': activity_id,
  2232.  
  2233. },
  2234. hasCookies: true,
  2235. success: responseText => {
  2236. let res = HNTOOL.strToJson(responseText);
  2237. if (res.code === 0) {
  2238.  
  2239. resolve(true);
  2240. } else {
  2241.  
  2242. resolve(false);
  2243. }
  2244. }
  2245. })
  2246. });
  2247. },
  2248. wwjdg_inform_off: async function(activity_id, info_no) {
  2249. return new Promise((resolve) => {
  2250. Ajax.post({
  2251. url: "https://qcloud-sdkact-api.biligame.com/wwjdg/inform/off?t=" + Math.round(
  2252. new Date()),
  2253. hasCookies: true,
  2254. dataType: 'application/x-www-form-urlencoded',
  2255. data: {
  2256.  
  2257. activity_id: activity_id,
  2258. info_no: info_no,
  2259.  
  2260. },
  2261. success: responseText => {
  2262. let res = HNTOOL.strToJson(responseText);
  2263. if (res.code === 0) {
  2264.  
  2265. resolve(true);
  2266. } else {
  2267.  
  2268. resolve(false);
  2269. }
  2270. }
  2271. })
  2272. });
  2273. },
  2274.  
  2275. exchange_prize: async function(activity_id) {
  2276. return new Promise((resolve) => {
  2277.  
  2278. Ajax.get({
  2279. url: "https://qcloud-sdkact-api.biligame.com/wwjdg/exchange_prize",
  2280. queryStringsObj: {
  2281. 't': Math.round(new Date()),
  2282. 'activity_id': activity_id,
  2283. 'prize_id': 5629853426288896,
  2284. },
  2285. hasCookies: true,
  2286. success: responseText => {
  2287. let res = HNTOOL.strToJson(responseText);
  2288. if (res.code === 0) {
  2289.  
  2290. resolve(true);
  2291. } else {
  2292.  
  2293. resolve(false);
  2294. }
  2295. }
  2296. })
  2297. });
  2298. },
  2299. lottery_draw_one: async function() {
  2300. return new Promise((resolve) => {
  2301. Ajax.post({
  2302. url: "https://qcloud-sdkact-api.biligame.com/activity/lottery/draw?t=" + Math
  2303. .round(new Date()),
  2304. hasCookies: true,
  2305. dataType: 'application/x-www-form-urlencoded',
  2306. data: {
  2307.  
  2308. activity_id: 5629854950017280
  2309.  
  2310. },
  2311. success: responseText => {
  2312. let res = HNTOOL.strToJson(responseText);
  2313. if (res.code === 0) {
  2314.  
  2315. alert(res.data.name)
  2316.  
  2317. } else if (res.code === 11001 || res.code == -905) {
  2318.  
  2319. Ajax.post({
  2320. url: "https://qcloud-sdkact-api.biligame.com/activity/lottery/draw?t=" +
  2321. Math
  2322. .round(new Date()),
  2323. hasCookies: true,
  2324. dataType: 'application/x-www-form-urlencoded',
  2325. data: {
  2326.  
  2327. activity_id: 5629850673711360
  2328.  
  2329. },
  2330. success: responseText => {
  2331. let res2 = HNTOOL.strToJson(responseText);
  2332. if (res2.code === 0) {
  2333.  
  2334. alert(res2.data.name)
  2335. } else if (res.code == -905) {
  2336. alert(res2.message);
  2337. } else {
  2338.  
  2339. resolve(false);
  2340. }
  2341. }
  2342. })
  2343.  
  2344. } else {
  2345.  
  2346. resolve(false);
  2347. }
  2348. }
  2349. })
  2350. });
  2351. },
  2352. /**
  2353. *
  2354. */
  2355.  
  2356. jury_vote: async function(case_id, vote, anonymous) {
  2357. return new Promise((resolve) => {
  2358. Ajax.post({
  2359. url: BILIBLI_PATH.api + "/x/credit/v2/jury/vote",
  2360. hasCookies: true,
  2361. dataType: 'application/x-www-form-urlencoded',
  2362. data: {
  2363.  
  2364. case_id: case_id,
  2365. vote: vote,
  2366. anonymous: anonymous,
  2367. content: "",
  2368. csrf: Live_info.csrf_token
  2369. },
  2370. success: responseText => {
  2371. let res = HNTOOL.strToJson(responseText);
  2372. if (res.code === 0) {
  2373.  
  2374. resolve(true);
  2375. } else {
  2376.  
  2377. resolve(res.message);
  2378. }
  2379. }
  2380. })
  2381. });
  2382. },
  2383.  
  2384. /**
  2385. *
  2386. */
  2387. jury_case_opinion: async function(case_id) {
  2388. return new Promise((resolve) => {
  2389.  
  2390. Ajax.get({
  2391. url: BILIBLI_PATH.api + "/x/credit/v2/jury/case/opinion",
  2392. queryStringsObj: {
  2393. 'case_id': case_id,
  2394. 'pn': 1,
  2395. 'ps': 5,
  2396. },
  2397. hasCookies: true,
  2398. success: responseText => {
  2399. let res = HNTOOL.strToJson(responseText);
  2400. if (res.code === 0) {
  2401. resolve(true);
  2402. } else {
  2403.  
  2404. HNTOOL.console("获取案件详情发生错误!" + res.message, "error");
  2405.  
  2406. resolve(false);
  2407. }
  2408. }
  2409. })
  2410. });
  2411. },
  2412. /**
  2413. *
  2414. */
  2415. jury_case_info: async function(case_id) {
  2416. return new Promise((resolve) => {
  2417.  
  2418. Ajax.get({
  2419. url: BILIBLI_PATH.api + "/x/credit/v2/jury/case/info",
  2420. queryStringsObj: {
  2421. 'case_id': case_id
  2422. },
  2423. hasCookies: true,
  2424. success: responseText => {
  2425. let res = HNTOOL.strToJson(responseText);
  2426. if (res.code === 0) {
  2427. let comment_content = "";
  2428. let itemlist = [1, 1, 1, 1, 2, 2, 2, 2, 3, 0];
  2429. let x = itemlist[HNTOOL.random(0, 10)];
  2430.  
  2431. let vote_item = res.data.vote_items[x];
  2432. let case_type = res.data.case_type;
  2433. if (case_type == 4) {
  2434. //4:截屏内弹幕
  2435. comment_content = "截屏内弹幕";
  2436.  
  2437. } else {
  2438. comment_content = res.data.case_info.comment.content;
  2439. }
  2440.  
  2441.  
  2442. HNTOOL.console(
  2443. "\n 案号:" + case_id +
  2444. "\n 详情:" + comment_content +
  2445. "\n 选择:" + vote_item.vote_text
  2446. );
  2447. resolve(vote_item.vote);
  2448. } else {
  2449.  
  2450. HNTOOL.console("获取案件详情发生错误!" + res.message, "error");
  2451.  
  2452. resolve(false);
  2453. }
  2454. }
  2455. })
  2456. });
  2457. },
  2458.  
  2459. /**
  2460. *
  2461. */
  2462. jury_case_next: async function() {
  2463. return new Promise((resolve) => {
  2464.  
  2465. Ajax.get({
  2466. url: BILIBLI_PATH.api + '/x/credit/v2/jury/case/next',
  2467. queryStringsObj: {
  2468.  
  2469. },
  2470. hasCookies: true,
  2471. success: responseText => {
  2472. let res = HNTOOL.strToJson(responseText);
  2473. if (res.code === 0) {
  2474.  
  2475. resolve(res.data.case_id);
  2476. } else if (res.code === 25014 || res.code === 25008) {
  2477.  
  2478. HNTOOL.console(res.message);
  2479.  
  2480.  
  2481. } else {
  2482. HNTOOL.console("今日风纪已完成&暂时无案子!");
  2483. resolve(false);
  2484. }
  2485. }
  2486. })
  2487. });
  2488. },
  2489.  
  2490. answer_check: async function(question_id, ans_hash, type) {
  2491. return new Promise((resolve) => {
  2492. Ajax.post({
  2493.  
  2494. url: "https://api.bilibili.com/x/answer/v4/" + type + "/check",
  2495. hasCookies: true,
  2496. dataType: 'application/x-www-form-urlencoded',
  2497. data: {
  2498. question_id: question_id,
  2499. ans_hash: ans_hash,
  2500. csrf: Live_info.csrf_token
  2501. },
  2502. success: responseText => {
  2503. let res = HNTOOL.strToJson(responseText);
  2504. if (res.code === 0) {
  2505. console.log("答题成功");
  2506. resolve(res.data);
  2507. } else if (res.code === 41020) {
  2508. resolve(1);
  2509. } else {
  2510. javaex.tip({
  2511. content: "错误!",
  2512. type: "error"
  2513. });
  2514. resolve(false);
  2515. }
  2516. }
  2517. })
  2518. });
  2519. },
  2520.  
  2521. /**
  2522. *
  2523. */
  2524. pull_answer: async function(type) {
  2525. return new Promise((resolve) => {
  2526.  
  2527. Ajax.get({
  2528. url: 'https://api.bilibili.com/x/answer/v4/' + type,
  2529. queryStringsObj: {
  2530.  
  2531. },
  2532. hasCookies: true,
  2533. success: responseText => {
  2534. let res = HNTOOL.strToJson(responseText);
  2535. if (res.code === 0) {
  2536.  
  2537. resolve(res.data);
  2538. } else if (res.code === 41020) {
  2539. console.log("用户" + type + "题已通过")
  2540. resolve(1);
  2541. } else {
  2542. console.log("拉取" + type + "题目失败:" + res.message);
  2543. resolve(false);
  2544. }
  2545. }
  2546. })
  2547. });
  2548. },
  2549.  
  2550. /**
  2551. *
  2552. */
  2553. answer_status: async function() {
  2554. return new Promise((resolve) => {
  2555. Ajax.get({
  2556. url: 'https://api.bilibili.com/x/answer/v4/status',
  2557. queryStringsObj: {
  2558.  
  2559. },
  2560. hasCookies: true,
  2561. success: responseText => {
  2562. let res = HNTOOL.strToJson(responseText);
  2563. if (res.code === 0) {
  2564.  
  2565. resolve(res.data);
  2566.  
  2567. } else {
  2568. console.log("查询答题状态失败:" + res.message);
  2569. resolve(false);
  2570. }
  2571. }
  2572. })
  2573. });
  2574. },
  2575.  
  2576. /**
  2577. * 查询每日投币数量
  2578. */
  2579. get_account_exp: async function() {
  2580. return new Promise((resolve) => {
  2581. Ajax.get({
  2582. url: 'http://www.bilibili.com/plus/account/exp.php',
  2583. queryStringsObj: {
  2584.  
  2585. },
  2586. hasCookies: true,
  2587. success: responseText => {
  2588. let res = HNTOOL.strToJson(responseText);
  2589. if (res.code === 0) {
  2590.  
  2591. resolve(res.number);
  2592.  
  2593. } else {
  2594. console.log("查询每日投币数量失败:" + res.message);
  2595. resolve(false);
  2596. }
  2597. }
  2598. })
  2599. });
  2600. },
  2601. /**
  2602. * 查询每日奖励状态
  2603. */
  2604. get_exp_reward: async function() {
  2605. return new Promise((resolve) => {
  2606. Ajax.get({
  2607. url: BILIBLI_PATH.api + '/x/member/web/exp/reward',
  2608. queryStringsObj: {
  2609.  
  2610. },
  2611. hasCookies: true,
  2612. success: responseText => {
  2613. let res = HNTOOL.strToJson(responseText);
  2614. if (res.code === 0) {
  2615.  
  2616. resolve(res.data);
  2617.  
  2618. } else {
  2619. console.log("查询每日奖励状态失败:" + res.message);
  2620. resolve(false);
  2621. }
  2622. }
  2623. })
  2624. });
  2625. },
  2626.  
  2627. diary_upload: async function(activity_id, game_part) {
  2628. return new Promise((resolve) => {
  2629. Ajax.post({
  2630. url: "https://qcloud-sdkact-api.biligame.com/rabbit/diary/upload",
  2631. hasCookies: true,
  2632. dataType: 'application/x-www-form-urlencoded',
  2633. data: {
  2634. t: Math.round(new Date()),
  2635. activity_id: activity_id,
  2636. game_part: game_part
  2637. },
  2638. payload: '{"activity_id":"' + activity_id + '","game_part":' + game_part + '}',
  2639.  
  2640. success: responseText => {
  2641. let res = HNTOOL.strToJson(responseText);
  2642. if (res.code === 0) {
  2643. console.log("成功:");
  2644. resolve(true);
  2645. } else {
  2646. javaex.tip({
  2647. content: "错误!",
  2648. type: "error"
  2649. });
  2650. resolve(false);
  2651. }
  2652. }
  2653. })
  2654. });
  2655. },
  2656. lottery_draw: async function(activity_id) {
  2657. return new Promise((resolve) => {
  2658. Ajax.post({
  2659. url: "https://qcloud-sdkact-api.biligame.com/activity/lottery/draw",
  2660. hasCookies: true,
  2661. dataType: 'application/x-www-form-urlencoded',
  2662. data: {
  2663. t: Math.round(new Date()),
  2664. activity_id: activity_id,
  2665. },
  2666. payload: '{"activity_id":"' + activity_id + '","t":' + Math.round(new Date()) +
  2667. '}',
  2668.  
  2669. success: responseText => {
  2670. let res = HNTOOL.strToJson(responseText);
  2671. if (res.code === 0) {
  2672. console.log("成功");
  2673. resolve(true);
  2674. } else {
  2675. javaex.tip({
  2676. content: "错误!",
  2677. type: "error"
  2678. });
  2679. resolve(false);
  2680. }
  2681. }
  2682. })
  2683. });
  2684. },
  2685. lottery_record: async function(activity_id) {
  2686. return new Promise((resolve) => {
  2687. Ajax.get({
  2688. url: 'https://qcloud-sdkact-api.biligame.com/common/lottery/record',
  2689. queryStringsObj: {
  2690. t: Math.round(new Date()),
  2691. activity_id: activity_id,
  2692. },
  2693. hasCookies: true,
  2694. success: responseText => {
  2695. let res = HNTOOL.strToJson(responseText);
  2696. if (res.code === 0) {
  2697. let str = "";
  2698. for (let s of res.data) {
  2699. str += s.name
  2700. }
  2701.  
  2702. resolve(str);
  2703.  
  2704. } else {
  2705. console.log("查询每日奖励状态失败:" + res.message);
  2706. resolve(false);
  2707. }
  2708. }
  2709. })
  2710. });
  2711. },
  2712. get_draw_chance: async function(activity_id) {
  2713. return new Promise((resolve) => {
  2714. Ajax.get({
  2715. url: 'https://qcloud-sdkact-api.biligame.com/activity/lottery/get_draw_chance',
  2716. queryStringsObj: {
  2717. t: Math.round(new Date()),
  2718. activity_id: activity_id,
  2719. },
  2720. hasCookies: true,
  2721. success: responseText => {
  2722. let res = HNTOOL.strToJson(responseText);
  2723. if (res.code === 0) {
  2724.  
  2725. resolve(true);
  2726.  
  2727. } else {
  2728. console.log("查询每日奖励状态失败:" + res.message);
  2729. resolve(false);
  2730. }
  2731. }
  2732. })
  2733. });
  2734. },
  2735. /**
  2736. * 转发一个视频
  2737. * @param {Object} videoAid
  2738. * @param {Object} videoMid
  2739. * @param {Object} randomStr
  2740. */
  2741.  
  2742. shareOneVideo: async function(videoAid, videoMid, randomStr) {
  2743. return new Promise((resolve) => {
  2744. Ajax.post({
  2745. url: BILIBLI_PATH.vcapi + "/dynamic_repost/v1/dynamic_repost/share",
  2746. hasCookies: true,
  2747. dataType: 'application/x-www-form-urlencoded',
  2748. data: {
  2749.  
  2750. platform: "pc",
  2751. uid: videoMid,
  2752. type: 8,
  2753. content: randomStr,
  2754. repost_code: 20000,
  2755. rid: videoAid,
  2756. csrf: Live_info.csrf_token
  2757. },
  2758. success: responseText => {
  2759. let res = HNTOOL.strToJson(responseText);
  2760. if (res.code === 0) {
  2761. console.log("转发一个视频成功:" + res.data.dynamic_id);
  2762. resolve(true);
  2763. } else {
  2764. javaex.tip({
  2765. content: "转发一个视频错误!" + res.message,
  2766. type: "error"
  2767. });
  2768. resolve(false);
  2769. }
  2770. }
  2771. })
  2772. });
  2773. },
  2774.  
  2775. /**
  2776. * 批量关注和拉黑 batchModify
  2777. *
  2778. * https://api.bilibili.com/x/relation/batch/modify
  2779. * @param uid
  2780. */
  2781.  
  2782. /**
  2783. * 发布动态
  2784. * @param {Object} mid
  2785. */
  2786. batchModify: async function(uids, act) {
  2787. return new Promise((resolve) => {
  2788. Ajax.post({
  2789. url: BILIBLI_PATH.api + "/x/relation/batch/modify",
  2790. hasCookies: true,
  2791. dataType: 'application/x-www-form-urlencoded',
  2792. data: {
  2793.  
  2794. "fids": uids,
  2795. "act": act == undefined ? 1 : act, //1 关注 5 拉黑
  2796. "re_src": 222,
  2797. "csrf": Live_info.csrf_token,
  2798. },
  2799. success: responseText => {
  2800. let res = HNTOOL.strToJson(responseText);
  2801. if (res.code === 0) {
  2802.  
  2803. if (res.data.failed_fids.length > 0) {
  2804. console.log("关注失败:" + res.data.failed_fids);
  2805. resolve(false);
  2806. } else {
  2807. console.log("关注成功:" + uids);
  2808. resolve(true);
  2809. }
  2810.  
  2811.  
  2812. } else {
  2813. javaex.tip({
  2814. content: "批量关注错误!" + res.message,
  2815. type: "error"
  2816. });
  2817. resolve(false);
  2818. }
  2819. }
  2820. })
  2821. });
  2822. },
  2823.  
  2824. /**
  2825. * 发布动态
  2826. * @param {Object} mid
  2827. */
  2828. sendOneDynamic: async function(content) {
  2829. return new Promise((resolve) => {
  2830. Ajax.post({
  2831. url: BILIBLI_PATH.vcapi + '/dynamic_svr/v1/dynamic_svr/create',
  2832. hasCookies: true,
  2833. dataType: 'application/x-www-form-urlencoded',
  2834. data: {
  2835. csrf: Live_info.csrf_token,
  2836. dynamic_id: 0,
  2837. type: 4,
  2838. dynamic_id: 0,
  2839. content: content,
  2840. extension: '{"emoji_type":1,"from":{"emoji_type":1},"flag_cfg":{}}'
  2841. },
  2842. hasCookies: true,
  2843. success: responseText => {
  2844. let res = HNTOOL.strToJson(responseText);
  2845. if (res.code === 0) {
  2846.  
  2847. console.log("随机发送一条动态:" + content);
  2848. resolve(true);
  2849.  
  2850. } else {
  2851. console.log("随机发送一条动态:" + res.message);
  2852. resolve(false);
  2853. }
  2854. }
  2855. })
  2856. });
  2857. },
  2858. /**
  2859. * @param {num} mid
  2860. * 用户详细信息2 (用于名片)
  2861. */
  2862. getInterfaceCard: async function(mid) {
  2863. return new Promise((resolve) => {
  2864. Ajax.get({
  2865. url: BILIBLI_PATH.api + '/x/web-interface/card',
  2866. queryStringsObj: {
  2867. "mid": mid
  2868. },
  2869. hasCookies: true,
  2870. success: responseText => {
  2871. let res = HNTOOL.strToJson(responseText);
  2872. if (res.code === 0) {
  2873.  
  2874. resolve(res.data.card);
  2875.  
  2876. } else {
  2877. console.log("获取用户详细信息失败:" + res.message);
  2878. resolve(false);
  2879. }
  2880. }
  2881. })
  2882. });
  2883. },
  2884.  
  2885.  
  2886. getLotteryNotice: async function(dynamic_id) {
  2887. return new Promise((resolve) => {
  2888. Ajax.get({
  2889. url: BILIBLI_PATH.vcapi + '/lottery_svr/v1/lottery_svr/lottery_notice',
  2890. queryStringsObj: {
  2891. "dynamic_id": dynamic_id
  2892. },
  2893. hasCookies: true,
  2894. success: responseText => {
  2895. let res = HNTOOL.strToJson(responseText);
  2896. if (res.code === 0) {
  2897.  
  2898. resolve(res.data);
  2899.  
  2900. } else {
  2901. console.log("获取开奖信息失败:" + res.message);
  2902. resolve(false);
  2903. }
  2904. }
  2905. })
  2906. });
  2907. },
  2908.  
  2909.  
  2910. likeDynamic: async function(dynamic_id) {
  2911.  
  2912. return new Promise((resolve) => {
  2913. Ajax.post({
  2914. url: BILIBLI_PATH.vcapi + '/dynamic_like/v1/dynamic_like/thumb',
  2915. hasCookies: true,
  2916. dataType: 'application/x-www-form-urlencoded',
  2917. data: {
  2918. uid: Live_info.uid,
  2919. dynamic_id: dynamic_id,
  2920. up: 1,
  2921. csrf: Live_info.csrf_token
  2922. },
  2923. success: responseText => {
  2924. let res = HNTOOL.strToJson(responseText);
  2925. if (res.code === 0) {
  2926.  
  2927. javaex.tip({
  2928. content: "动态点赞成功!",
  2929. type: "success"
  2930. });
  2931.  
  2932. resolve(true);
  2933. } else {
  2934.  
  2935. console.log("动态点赞发生错误!" + res.message);
  2936.  
  2937. javaex.tip({
  2938. content: "动态点赞发生错误!" + res.message,
  2939. type: "error"
  2940. });
  2941.  
  2942. resolve(false);
  2943. }
  2944. }
  2945. })
  2946. });
  2947. },
  2948.  
  2949. repostDynamic: async function(dynamic_id, content, ctrl) {
  2950.  
  2951. return new Promise((resolve) => {
  2952. Ajax.post({
  2953. url: BILIBLI_PATH.vcapi + '/dynamic_repost/v1/dynamic_repost/repost',
  2954. dataType: 'application/x-www-form-urlencoded',
  2955. hasCookies: true,
  2956. data: {
  2957. uid: Live_info.uid,
  2958. dynamic_id: dynamic_id,
  2959. content: content,
  2960. extension: '{"emoji_type":1}',
  2961. at_uids: "",
  2962. ctrl: ctrl == null || ctrl == "转发动态" ? "[]" : ctrl,
  2963. csrf_token: Live_info.csrf_token,
  2964. csrf: Live_info.csrf_token
  2965. },
  2966. success: responseText => {
  2967. let res = HNTOOL.strToJson(responseText);
  2968. if (res.code === 0) {
  2969.  
  2970. javaex.tip({
  2971. content: "动态转发成功!",
  2972. type: "success"
  2973. });
  2974.  
  2975. resolve(true);
  2976. } else {
  2977.  
  2978. console.log("动态转发发生错误!" + res.message);
  2979.  
  2980. javaex.tip({
  2981. content: "动态转发发生错误!" + res.message,
  2982. type: "error"
  2983. });
  2984.  
  2985. resolve(false);
  2986. }
  2987. }
  2988. })
  2989. });
  2990. },
  2991.  
  2992. addReply: async function(oid, type) {
  2993.  
  2994. return new Promise((resolve) => {
  2995. Ajax.post({
  2996. url: BILIBLI_PATH.api + '/x/v2/reply/add',
  2997. dataType: 'application/x-www-form-urlencoded',
  2998. hasCookies: true,
  2999. data: {
  3000. "oid": oid,
  3001. "type": type, //11官方 17 加码
  3002. "ordering": 'heat',
  3003. "message": HNTOOL.getRandomWordOfList(replyList) == undefined ? "不错[鼓掌]" :
  3004. HNTOOL.getRandomWordOfList(
  3005. replyList),
  3006. "jsonp": 'jsonp',
  3007. "csrf": Live_info.csrf_token
  3008. },
  3009. success: responseText => {
  3010. let res = HNTOOL.strToJson(responseText);
  3011. if (res.code === 0) {
  3012. javaex.tip({
  3013. content: "'自动评论成功'!",
  3014. type: "success"
  3015. });
  3016. resolve(0);
  3017. } else if (res.code === -404) {
  3018. console.log('自动评论原动态已删除');
  3019. resolve(0);
  3020. } else if (res.code === 12002) {
  3021. console.log('自动评论评论区已关闭');
  3022. resolve(0);
  3023. } else if (res.code === 12015) {
  3024. console.log('自动评论需要输入验证码');
  3025. resolve(1);
  3026. } else {
  3027. console.log('自动评论', `评论失败\n${responseText}`);
  3028. resolve(0);
  3029. }
  3030. }
  3031. })
  3032. });
  3033. },
  3034.  
  3035.  
  3036. setNotice: async function(notice) {
  3037.  
  3038. return new Promise((resolve) => {
  3039. Ajax.post({
  3040. url: BILIBLI_PATH.api + '/x/space/notice/set',
  3041. hasCookies: true,
  3042. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3043. data: {
  3044. notice: notice,
  3045. jsonp: 'jsonp',
  3046. csrf: Live_info.csrf_token
  3047. },
  3048. success: responseText => {
  3049. let res = HNTOOL.strToJson(responseText);
  3050. if (res.code === 0) {
  3051.  
  3052. javaex.tip({
  3053. content: "动态标记保存到个人公告成功!",
  3054. type: "success"
  3055. });
  3056.  
  3057. resolve(true);
  3058. } else {
  3059.  
  3060. javaex.tip({
  3061. content: res.message,
  3062. type: "error"
  3063. });
  3064.  
  3065. resolve(false);
  3066. }
  3067. }
  3068. })
  3069. });
  3070. },
  3071.  
  3072. getSpaceNotice: async function() {
  3073. return new Promise((resolve) => {
  3074. Ajax.get({
  3075. url: BILIBLI_PATH.api + '/x/space/notice',
  3076. queryStringsObj: {
  3077. "mid": Live_info.uid
  3078. },
  3079. hasCookies: true,
  3080. success: responseText => {
  3081. let res = HNTOOL.strToJson(responseText);
  3082. if (res.code === 0) {
  3083.  
  3084. resolve(res.data);
  3085.  
  3086. } else {
  3087. console.log("获取公告信息失败:" + res.message);
  3088. resolve(false);
  3089. }
  3090. }
  3091. })
  3092. });
  3093. },
  3094.  
  3095. getdynamicData: async function(dynamic_id_str) {
  3096. return new Promise((resolve) => {
  3097. Ajax.get({
  3098.  
  3099. url: BILIBLI_PATH.vcapi + '/dynamic_svr/v1/dynamic_svr/get_dynamic_detail',
  3100. queryStringsObj: {
  3101. "dynamic_id": dynamic_id_str
  3102. },
  3103. hasCookies: true,
  3104. success: responseText => {
  3105. let res = HNTOOL.strToJson(responseText);
  3106. if (res.code === 0) {
  3107.  
  3108. resolve(res.data);
  3109.  
  3110. } else {
  3111. console.log("获取动态信息失败:" + res.message);
  3112. resolve(false);
  3113. }
  3114. }
  3115. })
  3116. });
  3117. },
  3118.  
  3119. getAllFollow: async function() {
  3120. return new Promise((resolve) => {
  3121. Ajax.get({
  3122.  
  3123. url: BILIBLI_PATH.vcapi + '/feed/v1/feed/get_attention_list',
  3124. queryStringsObj: {
  3125. "uid": Live_info.uid
  3126. },
  3127. hasCookies: true,
  3128. success: responseText => {
  3129. let res = HNTOOL.strToJson(responseText);
  3130. if (res.code === 0) {
  3131.  
  3132. resolve(res.data.list);
  3133.  
  3134. } else {
  3135. console.log("查询失败!" + res.message);
  3136. resolve(false);
  3137. }
  3138. }
  3139. })
  3140. });
  3141. },
  3142.  
  3143. getCardByUID: async function(UID) {
  3144. return new Promise((resolve) => {
  3145. Ajax.get({
  3146.  
  3147. url: BILIBLI_PATH.api + '/x/web-interface/card',
  3148. queryStringsObj: {
  3149. "mid": UID
  3150. },
  3151. hasCookies: true,
  3152. success: responseText => {
  3153. let res = HNTOOL.strToJson(responseText);
  3154. if (res.code === 0) {
  3155.  
  3156. resolve(res.data.card);
  3157.  
  3158. } else {
  3159. console.log("查询失败!" + res.message);
  3160. resolve(false);
  3161. }
  3162. }
  3163. })
  3164. });
  3165. },
  3166.  
  3167.  
  3168. /**
  3169. *
  3170. *
  3171. */
  3172.  
  3173. getTodayDynamicList: async function(mid, index) {
  3174. return new Promise((resolve) => {
  3175. Ajax.get({
  3176.  
  3177. url: BILIBLI_PATH.api + '/x/space/article',
  3178. queryStringsObj: {
  3179. "mid": mid,
  3180. "pn": 1,
  3181. "ps": 12,
  3182. "sort": 'publish_time'
  3183. },
  3184. hasCookies: true,
  3185. success: responseText => {
  3186. let res = HNTOOL.strToJson(responseText);
  3187. if (res.code === 0) {
  3188. let artlist = false;
  3189. let articlesList = [];
  3190. let articles = res.data.articles;
  3191. for (var i = 0, len = articles.length; i < index; i++) {
  3192. articlesList[i] = articles[i];
  3193. }
  3194.  
  3195. resolve(articlesList);
  3196. } else {
  3197.  
  3198.  
  3199. console.log("查询失败!" + res.message);
  3200. resolve(false);
  3201. }
  3202. }
  3203. })
  3204. });
  3205. },
  3206.  
  3207. getDataByLiveSid: async function(ids) {
  3208. return new Promise((resolve) => {
  3209. Ajax.get({
  3210.  
  3211. url: BILIBLI_PATH.api + '/x/activity/up/reserve/relation/info',
  3212. queryStringsObj: {
  3213. "ids": ids
  3214. },
  3215. hasCookies: true,
  3216. success: responseText => {
  3217. let res = HNTOOL.strToJson(responseText);
  3218. if (res.code === 0 && Object.keys(res.data.list).length != 0) {
  3219.  
  3220. resolve(res.data.list);
  3221. } else {
  3222.  
  3223. /* javaex.tip({
  3224. content: "查询失败!" + res.message,
  3225. type: "error"
  3226. }); */
  3227. console.log("查询失败!" + res.message);
  3228.  
  3229. resolve(false);
  3230. }
  3231. }
  3232. })
  3233. });
  3234. },
  3235.  
  3236. /**
  3237. * 每日登录 https://api.bilibili.com/x/report/click/now : "jsonp"
  3238. */
  3239. clickNow: async function() {
  3240. return new Promise((resolve) => {
  3241. Ajax.get({
  3242.  
  3243. url: BILIBLI_PATH.api + '/x/report/click/now',
  3244. queryStringsObj: {
  3245. jsonp: "jsonp"
  3246. },
  3247. hasCookies: true,
  3248. success: responseText => {
  3249. let res = HNTOOL.strToJson(responseText);
  3250. if (res.code === 0) {
  3251.  
  3252. javaex.tip({
  3253. content: "每日登录" + res.data.text,
  3254. type: "success"
  3255. });
  3256. resolve(true);
  3257.  
  3258. } else {
  3259.  
  3260. javaex.tip({
  3261. content: res.message,
  3262. type: "error"
  3263. });
  3264.  
  3265. resolve(false);
  3266. }
  3267. }
  3268. })
  3269. });
  3270. },
  3271.  
  3272. /**
  3273. * 每日分享视频(客户端) psot https://api.bilibili.com/x/web-interface/share/add aid csrf
  3274. * @param {number} videoAid
  3275. */
  3276. addShare: async function(videoAid) {
  3277. return new Promise((resolve) => {
  3278. Ajax.post({
  3279. url: BILIBLI_PATH.api + '/x/web-interface/share/add',
  3280. hasCookies: true,
  3281. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3282. data: {
  3283. aid: videoAid,
  3284. csrf: Live_info.csrf_token
  3285. },
  3286. success: responseText => {
  3287. let res = HNTOOL.strToJson(responseText);
  3288. if (res.code === 0) {
  3289.  
  3290. javaex.tip({
  3291. content: "每日分享视频成功",
  3292. type: "success"
  3293. });
  3294.  
  3295. resolve(true);
  3296. } else {
  3297.  
  3298. javaex.tip({
  3299. content: res.message,
  3300. type: "error"
  3301. });
  3302.  
  3303. resolve(false);
  3304. }
  3305. }
  3306. })
  3307. });
  3308. },
  3309.  
  3310.  
  3311.  
  3312. /**
  3313. * 每日视频投币 post https://api.bilibili.com/x/web-interface/coin/add
  3314. * @param {number} videoAid
  3315. */
  3316. addArticleCoin: async function(cvID, mid) {
  3317. return new Promise((resolve) => {
  3318. Ajax.post({
  3319. url: BILIBLI_PATH.api + '/x/web-interface/coin/add',
  3320. hasCookies: true,
  3321. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3322. data: {
  3323. aid: cvID,
  3324. upid: mid,
  3325. multiply: 2,
  3326. avtype: 2,
  3327. csrf: Live_info.csrf_token
  3328. },
  3329. success: responseText => {
  3330. let res = HNTOOL.strToJson(responseText);
  3331. if (res.code === 0) {
  3332.  
  3333. javaex.tip({
  3334. content: '专栏:' + cvID + "投币成功",
  3335. type: "success"
  3336. });
  3337.  
  3338. resolve(true);
  3339. } else {
  3340.  
  3341. javaex.tip({
  3342. content: res.message,
  3343. type: "error"
  3344. });
  3345.  
  3346. console.log('专栏投币失败:' + cvID + res.message);
  3347.  
  3348. resolve(false);
  3349. }
  3350. }
  3351. })
  3352. });
  3353. },
  3354.  
  3355. /**
  3356. * 每日视频投币 post https://api.bilibili.com/x/web-interface/coin/add
  3357. * @param {number} videoAid
  3358. */
  3359. addVideoCoin: async function(videoAid) {
  3360. return new Promise((resolve) => {
  3361. Ajax.post({
  3362. url: BILIBLI_PATH.api + '/x/web-interface/coin/add',
  3363. hasCookies: true,
  3364. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3365. data: {
  3366. aid: videoAid,
  3367. multiply: 2,
  3368. select_like: 0,
  3369. cross_domain: true,
  3370. csrf: Live_info.csrf_token
  3371. },
  3372. success: responseText => {
  3373. let res = HNTOOL.strToJson(responseText);
  3374. if (res.code === 0) {
  3375.  
  3376. javaex.tip({
  3377. content: "投币成功",
  3378. type: "success"
  3379. });
  3380.  
  3381. resolve(true);
  3382. } else {
  3383.  
  3384. javaex.tip({
  3385. content: res.message,
  3386. type: "error"
  3387. });
  3388.  
  3389. resolve(false);
  3390. }
  3391. }
  3392. })
  3393. });
  3394. },
  3395.  
  3396.  
  3397. //1.直播签到 https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign
  3398.  
  3399. DoSign: async function() {
  3400. return new Promise((resolve) => {
  3401. Ajax.get({
  3402.  
  3403. url: BILIBLI_PATH.live + '/xlive/web-ucenter/v1/sign/DoSign',
  3404. queryStringsObj: {
  3405.  
  3406. },
  3407. hasCookies: true,
  3408. success: responseText => {
  3409. let res = HNTOOL.strToJson(responseText);
  3410. if (res.code === 0) {
  3411.  
  3412. javaex.tip({
  3413. content: "签到成功:" + res.data.text,
  3414. type: "success"
  3415. });
  3416. resolve(true);
  3417.  
  3418. } else if (res.code === 1011040) {
  3419.  
  3420. javaex.tip({
  3421. content: res.message,
  3422. type: "success"
  3423. });
  3424.  
  3425. resolve(true);
  3426. } else {
  3427.  
  3428. javaex.tip({
  3429. content: res.message,
  3430. type: "error"
  3431. });
  3432.  
  3433. resolve(false);
  3434. }
  3435. }
  3436. })
  3437. });
  3438. },
  3439.  
  3440.  
  3441. /**
  3442. * // 获取分区最新专栏列表 https://api.bilibili.com/x/article/recommends?cid=0&pn=1
  3443. */
  3444. getArticleRecommends: async function() {
  3445. return new Promise((resolve) => {
  3446. Ajax.get({
  3447.  
  3448. url: BILIBLI_PATH.api + '/x/article/recommends',
  3449. queryStringsObj: {
  3450. "cid": 0,
  3451. "pn": 1
  3452. },
  3453. hasCookies: true,
  3454. success: responseText => {
  3455. let res = HNTOOL.strToJson(responseText);
  3456. if (res.code === 0) {
  3457.  
  3458. javaex.tip({
  3459. content: "获取最新专栏成功!",
  3460. type: "success"
  3461. });
  3462. resolve(res.data);
  3463.  
  3464. } else {
  3465.  
  3466. javaex.tip({
  3467. content: "获取最新专栏失败!" + res.message,
  3468. type: "error"
  3469. });
  3470.  
  3471. console.log(res.message);
  3472.  
  3473. resolve(false);
  3474. }
  3475. }
  3476. })
  3477. });
  3478. },
  3479. /**
  3480. * // 获取分区最新视频列表
  3481. */
  3482. getDynamicRegion: async function() {
  3483. return new Promise((resolve) => {
  3484. Ajax.get({
  3485.  
  3486. url: BILIBLI_PATH.api + '/x/web-interface/dynamic/region',
  3487. queryStringsObj: {
  3488. "pn": 1,
  3489. "ps": 20,
  3490. "rid": 21
  3491. },
  3492. hasCookies: true,
  3493. success: responseText => {
  3494. let res = HNTOOL.strToJson(responseText);
  3495. if (res.code === 0) {
  3496.  
  3497. javaex.tip({
  3498. content: "获取分区最新视频成功",
  3499. type: "success"
  3500. });
  3501. resolve(res.data.archives);
  3502.  
  3503. } else {
  3504.  
  3505. javaex.tip({
  3506. content: "获取分区最新视频失败" + res.message,
  3507. type: "error"
  3508. });
  3509.  
  3510. resolve(false);
  3511. }
  3512. }
  3513. })
  3514. });
  3515. },
  3516.  
  3517. /*
  3518. * 预约抽奖 https://api.bilibili.com/x/space/reserve sid jsonp=jsonp csrf
  3519. * @param {Object} sid
  3520. */
  3521. reserveActivity: async function(sid) {
  3522. return new Promise((resolve) => {
  3523. Ajax.post({
  3524. url: BILIBLI_PATH.api + '/x/space/reserve',
  3525. hasCookies: true,
  3526. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3527. data: {
  3528. sid: sid, //当前用户
  3529. jsonp: "jsonp",
  3530. csrf: Live_info.csrf_token
  3531. },
  3532. success: responseText => {
  3533. let res = HNTOOL.strToJson(responseText);
  3534. if (res.code === 0) {
  3535.  
  3536. resolve(true);
  3537. } else {
  3538. javaex.tip({
  3539. content: res.message,
  3540. type: "error"
  3541. });
  3542. resolve(false);
  3543. }
  3544. }
  3545. })
  3546. });
  3547. },
  3548. /**
  3549. reserveActivity: async function(sid, reserve_total) {
  3550. return new Promise((resolve) => {
  3551. Ajax.post({
  3552. url: BILIBLI_PATH.vcapi + '/dynamic_mix/v1/dynamic_mix/reserve_attach_card_button',
  3553. hasCookies: true,
  3554. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3555. data: {
  3556. reserve_id: sid,
  3557. cur_btn_status: 1,
  3558. reserve_total: reserve_total,
  3559. csrf: Live_info.csrf_token
  3560. },
  3561. success: responseText => {
  3562. let res = HNTOOL.strToJson(responseText);
  3563. if (res.code === 0) {
  3564.  
  3565. resolve(res.data);
  3566. } else {
  3567.  
  3568. javaex.tip({
  3569. content: res.message,
  3570. type: "error"
  3571. });
  3572.  
  3573. resolve(false);
  3574. }
  3575. }
  3576. })
  3577. });
  3578. }, */
  3579.  
  3580. getGiftList: async function(room) {
  3581. return new Promise((resolve) => {
  3582. Ajax.get({
  3583.  
  3584. url: BILIBLI_PATH.live + '/xlive/web-room/v1/gift/bag_list',
  3585. queryStringsObj: {
  3586. "room_id": room
  3587. },
  3588. hasCookies: true,
  3589. success: responseText => {
  3590. let res = HNTOOL.strToJson(responseText);
  3591. if (res.code === 0) {
  3592.  
  3593. resolve(res.data.list);
  3594. } else {
  3595.  
  3596. javaex.tip({
  3597. content: "查询包裹失败!" + res.message,
  3598. type: "error"
  3599. });
  3600.  
  3601. resolve(false)
  3602. }
  3603. }
  3604. })
  3605. });
  3606. },
  3607.  
  3608. /**
  3609. * 送银B克拉
  3610. * @param {Object} ruid
  3611. * @param {Object} roomid
  3612. */
  3613. bagSendGift: async function(ruid, roomid, bag_id) {
  3614. return new Promise((resolve) => {
  3615. Ajax.post({
  3616. url: BILIBLI_PATH.live + '/gift/v2/live/bag_send',
  3617. hasCookies: true,
  3618. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3619. data: {
  3620. uid: Live_info.uid, //当前用户
  3621. gift_id: 3,
  3622. ruid: ruid,
  3623. send_ruid: 0,
  3624. gift_num: 1,
  3625. bag_id: bag_id,
  3626. //rnd: Math.round(new Date() / 1000); //时间戳,
  3627. platform: 'pc',
  3628. biz_code: 'Live',
  3629. biz_id: roomid,
  3630. storm_beat_id: 0,
  3631. price: 0,
  3632. csrf_token: Live_info.csrf_token,
  3633. csrf: Live_info.csrf_token
  3634.  
  3635. },
  3636. success: responseText => {
  3637. let res = HNTOOL.strToJson(responseText);
  3638. if (res.code === 0) {
  3639.  
  3640. javaex.tip({
  3641. content: roomid + "赠送b克拉成功!" + res.message,
  3642. type: "success"
  3643. });
  3644.  
  3645. resolve(true);
  3646. } else {
  3647.  
  3648. javaex.tip({
  3649. content: res.message,
  3650. type: "error"
  3651. });
  3652.  
  3653. resolve(false);
  3654. }
  3655. }
  3656. })
  3657. });
  3658. },
  3659.  
  3660.  
  3661. /**
  3662. * 判断是否有勋章
  3663. * @param {Object} uid
  3664. * @param {Object} room
  3665. */
  3666.  
  3667. getFansMedalInfo: async function(uid, room) {
  3668. return new Promise((resolve) => {
  3669. Ajax.get({
  3670.  
  3671. url: BILIBLI_PATH.live + '/xlive/app-ucenter/v1/fansMedal/fans_medal_info',
  3672. queryStringsObj: {
  3673. "target_id": uid,
  3674. "room_id": room
  3675. },
  3676. //dataType:'application/json, text/plain, */*',
  3677. hasCookies: true,
  3678. success: responseText => {
  3679. let res = HNTOOL.strToJson(responseText);
  3680. if (res.code === 0) {
  3681.  
  3682. if (res.data.my_fans_medal.level == 0) {
  3683. resolve(false)
  3684. } else {
  3685. resolve(true)
  3686. }
  3687.  
  3688. } else {
  3689.  
  3690. javaex.tip({
  3691. content: "查询勋章失败!" + res.message,
  3692. type: "error"
  3693. });
  3694.  
  3695. resolve(false)
  3696. }
  3697. }
  3698. })
  3699. });
  3700. },
  3701.  
  3702.  
  3703.  
  3704.  
  3705. getDisuidList: async function(re_version, pn) {
  3706. return new Promise((resolve) => {
  3707. Ajax.get({
  3708.  
  3709. url: BILIBLI_PATH.api + '/x/relation/blacks',
  3710. queryStringsObj: {
  3711. "re_version": re_version,
  3712. "pn": pn
  3713. },
  3714. hasCookies: true,
  3715. success: responseText => {
  3716. let res = HNTOOL.strToJson(responseText);
  3717. if (res.code === 0) {
  3718. resolve(res.data.list)
  3719. } else {
  3720.  
  3721. javaex.tip({
  3722. content: "查询黑名单失败!" + res.message,
  3723. type: "error"
  3724. });
  3725.  
  3726. resolve(null)
  3727. }
  3728. }
  3729. })
  3730. });
  3731. },
  3732.  
  3733. /**
  3734. * @param {Object} uid
  3735. * @param {Object} act 1关注,2取关,3悄悄关注,4取消悄悄关注,5拉黑,6取消拉黑,7踢出粉丝;
  3736. */
  3737. cancelAtt: async function(uid, act, re_src) {
  3738. return new Promise((resolve) => {
  3739. Ajax.post({
  3740. url: BILIBLI_PATH.api + '/x/relation/modify',
  3741. hasCookies: true,
  3742. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3743. data: {
  3744. fid: uid,
  3745. act: act,
  3746. re_src: re_src == undefined ? 11 : 116,
  3747. jsonp: "jsonp",
  3748. csrf: Live_info.csrf_token,
  3749. },
  3750. success: responseText => {
  3751. let res = HNTOOL.strToJson(responseText);
  3752. if (res.code === 0) {
  3753.  
  3754. //HNAPI.cancelAtt(uid, 6);
  3755.  
  3756. javaex.tip({
  3757. content: "取关成功!" + res.message,
  3758. type: "success"
  3759. });
  3760.  
  3761. resolve(true);
  3762. } else if (res.code === 22003) {
  3763.  
  3764. HNAPI.cancelAtt(uid, 6);
  3765.  
  3766. javaex.tip({
  3767. content: "取消拉黑" + res.message,
  3768. type: "success"
  3769. });
  3770. resolve(true);
  3771. } else {
  3772.  
  3773. javaex.tip({
  3774. content: res.message,
  3775. type: "error"
  3776. });
  3777.  
  3778. resolve(false);
  3779. }
  3780. }
  3781. })
  3782. });
  3783. },
  3784.  
  3785. getRoomMsg: async function(roomid) {
  3786. return new Promise((resolve) => {
  3787. Ajax.get({
  3788.  
  3789. url: BILIBLI_PATH.live + '/live_user/v1/UserInfo/get_anchor_in_room',
  3790. queryStringsObj: {
  3791. "roomid": roomid
  3792. },
  3793. hasCookies: true,
  3794. success: responseText => {
  3795. let res = HNTOOL.strToJson(responseText);
  3796. if (res.code === 0) {
  3797. resolve(res.data.info.uid)
  3798. } else {
  3799. resolve(false)
  3800. }
  3801. }
  3802. })
  3803. });
  3804. },
  3805.  
  3806. /**
  3807. *
  3808. * @param sid
  3809. * @returns {Promise<unknown>}
  3810. */
  3811. lotteryDo: async function(sid) {
  3812. return new Promise((resolve) => {
  3813. let func_url = BILIBLI_PATH.api + '/x/activity/lottery/do';
  3814. if (sid.indexOf("newLottery") != -1) {
  3815. func_url = BILIBLI_PATH.api + "/x/lottery/do";
  3816. }
  3817. Ajax.post({
  3818. url: func_url,
  3819. hasCookies: true,
  3820. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3821. data: {
  3822.  
  3823. sid: sid,
  3824. type: 1,
  3825. csrf: Live_info.csrf_token,
  3826. },
  3827. success: responseText => {
  3828. let res = HNTOOL.strToJson(responseText);
  3829. if (res.code === 0) {
  3830. HNTOOL.console("转盘:" + sid + "\n" + (res.data)[0].gift_name);
  3831. resolve((res.data)[0].gift_name);
  3832.  
  3833. } else if (res.code === 75400) {
  3834.  
  3835. resolve(true);
  3836. } else {
  3837. javaex.tip({
  3838. content: "本次抽奖失败!" + res.message,
  3839. type: "error"
  3840. });
  3841. resolve(false);
  3842. }
  3843. }
  3844. })
  3845. });
  3846. },
  3847.  
  3848.  
  3849. getLotteryMytimes: async function(sid) {
  3850. let func_url = BILIBLI_PATH.api + '/x/activity/lottery/mytimes';
  3851. if (sid.indexOf("newLottery") != -1) {
  3852. func_url = BILIBLI_PATH.api + "/x/lottery/mytimes";
  3853. }
  3854. return new Promise((resolve) => {
  3855. Ajax.get({
  3856. url: func_url,
  3857. queryStringsObj: {
  3858. sid: sid
  3859. },
  3860. hasCookies: true,
  3861. success: responseText => {
  3862. let res = HNTOOL.strToJson(responseText);
  3863. if (res.code === 0) {
  3864. resolve(res.data.times)
  3865. } else {
  3866. resolve(0)
  3867. }
  3868. }
  3869. })
  3870. });
  3871. },
  3872.  
  3873. /**
  3874. * 增加抽奖次数一般是分享
  3875. * @param sid 活动sid
  3876. * @returns {Promise<unknown>} 0 成功 1:活动结束
  3877. */
  3878. addLotteryTimes: async function(sid) {
  3879. let func_url = BILIBLI_PATH.api + '/x/activity/lottery/addtimes';
  3880. if (sid.indexOf("newLottery") != -1) {
  3881. func_url = BILIBLI_PATH.api + "/x/lottery/addtimes";
  3882. }
  3883.  
  3884. return new Promise((resolve) => {
  3885. Ajax.post({
  3886. url: func_url,
  3887. hasCookies: true,
  3888. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  3889. data: {
  3890.  
  3891. sid: sid,
  3892. action_type: 3,
  3893. csrf: Live_info.csrf_token,
  3894. },
  3895. success: responseText => {
  3896. let res = HNTOOL.strToJson(responseText);
  3897. if (res.code === 0) {
  3898.  
  3899. resolve(0)
  3900. } else if (res.code === 75003 || res.code === 170405) {
  3901.  
  3902. resolve(1)
  3903.  
  3904. } else {
  3905.  
  3906. resolve(res.message);
  3907. }
  3908. }
  3909. })
  3910. });
  3911. },
  3912. /**
  3913. * 查询用户关注 默认一次查询50
  3914. * @param vmid 用户uid
  3915. * @param pn 页码
  3916. * @returns {Promise<unknown>}
  3917. */
  3918. getMyFollow: async function(vmid, pn) {
  3919. return new Promise((resolve) => {
  3920. Ajax.get({
  3921. url: BILIBLI_PATH.api + '/x/relation/followings',
  3922. queryStringsObj: {
  3923. vmid: vmid,
  3924. pn: pn
  3925. },
  3926. hasCookies: true,
  3927. success: responseText => {
  3928. let res = HNTOOL.strToJson(responseText);
  3929. if (res.code === 0) {
  3930. resolve(res.data)
  3931. } else {
  3932. resolve(null)
  3933. }
  3934. }
  3935. })
  3936. });
  3937. },
  3938.  
  3939.  
  3940. getMyinfo: function() {
  3941. return new Promise((resolve) => {
  3942. Ajax.get({
  3943. url: BILIBLI_PATH.api + '/x/space/myinfo',
  3944. queryStringsObj: {},
  3945. hasCookies: true,
  3946. success: responseText => {
  3947. let res = HNTOOL.strToJson(responseText);
  3948. if (res.code === 0) {
  3949. resolve(res.data)
  3950. } else {
  3951. resolve(null)
  3952. }
  3953. }
  3954. })
  3955. });
  3956. },
  3957.  
  3958. getMyJson: function(url) {
  3959. return new Promise((resolve) => {
  3960. GM_xmlhttpRequest({
  3961. method: "GET",
  3962. url: url,
  3963. onload: function(response) {
  3964. const res = HNTOOL.strToJson((response || {}).responseText)
  3965. resolve(res);
  3966. }
  3967. });
  3968. })
  3969. },
  3970.  
  3971.  
  3972. userInfo: function(mid) {
  3973.  
  3974. Ajax.get({
  3975. url: BILIBLI_PATH.api + '/x/space/acc/info',
  3976. queryStringsObj: {
  3977. mid: mid
  3978. },
  3979. hasCookies: true,
  3980. success: responseText => {
  3981.  
  3982. var json = JSON.parse(responseText);
  3983.  
  3984. if (json.code != 0) {
  3985.  
  3986.  
  3987. }
  3988. }
  3989. });
  3990.  
  3991. },
  3992.  
  3993. sendQmsg: async function(key, msg) {
  3994.  
  3995. $.ajax({
  3996. url: "https://qmsg.zendee.cn/send/" + key + "?msg=" + msg,
  3997.  
  3998. success: function(result) {
  3999.  
  4000. }
  4001. });
  4002.  
  4003.  
  4004. /*GM_xmlhttpRequest({
  4005. method: "GET",
  4006. url: `https://qmsg.zendee.cn/send/${key}?msg=${msg}`,
  4007. onload: function (response) {
  4008.  
  4009. let json = JSON.parse(response.response);
  4010. if (json.code == 0) {
  4011.  
  4012. javaex.tip({
  4013. content: "自动动态中奖提醒成功!" + json.reason,
  4014. type: "success"
  4015. });
  4016. } else {
  4017. console.log("自动动态中奖提醒失败!" + json.reason);
  4018. javaex.tip({
  4019. content: "自动动态中奖提醒失败!" + json.reason,
  4020. type: "error"
  4021. });
  4022. }
  4023.  
  4024. }
  4025. });*/
  4026.  
  4027. },
  4028.  
  4029. /**
  4030. * //https://api.bilibili.com/x/relation/modify
  4031. *
  4032. * @param UID
  4033. */
  4034. disUserByUid: function(vmid) {
  4035.  
  4036. Ajax.post({
  4037. url: BILIBLI_PATH.api + '/x/relation/modify',
  4038. data: {
  4039. fid: parseInt(vmid),
  4040. re_src: 11,
  4041. act: 5,
  4042. jsonp: "jsonp",
  4043. csrf: Live_info.csrf_token,
  4044. },
  4045. hasCookies: true,
  4046. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  4047. success: responseText => {
  4048.  
  4049. var json = JSON.parse(responseText);
  4050.  
  4051. if (json.code != 0) {
  4052.  
  4053. console.log("拉黑用户失败uid:" + vmid + " 错误信息" + json.message);
  4054. javaex.tip({
  4055. content: "拉黑用户失败uid:" + vmid + " 错误信息" + json.message,
  4056. type: "error"
  4057. });
  4058.  
  4059. } else {
  4060. console.log("拉黑用户成功 uid:" + vmid);
  4061. javaex.tip({
  4062. content: "拉黑用户成功 uid:" + vmid,
  4063. type: "success"
  4064. });
  4065. }
  4066. }
  4067. });
  4068.  
  4069. },
  4070. /**
  4071. * http://api.bilibili.com/x/web-interface/view
  4072. * @param BV
  4073. * 心跳间隔15秒
  4074. */
  4075. watchOneVideo: function(BV, MID) {
  4076.  
  4077. //1.调用点击播放接口 https://api.bilibili.com/x/click-interface/click/web/h5
  4078. Ajax.post({
  4079. url: BILIBLI_PATH.api + "/x/click-interface/click/web/h5",
  4080. hasCookies: true,
  4081. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  4082. data: {
  4083.  
  4084. "bvid": BV,
  4085. "part": 1,
  4086. "mid": Live_info.uid,
  4087. "lv": 2,
  4088. "jsonp": "jsonp",
  4089. "type": 3,
  4090. "sub_type": 0
  4091. },
  4092. success: responseText => {
  4093.  
  4094. let json = JSON.parse(responseText);
  4095.  
  4096. if (/^{"code":0/.test(responseText)) {
  4097. //发送一次心跳
  4098. HNAPI.sendHeartbeat(BV, MID);
  4099.  
  4100. } else {
  4101. javaex.tip({
  4102. content: "视频" + data.bvid + "播放失败!" + json.message,
  4103. type: "error"
  4104. });
  4105. }
  4106. }
  4107. })
  4108.  
  4109.  
  4110. },
  4111.  
  4112. //上报视频播放心跳(web端)
  4113. /**
  4114. * http://api.bilibili.com/x/click-interface/web/heartbeat
  4115. * @param json
  4116. */
  4117. sendHeartbeat: function(bvid, MID) {
  4118.  
  4119. Ajax.post({
  4120. url: BILIBLI_PATH.api + "/x/click-interface/web/heartbeat",
  4121. hasCookies: true,
  4122. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  4123. //aid=756988764&bvid=BV1wr4y1P782&cid=304166326&page=1
  4124. data: {
  4125. "bvid": bvid,
  4126. "type": 3,
  4127. "dt": 2,
  4128. "played_time": HNTOOL.random(12, 40),
  4129. "realtime": HNTOOL.random(12, 40),
  4130. "play_type": 0
  4131. },
  4132. success: responseText => {
  4133.  
  4134. if (/^{"code":0/.test(responseText) && MID != BiliData.author_uid) {
  4135.  
  4136. javaex.tip({
  4137. content: "视频BV" + bvid + "播放一次!",
  4138. type: "success"
  4139. });
  4140. }
  4141. }
  4142. })
  4143.  
  4144. },
  4145.  
  4146. //获取up所有投稿视频
  4147. /**
  4148. * https://api.bilibili.com/x/space/arc/search?mid=99439379&ps=30&tid=0&pn=1&keyword=&order=pubdate&jsonp=jsonp
  4149. * @param mid
  4150. */
  4151. getUpAllBV: function(mid, pn, ps) {
  4152. ps = (ps === undefined ? 30 : ps); // a默认值为1
  4153. Ajax.get({
  4154. url: BILIBLI_PATH.api + '/x/space/arc/search',
  4155. queryStringsObj: {
  4156. mid: mid,
  4157. tid: 0,
  4158. order: 'pubdate',
  4159. jsonp: 'jsonp',
  4160. pn: pn,
  4161. ps: ps
  4162. },
  4163. hasCookies: true,
  4164. success: responseText => {
  4165.  
  4166. var json = JSON.parse(responseText);
  4167.  
  4168. if (json.code != 0) {
  4169.  
  4170. javaex.tip({
  4171. content: "获取up所有投稿视频失败!" + json.message,
  4172. type: "success"
  4173. });
  4174.  
  4175. } else {
  4176. BiliData.BVList = json.data.list.vlist;
  4177.  
  4178. }
  4179. }
  4180. });
  4181.  
  4182. },
  4183.  
  4184.  
  4185. /**
  4186. *
  4187. * @param path
  4188. * @param data
  4189. * @param saveObj
  4190. * @param Func
  4191. */
  4192. publicGet: function(path, queryStringsObj) {
  4193.  
  4194. if (typeof(queryStringsObj) != "undefined") {
  4195. queryStringsObj = {};
  4196. }
  4197. Ajax.get({
  4198. url: BILIBLI_PATH.api + path,
  4199. queryStringsObj: queryStringsObj,
  4200. hasCookies: true,
  4201. success: responseText => {
  4202.  
  4203. let json = JSON.parse(responseText);
  4204. if (chackCode(json.code) && json.code == 0) {
  4205.  
  4206. return json.data;
  4207. }
  4208.  
  4209. return false;
  4210.  
  4211. }
  4212. })
  4213.  
  4214. },
  4215.  
  4216. /**
  4217. * 导航栏用户信息
  4218. */
  4219. getUserNav: async function() {
  4220.  
  4221. GM_xmlhttpRequest({
  4222. method: "GET",
  4223. url: BILIBLI_PATH.api + "/x/web-interface/nav",
  4224. //timeout:3000,
  4225. onload: function(response) {
  4226.  
  4227. let json = JSON.parse(response.response);
  4228. console.log(json);
  4229. BiliData.login_code = json.code;
  4230. BiliData.login_message = json.message;
  4231. BiliData.LoginData = json.data;
  4232.  
  4233. }
  4234. });
  4235.  
  4236. },
  4237.  
  4238. /**
  4239. * 获取某up详细信息
  4240. * http://api.bilibili.com/x/web-interface/card
  4241. */
  4242. getUpCard: function(mid) {
  4243.  
  4244. Ajax.get({
  4245. url: BILIBLI_PATH.api + '/x/web-interface/card',
  4246. queryStringsObj: {
  4247. mid: mid,
  4248. photo: false
  4249. },
  4250. hasCookies: true,
  4251. success: responseText => {
  4252.  
  4253. var json = JSON.parse(responseText);
  4254.  
  4255. if (json.code != 0) {
  4256.  
  4257. javaex.tip({
  4258. content: "查询失败!" + json.message,
  4259. type: "success"
  4260. });
  4261. return false;
  4262. } else {
  4263. BiliData.upCard = json;
  4264.  
  4265. }
  4266.  
  4267.  
  4268. }
  4269. })
  4270.  
  4271. },
  4272.  
  4273. /**
  4274. *
  4275. * @param uid 用户uid
  4276. * @param ps 每页视频个数 默认30个
  4277. * @param pn 第几页
  4278. */
  4279. getUpAllVideo: function(uid, ps, pn) {
  4280.  
  4281. },
  4282. getChallenge: async function() {
  4283.  
  4284.  
  4285. },
  4286. /**
  4287. * 硬币记录
  4288. * @returns {Promise<void>}
  4289. */
  4290. getCoinLog: async function() {
  4291.  
  4292. GM_xmlhttpRequest({
  4293. method: "GET",
  4294. url: BILIBLI_PATH.api + "/x/member/web/coin/log",
  4295. //url: "http://api.bilibili.com/x/member/web/coin/log",
  4296. onload: function(response) {
  4297.  
  4298. let json = JSON.parse(response.response);
  4299. if (json.code == 0) {
  4300.  
  4301. console.log("硬币记录" + json);
  4302. BiliData.CoinLog = json.data;
  4303.  
  4304. return true;
  4305. }
  4306.  
  4307. }
  4308. });
  4309. },
  4310. /**
  4311. * 未读消息数 http://api.bilibili.com/x/msgfeed/unread
  4312. * @returns {Promise<void>}
  4313. */
  4314. getUnread: async function() {
  4315.  
  4316. Ajax.get({
  4317. url: BILIBLI_PATH.api + "/x/msgfeed/unread",
  4318. hasCookies: true,
  4319. success: responseText => {
  4320.  
  4321. let json = JSON.parse(responseText);
  4322. if (chackCode(json.code) && json.code == 0) {
  4323.  
  4324. BiliData.Unread = json.data;
  4325. showUnreadMsg();
  4326. }
  4327.  
  4328. return false;
  4329.  
  4330. }
  4331. })
  4332.  
  4333. /* GM_xmlhttpRequest({
  4334. method: "GET",
  4335. url: BILIBLI_PATH.api + "/x/msgfeed/unread",
  4336. onload: function (response) {
  4337.  
  4338. let json = JSON.parse(response.response);
  4339.  
  4340. if (chackCode(json.code) && json.code == 0) {
  4341.  
  4342. BiliData.Unread = json.code;
  4343. showUnreadMsg();
  4344.  
  4345. }
  4346.  
  4347. }
  4348. });*/
  4349. },
  4350. /**
  4351. *
  4352. * @param type reply:回复我的 at @我的
  4353. */
  4354. getMsgfeed: function(type) {
  4355. Ajax.get({
  4356. url: BILIBLI_PATH.api + '/x/msgfeed/' + type,
  4357. queryStringsObj: {
  4358. build: 0,
  4359. mobi_app: 'web'
  4360. },
  4361. hasCookies: true,
  4362. success: responseText => {
  4363.  
  4364. var json = JSON.parse(responseText);
  4365.  
  4366. if (json.code != 0 || !json.data.cursor.is_end || json.data.items == null) {
  4367. return false;
  4368. } else {
  4369. chackAtMsg(json.data.items);
  4370.  
  4371. return true;
  4372. }
  4373.  
  4374.  
  4375. }
  4376. })
  4377.  
  4378. },
  4379.  
  4380. /** 未读消息数 http://api.bilibili.com/x/space/arc/search?mid=99439379&pn=1&ps=5
  4381. * @returns {Promise<void>}
  4382. */
  4383. getUnrewad: async function() {
  4384.  
  4385. GM_xmlhttpRequest({
  4386. method: "GET",
  4387. data: {
  4388. "mid": 99439379,
  4389. "pn": 1,
  4390. "ps": 5,
  4391. },
  4392. url: BILIBLI_PATH.api + "/x/space/arc/search",
  4393. onload: function(response) {
  4394.  
  4395. let json = JSON.parse(response.response);
  4396. if (json.code == 0) {
  4397.  
  4398. BiliData.Video = json.data;
  4399. console.log("未读消息数" + json);
  4400. }
  4401.  
  4402. }
  4403. });
  4404. },
  4405.  
  4406. /** 动态评论区点赞 https://api.bilibili.com/x/v2/reply/action
  4407. * @param {number} oid
  4408. * @param {nbumber} rpid
  4409. * @param {number} action
  4410. * @returns {Promise<void>}
  4411. * type: 11
  4412. * ordering: heat
  4413. * jsonp: jsonp
  4414. * csrf: 54a******* CSRF Token(位于cookie)
  4415. */
  4416.  
  4417. likeInDynamicComments: async function(latestDynamic) {
  4418.  
  4419.  
  4420. Ajax.post({
  4421. url: BILIBLI_PATH.api + "/x/v2/reply/action",
  4422. hasCookies: true,
  4423. dataType: 'application/x-www-form-urlencoded; charset=UTF-8',
  4424. data: {
  4425. "oid": oid,
  4426. "type": 11,
  4427. "rpid": rpid,
  4428. "action": action,
  4429. "ordering": "heat",
  4430. "jsonp": "jsonp",
  4431. "csrf": Live_info.csrf_token,
  4432. },
  4433. success: responseText => {
  4434.  
  4435. if (/^{"code":0/.test(responseText)) {
  4436.  
  4437. BiliData.replyAction = JSON.parse(responseText);
  4438. console.log("点赞成功!" + responseText);
  4439. }
  4440. }
  4441. })
  4442.  
  4443. }
  4444.  
  4445.  
  4446. }
  4447.  
  4448. /*-----------------------------------------------常用工具函数--------------------------------------------------*/
  4449. var http_request = null;
  4450.  
  4451. function send_request(url, method) {}
  4452.  
  4453. let HNTOOL = {
  4454. /**
  4455. * 判断是否为整数类型方式
  4456. * @param {Object} obj
  4457. */
  4458. isInteger: function(obj) {
  4459.  
  4460. return obj % 1 === 0
  4461.  
  4462. },
  4463.  
  4464. jury_case: async function() {
  4465.  
  4466. for (let i = 0; i < 30; i++) {
  4467.  
  4468. //1.获取题号
  4469. let case_id = await HNAPI.jury_case_next();
  4470. await HNTOOL.Sleep(1000);
  4471. if (case_id == false) {
  4472. break;
  4473. }
  4474. //2.获取该题号详情
  4475. let vote = await HNAPI.jury_case_info(case_id);
  4476. await HNTOOL.Sleep(4 * 1000);
  4477. if (vote == false) {
  4478. break;
  4479. }
  4480. let opinion = await HNAPI.jury_case_opinion(case_id);
  4481. await HNTOOL.Sleep(15 * 1000);
  4482. //3.开始答题
  4483. let result = await HNAPI.jury_vote(case_id, vote, 1);
  4484. if (result) {
  4485. HNTOOL.console("第" + (i + 1) + "个案号:" + case_id + "完成!");
  4486. } else {
  4487. alert(result);
  4488. }
  4489. let case_id3 = await HNAPI.jury_case_next();
  4490.  
  4491. }
  4492.  
  4493. },
  4494. console: function(str, type) {
  4495.  
  4496. console.log(javaex.now() + "\n" + str);
  4497.  
  4498. javaex.tip({
  4499. content: str,
  4500. type: type == undefined || type == "success" ? "success" : type
  4501. });
  4502.  
  4503. },
  4504.  
  4505. doOneDynamic: async function(randomtime) {
  4506.  
  4507. var myVar = setInterval(async function() {
  4508.  
  4509. let randomStr = await HNTOOL.getRandomString();
  4510. await HNAPI.sendOneDynamic(randomStr);
  4511.  
  4512. }, randomtime);
  4513. },
  4514.  
  4515. getRandomString: function() {
  4516.  
  4517. return new Promise((resolve) => {
  4518. Ajax.get({
  4519. url: "https://api.mcloc.cn/love/",
  4520. //url: 'https://api.mcloc.cn/words/?type=json',//随机一个句子
  4521. //url: 'https://interface.meiriyiwen.com/article/random?dev=1',//随机一个句子
  4522. queryStringsObj: {
  4523. type: "json"
  4524. },
  4525. dataType: "text/html; charset=UTF-8",
  4526. hasCookies: false,
  4527. success: responseText => {
  4528.  
  4529. try {
  4530. let res = HNTOOL.strToJson(responseText);
  4531. resolve(res.data); //随机一句情话
  4532. //resolve(body.data+"---"+body.creator);//随机一个句子
  4533. //resolve(body.data.digest);//随机一个句子
  4534. } catch (e) {
  4535.  
  4536. resolve("你的名字,是我见过最短的情诗。"); //随机一句情话
  4537. }
  4538.  
  4539.  
  4540. }
  4541. })
  4542. });
  4543. },
  4544.  
  4545. getLatestDynamic: async function() {
  4546.  
  4547. let latestDynamic = await HNAPI.getTodayDynamicList(226257459, 3);
  4548. await HNTOOL.Sleep(1000);
  4549. let ldList = [];
  4550. let ldList2 = [];
  4551. for (let ld1 of latestDynamic) {
  4552.  
  4553. let ld = await HNTOOL.getDynamicIdList(ld1);
  4554. await HNTOOL.Sleep(1000);
  4555. ldList = ldList.concat(ld);
  4556. }
  4557.  
  4558. let latestDynamic2 = await HNAPI.getTodayDynamicList(2295698, 2);
  4559. await HNTOOL.Sleep(1000);
  4560.  
  4561. for (let ld2 of latestDynamic) {
  4562.  
  4563. let ld = await HNTOOL.getDynamicIdList(ld2);
  4564. await HNTOOL.Sleep(1000);
  4565. ldList2 = ldList2.concat(ld);
  4566. }
  4567. ldList.push.apply(ldList, ldList2);
  4568.  
  4569. let result = HNTOOL.arrUnique(ldList, false);
  4570.  
  4571. return result;
  4572.  
  4573. },
  4574.  
  4575. getDynamicIdList: async function(latestDynamic) {
  4576.  
  4577.  
  4578.  
  4579. return new Promise((resolve) => {
  4580. Ajax.get({
  4581. url: "https://www.bilibili.com/read/cv" + latestDynamic.id,
  4582. queryStringsObj: {
  4583.  
  4584. },
  4585. dataType: "text/html; charset=utf-8",
  4586. hasCookies: true,
  4587. success: responseText => {
  4588. let datalist = HNTOOL.httpString(responseText);
  4589. let dls;
  4590. let returnlist = [];
  4591. if (datalist != undefined && datalist.length > 0) {
  4592. for (let dl of datalist) {
  4593.  
  4594. let len = dl.indexOf("?");
  4595. if (len == -1) {
  4596. dl += "?tab=2";
  4597. }
  4598. dls = dl.substring(dl.indexOf("?") - 18, dl.indexOf("?"));
  4599. if (dls == false ||
  4600. dls == null ||
  4601. dl.indexOf("read") > -1 ||
  4602. dl.indexOf("html") > -1 ||
  4603. dl.indexOf("pixiv") > -1 ||
  4604. returnlist.indexOf(dls) > -1) {
  4605. continue;
  4606. }
  4607.  
  4608. returnlist.push(dls);
  4609.  
  4610. }
  4611.  
  4612. resolve(HNTOOL.arrUnique(returnlist, false));
  4613. } else {
  4614. resolve(false);
  4615. }
  4616. }
  4617. })
  4618. });
  4619. },
  4620.  
  4621. httpString: function(s) {
  4622. //var reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g;
  4623. //var reg = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
  4624. //var reg=/(http(s)?\:\/\/)?(www\.)?(\w+\:\d+)?(\/\w+)+\.(swf|gif|jpg|bmp|jpeg)/gi;
  4625. //var reg=/(http(s)?\:\/\/)?(www\.)?(\w+\:\d+)?(\/\w+)+\.(swf|gif|jpg|bmp|jpeg)/gi;
  4626. var reg = /(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g;
  4627. //var reg= /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-\.,@?^=%&:\/~\+#]*[\w\-\@?^=%&\/~\+#])?$/;
  4628. //v = v.replace(reg, "<a href='$1$2'>$1$2</a>"); //这里的reg就是上面的正则表达式
  4629. //s = s.replace(reg, "$1$2"); //这里的reg就是上面的正则表达式
  4630. s = s.match(reg);
  4631. console.log(s)
  4632. return (s)
  4633. },
  4634.  
  4635. saveConfig: function() {
  4636.  
  4637. localStorage.setItem(`HN_SETUP_CONFIG`, JSON.stringify(HN_SETUP_CONFIG));
  4638. /* javaex.tip({
  4639. content: "配置保存成功!",
  4640. type: "success"
  4641. }); */
  4642.  
  4643. },
  4644.  
  4645. copyText: function(domId) {
  4646. let btn = document.getElementById(domId);
  4647. btn.select();
  4648. if (document.execCommand('copy')) {
  4649. document.execCommand('copy');
  4650. javaex.tip({
  4651. content: "复制成功!",
  4652. type: "success"
  4653. });
  4654. }
  4655.  
  4656. },
  4657. /**
  4658. * s数组去重并排序
  4659. */
  4660.  
  4661. arrUnique: function(ary, isSort) {
  4662.  
  4663. if (isSort == undefined) {
  4664. isSort = true
  4665. }
  4666. let obj = {};
  4667. for (let i = 0; i < ary.length; i++) { //this 指向方法.前的对象ary
  4668. let item = ary[i]
  4669. obj.hasOwnProperty(item) ? (ary[i] = ary[ary.length - 1], ary.pop(), i--) : obj[item] = item
  4670. } //判断对象obj中是否有item元素,如果有 让当前元素等于数组最后一个元素,删除最后一个元素
  4671. // 如果没有 将这个元素添加到对象中
  4672. if (isSort) {
  4673. ary.sort((a, b) => {
  4674. return a - b
  4675. }) // 数组去重后 按升序排列
  4676. }
  4677.  
  4678. obj = null;
  4679.  
  4680. javaex.tip({
  4681. content: "已去重!",
  4682. type: "success"
  4683. });
  4684. return ary;
  4685.  
  4686. },
  4687.  
  4688. split_array: function(arr, len) {
  4689.  
  4690. let arr_length = arr.length;
  4691. let newArr = [];
  4692. for (let i = 0; i < arr_length; i += len) {
  4693. newArr.push(arr.slice(i, i + len));
  4694. }
  4695. return newArr;
  4696. },
  4697. strToJson: function(params) {
  4698. const isJSON = (str => {
  4699. if (typeof str === 'string') {
  4700. try {
  4701. const obj = JSON.parse(str);
  4702. return typeof obj === 'object' ? obj : false
  4703. } catch (_) {
  4704. console.log(str);
  4705. return false;
  4706. }
  4707. } else {
  4708. console.log(`${str}\nIt is not a string!`);
  4709. return false;
  4710. }
  4711. })(params);
  4712. return isJSON ? isJSON : {}
  4713. },
  4714.  
  4715. chackAtMsg: function() {
  4716.  
  4717. let config = HNTOOL.getConfig();
  4718. if (config.qmsg_checked == true && config.qmsg_key) {
  4719.  
  4720. document.getElementById("getAtMsg").click();
  4721.  
  4722. }
  4723.  
  4724. },
  4725.  
  4726. cssChecked: function(id, dom) {
  4727.  
  4728. dom == true ? $(id).attr("checked", true) : $(id).removeProp("checked");
  4729.  
  4730.  
  4731. },
  4732. getConfig: function() {
  4733.  
  4734. let CONFIG = JSON.parse(localStorage.getItem(`HN_SETUP_CONFIG`));
  4735.  
  4736. if (CONFIG == null) {
  4737. CONFIG = HN_SETUP_CONFIG;
  4738. }
  4739.  
  4740. return CONFIG;
  4741. },
  4742.  
  4743. /**
  4744. * 获取cookie 中某个键对应的值
  4745. * @param name
  4746. */
  4747.  
  4748. getCookie: function(name) {
  4749. let arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
  4750. if (arr != null) return escape(arr[2]);
  4751. return false;
  4752. },
  4753. /**
  4754. * 得到一个字符串数组的中随机一个
  4755. * @param {List} list
  4756. */
  4757.  
  4758.  
  4759. getRandomWordOfList: function(list) {
  4760. var L = list.length;
  4761. var i = Math.ceil(Math.random() * (L - 1));
  4762.  
  4763. return list[i];
  4764. },
  4765. random: function(min, max) {
  4766.  
  4767. return Math.floor(Math.random() * (max - min)) + min;
  4768. },
  4769.  
  4770. Sleep: function(ms) {
  4771. return new Promise(resolve => setTimeout(() => resolve('sleep'), ms));
  4772. }
  4773.  
  4774. }
  4775.  
  4776. let errorMsg = {
  4777. "-1": "应用程序不存在或已被封禁!",
  4778. "-2": "Access Key错误!",
  4779. "-3": "API校验密匙错误!",
  4780. "-4": "调用方对该Method没有权限!",
  4781. "-101": "账号未登录!",
  4782. "-102": "账号被封停!",
  4783. "-103": "积分不足!",
  4784. "-104": "硬币不足!",
  4785. "-105": "验证码错误!",
  4786. "-106": "账号非正式会员或在适应期!",
  4787. "-107": "应用不存在或者被封禁!",
  4788. "-108": "未绑定手机!",
  4789. "-109": "未知!",
  4790. "-110": "未绑定手机!",
  4791. "-111": "csrf 校验失败!",
  4792. "-112": "系统升级中!",
  4793. "-113": "账号尚未实名认证!",
  4794. "-114": "请先绑定手机!",
  4795. "-115": "请先完成实名认证!",
  4796. "-304": "木有改动!",
  4797. "-307": "撞车跳转!",
  4798. "-400": "请求错误!",
  4799. "-401": "未认证!",
  4800. "-403": "访问权限不足!",
  4801. "-404": "啥都木有!",
  4802. }
  4803.  
  4804. /*-----------------------------------------------CODE 统一检查--------------------------------------------------*/
  4805. /**
  4806. *
  4807. * @param code
  4808. * @constructor
  4809. */
  4810. let chackCode = function(code) {
  4811.  
  4812. let emsg = errorMsg[code + ""];
  4813. if (emsg != null) {
  4814. javaex.tip({
  4815. content: emsg,
  4816. type: "error"
  4817. });
  4818.  
  4819. return false;
  4820. }
  4821.  
  4822. return true;
  4823. }
  4824.  
  4825.  
  4826. /*-----------------------------------------------localStorage封装 (本地存储信息)--------------------------------------------------*/
  4827. //javaex.setLocalStorage(key, value); var str = javaex.getLocalStorage(key); javaex.deleteLocalStorage(key);
  4828.  
  4829. /*window.onbeforeunload = function() {
  4830. if (!canLeavePage()) {
  4831. return ('确认离开当前页面吗?未保存的数据将会丢失!');
  4832. }
  4833. };*/
  4834.  
  4835.  
  4836. /**
  4837. * Ajax请求对象
  4838. */
  4839. const Ajax = (() => {
  4840. /**
  4841. * 检查options是否符合要求
  4842. * @param {object} options
  4843. * @returns {boolean}
  4844. */
  4845. function checkOptions(options) {
  4846. let result = false;
  4847. if (typeof options !== 'object') {
  4848. console.warn('类型错误: typeof Options !== Object');
  4849. return result;
  4850. } else {
  4851. if (typeof options.url !== 'string') {
  4852. console.warn('类型错误: typeof Link !== Strings');
  4853. return result;
  4854. } else {
  4855. const reg = /(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g;
  4856. //const reg = /^https?:\/\/(?:\w+\.?)+(?:\/.*)*\/?$/i;
  4857. if (!reg.test(options.url)) {
  4858. console.warn('url字符串须为完整http链接');
  4859. return result;
  4860. }
  4861. result = true;
  4862. }
  4863. }
  4864. return result;
  4865. }
  4866.  
  4867. /**
  4868. * 对象转URL编码
  4869. * @param {object} data
  4870. */
  4871. function objToURLCode(data) {
  4872. var _result = [];
  4873. for (var key in data) {
  4874. var value = data[key];
  4875. if (value instanceof Array) {
  4876. value.forEach(function(_value) {
  4877. _result.push(key + "=" + _value);
  4878. });
  4879. } else {
  4880. _result.push(key + '=' + value);
  4881. }
  4882. }
  4883. return _result.join('&');
  4884. }
  4885.  
  4886. /**
  4887. * 请求
  4888. * @param {string} method
  4889. * @param {object} options
  4890. */
  4891. function request(method, options) {
  4892. if (checkOptions(options)) {
  4893. let xhr = new XMLHttpRequest();
  4894. const {
  4895. url: _url,
  4896. queryStringsObj,
  4897. data,
  4898. dataType,
  4899. payload,
  4900. hasCookies
  4901. } = options, url = typeof queryStringsObj === 'object' ?
  4902. _url + '?' + objToURLCode(queryStringsObj) : _url;
  4903. switch (method) {
  4904. case 'GET':
  4905. xhr.open("GET", url);
  4906. break;
  4907. case 'POST':
  4908. xhr.open("POST", url);
  4909. xhr.setRequestHeader('Content-Type', dataType);
  4910. //xhr.setRequestHeader('Accept-Encoding', "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
  4911. break;
  4912. default:
  4913. break;
  4914. }
  4915. if (hasCookies) xhr.withCredentials = true;
  4916. xhr.timeout = 3000;
  4917. xhr.addEventListener('load', () => {
  4918. if (xhr.status === 200) {
  4919. options.success(xhr.responseText)
  4920. } else {
  4921. console.error(`status:${xhr.status}`);
  4922. options.success(`{"code":${xhr.status},"msg":"频繁访问"}`);
  4923. }
  4924. })
  4925. xhr.addEventListener('error', () => {
  4926. console.error('ajax请求出错')
  4927. options.success('{"code":-1,"msg":"ajax请求出错"}');
  4928. })
  4929. xhr.addEventListener('timeout', () => {
  4930. console.error('请求超时')
  4931. options.success('{"code":-1,"msg":"请求超时"}');
  4932. })
  4933. switch (method) {
  4934. case 'GET':
  4935. xhr.send()
  4936. break;
  4937. case 'POST':
  4938. xhr.send((/urlencoded/.test(dataType)) ? objToURLCode(data) : data)
  4939. //xhr.send(payload);
  4940. break;
  4941. default:
  4942. break;
  4943. }
  4944. }
  4945. }
  4946.  
  4947. return {
  4948. /**
  4949. * 发送Get请求
  4950. * @param {Object} options
  4951. */
  4952. get(options) {
  4953. request("GET", options);
  4954. },
  4955. /**
  4956. * 发送Post请求
  4957. * @param {object} options
  4958. */
  4959. post(options) {
  4960. request("POST", options);
  4961. }
  4962. }
  4963. })()