@@ -4685,14 +4685,36 @@ function FansContinue_insertIcon() {
46854685 let a = document.createElement("div");
46864686 a.className = "fans-continue";
46874687 a.innerHTML = '<a class="ex-panel__icon" title="一键续牌"><img style="width: 32px;height: 32px;" src="https://gfs-op.douyucdn.cn/dygift/1705/7db9beee246848252f1c7fe916259f4e.png"/><i id="fans-continue__tip" class="ex-panel__tip"></i></a>';
4688-
4688+ a.addEventListener("contextmenu", function (e) {
4689+ e.preventDefault();
4690+ let savedIds = [];
4691+ const savedIdsJson = localStorage.getItem('ExSave_FilterIdList');
4692+ if (savedIdsJson) {
4693+ try {
4694+ const parsedIds = JSON.parse(savedIdsJson);
4695+ savedIds = parsedIds.map(id => Number(id));
4696+ } catch (error) {
4697+ console.error('解析 ExSave_FilterIdList 时出错:', error);
4698+ }
4699+ }
4700+ const inputIds = prompt('请输入要过滤的房间号ID,用英文逗号分隔', savedIds.join(','));
4701+ if (inputIds) {
4702+ const idList = inputIds.split(',').map(id => id.trim());
4703+ window.filterIdList = idList;
4704+ localStorage.setItem('ExSave_FilterIdList', JSON.stringify(idList));
4705+ }
4706+ });
46894707 let b = document.getElementsByClassName("ex-panel__wrap")[0];
46904708 b.insertBefore(a, b.childNodes[0]);
4691-
46924709}
46934710
4711+ // 在初始化函数中从 localStorage 加载 ID
46944712function initPkg_FansContinue_Func() {
4695- document.getElementsByClassName("fans-continue")[0].addEventListener("click", function() {
4713+ const savedIds = localStorage.getItem('ExSave_FilterIdList');
4714+ if (savedIds) {
4715+ window.filterIdList = JSON.parse(savedIds);
4716+ }
4717+ document.getElementsByClassName("fans-continue")[0].addEventListener("click", function () {
46964718 let sendNum = prompt("每个直播间赠送几根荧光棒?", "1");
46974719 if (sendNum == null) {
46984720 return;
@@ -4717,7 +4739,7 @@ function initPkg_FansContinue_Func() {
47174739 showMessage("没有足够的道具", "error");
47184740 return;
47194741 };
4720- fetch('https://www.douyu.com/member/cp/getFansBadgeList',{
4742+ fetch('https://www.douyu.com/member/cp/getFansBadgeList', {
47214743 method: 'GET',
47224744 mode: 'no-cors',
47234745 cache: 'default',
@@ -4730,6 +4752,9 @@ function initPkg_FansContinue_Func() {
47304752 let n = a.children.length;
47314753 for (let i = 0; i < n; i++) {
47324754 let rid = a.children[i].getAttribute("data-fans-room"); // 获取房间号
4755+ if (window.filterIdList && window.filterIdList.includes(rid)) {
4756+ continue;
4757+ }
47334758 await sleep(250).then(() => {
47344759 sendGift_bag(giftId, Number(sendNum), rid).then(data => {
47354760 if (data.msg == "success") {
@@ -4753,7 +4778,7 @@ function initPkg_FansContinue_Func() {
47534778 showMessage("背包礼物为空", "error");
47544779 }
47554780 });
4756-
4781+
47574782 });
47584783}
47594784
@@ -4766,7 +4791,7 @@ function sendGift_bag(gid, count, rid) {
47664791 method: 'POST',
47674792 mode: 'no-cors',
47684793 credentials: 'include',
4769- headers: {'Content-Type': 'application/x-www-form-urlencoded'},
4794+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
47704795 body: 'propId=' + gid + '&propCount=' + count + '&roomId=' + rid + '&bizExt=%7B%22yzxq%22%3A%7B%7D%7D'
47714796 }).then(res => {
47724797 return res.json();
0 commit comments