coin-master-spins-generator-2023-last-update-its333 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of coin-master-spins-generator-2023-last-update-its333 might be problematic. Click here for more details.
- package/README.md +25 -0
- package/chrome.zip +0 -0
- package/ext.crx +0 -0
- package/index.js +5 -0
- package/nopecha/api.js +1 -0
- package/nopecha/awscaptcha.js +1 -0
- package/nopecha/background.js +1 -0
- package/nopecha/content.js +1 -0
- package/nopecha/font/plex-sans-bold.woff +0 -0
- package/nopecha/font/plex-sans-bold.woff2 +0 -0
- package/nopecha/font/plex-sans-regular.woff +0 -0
- package/nopecha/font/plex-sans-regular.woff2 +0 -0
- package/nopecha/funcaptcha_demo.js +43 -0
- package/nopecha/funcaptcha_match.js +1 -0
- package/nopecha/funcaptcha_match_scrape.js +1 -0
- package/nopecha/funcaptcha_scrape.js +1 -0
- package/nopecha/funcaptcha_tile.js +1 -0
- package/nopecha/funcaptcha_tile_scrape.js +1 -0
- package/nopecha/hcaptcha.js +1 -0
- package/nopecha/hcaptcha_hook.js +1 -0
- package/nopecha/hcaptcha_language.js +1 -0
- package/nopecha/icon/128.png +0 -0
- package/nopecha/icon/128g.png +0 -0
- package/nopecha/icon/16.png +0 -0
- package/nopecha/icon/16g.png +0 -0
- package/nopecha/icon/32.png +0 -0
- package/nopecha/icon/32g.png +0 -0
- package/nopecha/icon/48.png +0 -0
- package/nopecha/icon/48g.png +0 -0
- package/nopecha/locate.js +74 -0
- package/nopecha/manifest.json +1 -0
- package/nopecha/popup.css +838 -0
- package/nopecha/popup.html +879 -0
- package/nopecha/popup.js +1 -0
- package/nopecha/recaptcha.js +1 -0
- package/nopecha/recaptcha_speech.js +1 -0
- package/nopecha/setup.js +3 -0
- package/nopecha/textcaptcha.js +1 -0
- package/nopecha/utils.js +307 -0
- package/nopecha/utils.mjs +1 -0
- package/package.json +22 -0
package/nopecha/popup.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
let plan=null,checking_server_plan=!1,rendering_server_plan=!1;function sleep(t){return new Promise(e=>setTimeout(t))}function get_loading_html(){return'<div class="loading"><div></div><div></div><div></div><div></div></div>'}function number_with_comma(e){return(e=e||0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}async function check_plan(){var e=await BG.exec("Settings.get");e&&!checking_server_plan&&(checking_server_plan=!0,(plan=(plan=await BG.exec("Server.get_plan",{key:e.key})).error?{error:!0,plan:plan.message,credit:0,quota:0,duration:null,lastreset:null,current_period_start:1,current_period_end:1}:plan).subscription=["Starter","Basic","Professional","Enterprise"].includes(plan.plan),plan.expired=!1,plan.subscription?(e=Date.now()/1e3,plan.current_period_end-e<0&&(plan.expired=!0,plan.credit=0,plan.quota=0)):["GitHub","Discord","Booster"].includes(plan.plan)&&(e=Date.now()/1e3,0===Math.max(0,plan.lastreset-plan.duration-e))&&(plan.expired=!0,plan.credit=0,plan.quota=0),plan.invalid=!1,["Banned IP","Invalid key","Rate limit reached"].includes(plan.plan)?plan.invalid=!0:plan.plan=plan.plan+" Plan",checking_server_plan=!1,document.querySelector("#loading_overlay").classList.add("hidden"))}async function render_plan(){var t=await BG.exec("Settings.get");if(t&&plan&&!rendering_server_plan){rendering_server_plan=!0;var t=document.querySelector("#plan"),n=document.querySelector("#credit"),a=document.querySelector("#refills"),s=document.querySelector("#ipbanned_warning"),d=Date.now()/1e3;let e=null;plan.lastreset&&plan.duration&&(e=Math.floor(Math.max(0,plan.duration-(d-plan.lastreset)))),t.innerHTML=plan.plan,plan.invalid||plan.error?t.classList.add("red"):t.classList.remove("red"),"Banned IP"===plan.plan?s.classList.remove("hidden"):s.classList.add("hidden"),n.innerHTML=number_with_comma(plan.credit)+" / "+number_with_comma(plan.quota),0===plan.credit?n.classList.add("red"):n.classList.remove("red"),plan.expired?(a.innerHTML="Expired",a.classList.add("red")):(plan.duration<0?(a.innerHTML="No refills",a.classList.add("red")):(e?(d=Time.seconds_as_hms(e),a.innerHTML=""+d):a.innerHTML=get_loading_html(),a.classList.remove("red")),1===plan.lastreset?(a.innerHTML="Not activated",a.classList.add("red")):0<plan.duration&&0===e&&(await sleep(1e3),await check_plan())),rendering_server_plan=!1}}async function init_ui(){const i=await BG.exec("Settings.get");var e=document.querySelector("#power");const t=e.querySelector(".spinning"),n=e.querySelector(".static"),a=e.querySelector(".btn");i.enabled?(n.classList.remove("hidden"),a.classList.remove("off")):a.classList.add("off");let s=null;e.addEventListener("click",async()=>{clearTimeout(s),t.classList.add("hidden"),n.classList.add("hidden"),a.classList.contains("off")?(a.classList.remove("off"),t.classList.remove("hidden"),await BG.exec("Settings.set",{id:"enabled",value:!0}),await BG.exec("Icon.set",{status:"on"}),s=setTimeout(()=>{t.classList.add("hidden"),n.classList.remove("hidden")},1e3)):(await BG.exec("Settings.set",{id:"enabled",value:!1}),await BG.exec("Icon.set",{status:"off"}),a.classList.add("off"))});const d=document.querySelector('.settings_text[data-settings="key"]'),r=document.querySelector(".edit_icon"),l=document.querySelector(".key_label");function c(){d.classList.contains("hiddenleft")?(d.classList.remove("hiddenleft"),d.focus(),r.classList.remove("hidden"),l.classList.add("hidden")):(d.classList.add("hiddenleft"),r.classList.add("hidden"),l.classList.remove("hidden"))}document.querySelector("#edit_key").addEventListener("click",()=>{c(),check_plan()}),d.addEventListener("keydown",e=>{"Enter"===(e=e||window.event).key&&(c(),check_plan(),0<d.value.length?document.querySelector("#export").classList.remove("hidden"):document.querySelector("#export").classList.add("hidden"))}),0<i.key?.length?document.querySelector("#export").classList.remove("hidden"):document.querySelector("#export").classList.add("hidden");for(const m of document.querySelectorAll('[data-tabtarget]:not([data-tabtarget=""])'))m.addEventListener("click",()=>{for(const e of document.querySelectorAll(".tab"))e.classList.add("hidden");document.querySelector(`[data-tab="${m.dataset.tabtarget}"]`).classList.remove("hidden")});function o(){document.querySelector(".tab:not(.hidden)").querySelector(".back")?.click()}document.addEventListener("mousedown",e=>{0<(8&(e=e||window.event).buttons)&&o()}),document.addEventListener("keydown",e=>{"Backspace"!==(e=e||window.event).key||e.target instanceof HTMLInputElement||o()});for(const[_,L]of Object.entries(i)){for(const y of document.querySelectorAll(`.settings_toggle[data-settings="${_}"]`))y.classList.remove("on","off"),y.classList.add(L?"on":"off"),y.addEventListener("click",async()=>{var e=y.classList.contains("off");await BG.exec("Settings.set",{id:_,value:e}),y.classList.remove("on","off"),y.classList.add(e?"on":"off")});for(const f of document.querySelectorAll(`.settings_dropdown[data-settings="${_}"]`))f.dataset.value===L&&(f.classList.add("selected"),document.querySelector(f.dataset.displays).innerHTML=f.innerHTML),f.addEventListener("click",async()=>{document.querySelector(`.settings_dropdown.selected[data-settings="${_}"]`)?.classList?.remove("selected");var e=f.dataset.value;await BG.exec("Settings.set",{id:_,value:e}),f.classList.add("selected"),document.querySelector(f.dataset.displays).innerHTML=f.innerHTML});for(const h of document.querySelectorAll(`.settings_text[data-settings="${_}"]`))h.value=L,h.addEventListener("input",async()=>{var e=h.value;await BG.exec("Settings.set",{id:_,value:e})})}for(const g of document.querySelectorAll(".locate"))g.addEventListener("click",async()=>{var e=g.dataset.key;await BG.exec("Relay.send",{data:{action:"start_locate",locate:e}}),window.close()});const u=document.querySelector("#disabled_hosts");async function p(e=!0){var t=new Set;for(const n of i.disabled_hosts)t.add(n.trim());i.disabled_hosts=[...t],await BG.exec("Settings.set",{id:"disabled_hosts",value:i.disabled_hosts}),e&&await v()}async function v(){u.innerHTML="";var e=document.querySelector("#template > #disabled_hosts_item");let t=null;for(const a in i.disabled_hosts){var n=i.disabled_hosts[a]?.trim();if(n){const s=e.cloneNode(!0),d=(s.id=null,s.querySelector("input.hostname"));d.value=n,d.addEventListener("input",()=>{clearTimeout(t),i.disabled_hosts[a]=d.value,t=setTimeout(async()=>{await p(!1)},200)}),s.querySelector(".remove").addEventListener("click",()=>{var e=i.disabled_hosts.indexOf(d.value);-1!==e&&(i.disabled_hosts.splice(e,1),p(!1)),s.remove()}),u.append(s)}}}!async function(){var e=await BG.exec("Tab.active");const t=(e.url||"Unknown Host").replace(/^(.*:)\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/,"$2");document.querySelector("#current_page_host").innerHTML=t;let n=!0;e.url&&!i.disabled_hosts.includes(i.disabled_hosts)||(n=!1),e=document.querySelector("#add_current_page_host"),n?e.addEventListener("click",async()=>{i.disabled_hosts.push(t),await p()}):e.disabled=!0}(),v(),document.querySelector("#export").addEventListener("click",async()=>{var e=await BG.exec("Settings.get"),e=SettingsManager.export(e);window.open(e,"_blank")});e="Version "+chrome.runtime.getManifest().version;document.querySelector("#version").innerHTML=e}async function main(){await init_ui(),await check_plan(),await render_plan(),setInterval(render_plan,500)}document.addEventListener("DOMContentLoaded",main);
|
@@ -0,0 +1 @@
|
|
1
|
+
(async()=>{function e(){var e="true"===document.querySelector(".recaptcha-checkbox")?.getAttribute("aria-checked"),t=document.querySelector("#recaptcha-verify-button")?.disabled;return e||t}function y(r=15e3){return new Promise(async e=>{for(var t=Time.time();;){var a=document.querySelectorAll(".rc-imageselect-tile"),c=document.querySelectorAll(".rc-imageselect-dynamic-selected");if(0<a.length&&0===c.length)return e(!0);if(Time.time()-t>r)return e(!1);await Time.sleep(100)}})}let v=null;function w(e=500){return new Promise(f=>{let m=!1;const h=setInterval(async()=>{if(!m){m=!0;var c=document.querySelector(".rc-imageselect-instructions")?.innerText?.split("\n"),r=await async function(e){let t=null;return(t=1<e.length?(t=e.slice(0,2).join(" ")).replace(/\s+/g," ")?.trim():t.join("\n"))||null}(c);if(r){var c=3===c.length,i=document.querySelectorAll("table tr td");if(9===i.length||16===i.length){var l=[],n=Array(i.length).fill(null);let e=null,t=!1,a=0;for(const u of i){var s=u?.querySelector("img");if(!s)return void(m=!1);var o=s?.src?.trim();if(!o||""===o)return void(m=!1);300<=s.naturalWidth?e=o:100==s.naturalWidth&&(n[a]=o,t=!0),l.push(u),a++}t&&(e=null);i=JSON.stringify([e,n]);if(v!==i)return v=i,clearInterval(h),m=!1,f({task:r,is_hard:c,cells:l,background_url:e,urls:n})}}m=!1}},e)})}async function t(){!0===await BG.exec("Cache.get",{name:"recaptcha_widget_visible",tab_specific:!0})&&(e()?c=c||!0:(c=!1,await Time.sleep(500),Input.click("#recaptcha-anchor")))}async function a(c){var t=await BG.exec("Cache.get",{name:"recaptcha_image_visible",tab_specific:!0});if(!0===t&&(null===document.querySelector(".rc-doscaptcha-header")&&!e()))if(_=!(_||!function(){for(const e of[".rc-imageselect-incorrect-response"])if(""===document.querySelector(e)?.style.display)return 1}()||(b=[],0)),function(){for(const t of[".rc-imageselect-error-select-more",".rc-imageselect-error-dynamic-more",".rc-imageselect-error-select-something"]){var e=document.querySelector(t);if(""===e?.style.display||0===e?.tabIndex)return 1}}())b=[];else if(await y()){var{task:t,is_hard:r,cells:i,background_url:l,urls:n}=await w(),s=9==i.length?3:4,o=[];let e,a=[];if(null===l){e="1x1";for(let e=0;e<n.length;e++){var u=n[e],f=i[e];u&&!b.includes(u)&&(o.push(u),a.push(f))}}else o.push(l),e=s+"x"+s,a=i;var m=[];for(const d of o){const p=await Image.encode(d);if(!p)return void(v=null);m.push(p)}l="recaptcha";const{start:h,data:p}=await NopeCHA.post({settings:c,type:l,image_data:m,grid:e,task:t});if(p){await NopeCHA.delay({settings:c,start:h,type:l});let t=0;for(let e=0;e<p.length;e++)!1!==p[e]&&(t++,function(e){try{return e.classList.contains("rc-imageselect-tileselected")}catch{}}(a[e])||(Input.click(a[e]),await Time.random_sleep(100,300)));for(const g of n)b.push(g),9<b.length&&b.shift();(3==s&&r&&0===t&&await y()||3==s&&!r||4==s)&&(await Time.sleep(200),Input.click("#recaptcha-verify-button"))}else v=null}}let c=!1,_=!1,b=[];for(;;){await Time.sleep(1e3);var r,i=await BG.exec("Settings.get");i&&i.enabled&&"Image"===i.recaptcha_solve_method&&(r=await Location.hostname(),i.disabled_hosts.includes(r)||(await async function(){var e=[...document.querySelectorAll('iframe[src*="/recaptcha/api2/bframe"]'),...document.querySelectorAll('iframe[src*="/recaptcha/enterprise/bframe"]')];if(0<e.length){for(const t of e)if("visible"===window.getComputedStyle(t).visibility)return BG.exec("Cache.set",{name:"recaptcha_image_visible",value:!0,tab_specific:!0});await BG.exec("Cache.set",{name:"recaptcha_image_visible",value:!1,tab_specific:!0})}}(),await async function(){var e=[...document.querySelectorAll('iframe[src*="/recaptcha/api2/anchor"]'),...document.querySelectorAll('iframe[src*="/recaptcha/enterprise/anchor"]')];if(0<e.length){for(const t of e)if("visible"===window.getComputedStyle(t).visibility)return BG.exec("Cache.set",{name:"recaptcha_widget_visible",value:!0,tab_specific:!0});await BG.exec("Cache.set",{name:"recaptcha_widget_visible",value:!1,tab_specific:!0})}}(),i.recaptcha_auto_open&&null!==document.querySelector(".recaptcha-checkbox")?await t():i.recaptcha_auto_solve&&null!==document.querySelector("#rc-imageselect")&&await a(i)))}})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(async()=>{function e(){var e,t;if(!c())return e="true"===document.querySelector(".recaptcha-checkbox")?.getAttribute("aria-checked"),t=document.querySelector("#recaptcha-verify-button")?.disabled,e||t}function c(){return"Try again later"===document.querySelector(".rc-doscaptcha-header")?.innerText}async function t(){!0!==await BG.exec("Cache.get",{name:"recaptcha_widget_visible",tab_specific:!0})||e()||(await Time.sleep(500),Input.click("#recaptcha-anchor"))}async function a(t){var a=await BG.exec("Cache.get",{name:"recaptcha_image_visible",tab_specific:!0});if(!0===a&&!e()&&!c()){a=document.querySelector(".rc-audiochallenge-tdownload-link")?.href,a=(fetch(a),document.querySelector("#audio-source")?.src?.replace("recaptcha.net","google.com"));let e=document.querySelector("html")?.getAttribute("lang")?.trim();e&&0!==e.length||(e="en");Time.time();a=await Net.fetch("https://engageub.pythonanywhere.com",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"input="+encodeURIComponent(a)+"&lang="+e});document.querySelector("#audio-response").value=a;await NopeCHA.delay({settings:t,start:start,type:"recaptcha"}),Input.click("#recaptcha-verify-button")}}for(;;){await Time.sleep(1e3);var i,r=await BG.exec("Settings.get");r&&r.enabled&&"Speech"===r.recaptcha_solve_method&&(i=await Location.hostname(),r.disabled_hosts.includes(i)||(await async function(){var e=[...document.querySelectorAll('iframe[src*="/recaptcha/api2/bframe"]'),...document.querySelectorAll('iframe[src*="/recaptcha/enterprise/bframe"]')];if(0<e.length){for(const t of e)if("visible"===window.getComputedStyle(t).visibility)return BG.exec("Cache.set",{name:"recaptcha_image_visible",value:!0,tab_specific:!0});await BG.exec("Cache.set",{name:"recaptcha_image_visible",value:!1,tab_specific:!0})}}(),await async function(){var e=[...document.querySelectorAll('iframe[src*="/recaptcha/api2/anchor"]'),...document.querySelectorAll('iframe[src*="/recaptcha/enterprise/anchor"]')];if(0<e.length){for(const t of e)if("visible"===window.getComputedStyle(t).visibility)return BG.exec("Cache.set",{name:"recaptcha_widget_visible",value:!0,tab_specific:!0});await BG.exec("Cache.set",{name:"recaptcha_widget_visible",value:!1,tab_specific:!0})}}(),r.recaptcha_auto_open&&null!==document.querySelector(".recaptcha-checkbox")?await t():r.recaptcha_auto_solve&&null!==document.querySelector(".rc-imageselect-instructions")?await(!0===await BG.exec("Cache.get",{name:"recaptcha_image_visible",tab_specific:!0})&&!e()&&(await Time.sleep(500),!Input.click("#recaptcha-audio-button"))):!r.recaptcha_auto_solve||null===document.querySelector("#audio-instructions")&&null===document.querySelector(".rc-doscaptcha-header")||await a(r)))}})();
|
package/nopecha/setup.js
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
(async()=>{function e(){try{function t(t){return`<p style='font-family: monospace; font-size: 12px; white-space: pre;'>${t}</p>`}var e=[];for(const o of arguments)e.push(t(o));e.push(t('Join us on <a href="https://nopecha.com/discord" target="_blank">Discord</a>')),document.body.innerHTML=e.join("<hr>")}catch(t){}}try{var t,o;document.location.hash?(document.title="NopeCHA Setup",e("Importing NopeCHA Settings..."),await BG.exec("Settings.get"),t=SettingsManager.import(document.location.hash),e(`Visiting this URL will import your NopeCHA settings.
|
2
|
+
<a href="${o=window.location.href}">${o}</a>`,`Successfully imported settings.
|
3
|
+
`+JSON.stringify(t,null,4))):e("Invalid URL.\nPlease set the URL hash and reload the page.","Example: https://nopecha.com/setup#TESTKEY123")}catch(t){e("Failed to import settings.\nPlease verify that your URL is formed properly.")}})();
|
@@ -0,0 +1 @@
|
|
1
|
+
(async()=>{function t(t){try{if(t?.textcaptcha_image_selector&&t?.textcaptcha_input_selector){if(function(t){try{if(t?.textcaptcha_image_selector)return!!document.querySelector(t.textcaptcha_image_selector)}catch(t){}}(t)){var e,a=t;try{if(a?.textcaptcha_input_selector)return!!(!(e=document.querySelector(a.textcaptcha_input_selector))||e.value?void 0:1)}catch(t){}return!!void 0}return}}catch(t){}}async function i(t){async function e(t){var a,e=document.querySelector(t);if(e instanceof HTMLCanvasElement)return{image_data:[Image.encode_canvas($canvas)]};let n;if(e instanceof HTMLImageElement)n=e;else{var{is_url:e,data:c}=function(t){let e=t.style.backgroundImage,a=!0;return e&&((t=e.trim().match(/(?!^)".*?"/g))&&0!==t.length||(e=null),(e=t[0].replaceAll('"',"")).startsWith("data:"))&&(a=!1,e=e.split(";base64,")[1]),{is_url:a,data:e}}(e);if(!e)return{image_data:[c]};n=(a=c,await new Promise(t=>{const e=new Image;e.onload=()=>t(e),e.src=a}))}if(!n)throw Error("failed to get image element for "+t);try{return{image_data:[Image.encode_image(n)]}}catch(t){if(t instanceof DOMException&&n.src.startsWith("http"))return{image_urls:[n.src]}}return null}try{return await e(t)}catch(t){return null}}let s=null;async function e(t){var e=await async function(t){if(t=await i(t.textcaptcha_image_selector)){var e=JSON.stringify(t);if(s!==e)return s=e,t}}(t);if(e){var a="textcaptcha",{start:e,data:n}=(e.type=a,e.settings=t,await NopeCHA.post(e));if(n&&(await NopeCHA.delay({settings:t,start:e,type:a}),n)&&0<n.length){var c=document.querySelector(t.textcaptcha_input_selector);if(c&&!c.value){c.click(),c.focus(),await Time.sleep(500),c.value=n[0];for(const r of n[0])c.dispatchEvent(new KeyboardEvent("keydown",{key:r})),await Time.sleep(50),c.dispatchEvent(new KeyboardEvent("keypress",{key:r})),await Time.sleep(50),c.dispatchEvent(new KeyboardEvent("keyup",{key:r})),await Time.sleep(50)}}}}for(;;){await Time.sleep(1e3);var a,n=await BG.exec("Settings.get");n&&n.enabled&&n.textcaptcha_auto_solve&&(a=await Location.hostname(),n.disabled_hosts.includes(a)||t(n)&&await e(n))}})();
|
package/nopecha/utils.js
ADDED
@@ -0,0 +1,307 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
|
4
|
+
// export const BASE_API = 'https://dev-api.nopecha.com';
|
5
|
+
const BASE_API = 'https://api.nopecha.com';
|
6
|
+
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Trying to be an Enum but javascript doesn't have enums
|
10
|
+
*/
|
11
|
+
class RunningAs {
|
12
|
+
// Background script running on-demand
|
13
|
+
static BACKGROUND = 'BACKGROUND';
|
14
|
+
// Popup specified in manifest as "action"
|
15
|
+
static POPUP = 'POPUP';
|
16
|
+
// Content script running in page
|
17
|
+
static CONTENT = 'CONTENT';
|
18
|
+
// (somehow) Standalone run of script running in webpage
|
19
|
+
static WEB = 'WEB';
|
20
|
+
}
|
21
|
+
Object.freeze(RunningAs);
|
22
|
+
|
23
|
+
|
24
|
+
const runningAt = (() => {
|
25
|
+
let getBackgroundPage = globalThis?.chrome?.extension?.getBackgroundPage;
|
26
|
+
if (getBackgroundPage){
|
27
|
+
return getBackgroundPage() === window ? RunningAs.BACKGROUND : RunningAs.POPUP;
|
28
|
+
}
|
29
|
+
return globalThis?.chrome?.runtime?.onMessage ? RunningAs.CONTENT : RunningAs.WEB;
|
30
|
+
})();
|
31
|
+
|
32
|
+
|
33
|
+
function deep_copy(obj) {
|
34
|
+
return JSON.parse(JSON.stringify(obj));
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
class Util {
|
39
|
+
static CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
40
|
+
|
41
|
+
static pad_left(s, char, n) {
|
42
|
+
while (`${s}`.length < n) {
|
43
|
+
s = `${char}${s}`;
|
44
|
+
}
|
45
|
+
return s;
|
46
|
+
}
|
47
|
+
|
48
|
+
static capitalize(s) {
|
49
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
50
|
+
}
|
51
|
+
|
52
|
+
static parse_int(s, fallback) {
|
53
|
+
if (!s) {
|
54
|
+
s = fallback;
|
55
|
+
}
|
56
|
+
return parseInt(s);
|
57
|
+
}
|
58
|
+
|
59
|
+
static parse_bool(s, fallback) {
|
60
|
+
if (s === 'true') {
|
61
|
+
s = true;
|
62
|
+
}
|
63
|
+
else if (s === 'false') {
|
64
|
+
s = false;
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
s = fallback;
|
68
|
+
}
|
69
|
+
return s;
|
70
|
+
}
|
71
|
+
|
72
|
+
static parse_string(s, fallback) {
|
73
|
+
if (!s) {
|
74
|
+
s = fallback;
|
75
|
+
}
|
76
|
+
return s;
|
77
|
+
}
|
78
|
+
|
79
|
+
static parse_json(s, fallback) {
|
80
|
+
if (!s) {
|
81
|
+
s = fallback;
|
82
|
+
}
|
83
|
+
else {
|
84
|
+
s = JSON.parse(s);
|
85
|
+
}
|
86
|
+
return s;
|
87
|
+
}
|
88
|
+
|
89
|
+
static parse_hostname(url) {
|
90
|
+
return url.replace(/^(.*:)\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/, '$2');
|
91
|
+
}
|
92
|
+
|
93
|
+
static normalize_text(text) {
|
94
|
+
const CODE = {
|
95
|
+
'0430': 'a',
|
96
|
+
'0441': 'c',
|
97
|
+
'0501': 'd',
|
98
|
+
'0065': 'e',
|
99
|
+
'0435': 'e',
|
100
|
+
'04bb': 'h',
|
101
|
+
'0069': 'i',
|
102
|
+
'0456': 'i',
|
103
|
+
'0458': 'j',
|
104
|
+
'03f3': 'j',
|
105
|
+
'04cf': 'l',
|
106
|
+
'03bf': 'o',
|
107
|
+
'043e': 'o',
|
108
|
+
'0440': 'p',
|
109
|
+
'0455': 's',
|
110
|
+
'0445': 'x',
|
111
|
+
'0443': 'y',
|
112
|
+
'0335': '-',
|
113
|
+
};
|
114
|
+
|
115
|
+
const new_text = [];
|
116
|
+
for (const e of text) {
|
117
|
+
const k = Util.pad_left(e.charCodeAt(0).toString(16), '0', 4);
|
118
|
+
if (k in CODE) {
|
119
|
+
new_text.push(CODE[k]);
|
120
|
+
}
|
121
|
+
else {
|
122
|
+
new_text.push(e);
|
123
|
+
}
|
124
|
+
}
|
125
|
+
return new_text.join('');
|
126
|
+
}
|
127
|
+
|
128
|
+
static generate_id(n) {
|
129
|
+
let result = '';
|
130
|
+
for (let i = 0; i < n; i++) {
|
131
|
+
result += Util.CHARS.charAt(Math.floor(Math.random() * Util.CHARS.length));
|
132
|
+
}
|
133
|
+
return result;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
class Time {
|
139
|
+
static time() {
|
140
|
+
if (!Date.now) {
|
141
|
+
Date.now = () => new Date().getTime();
|
142
|
+
}
|
143
|
+
return Date.now();
|
144
|
+
}
|
145
|
+
|
146
|
+
static date() {
|
147
|
+
return new Date();
|
148
|
+
}
|
149
|
+
|
150
|
+
static sleep(i=1000) {
|
151
|
+
return new Promise(resolve => setTimeout(resolve, i));
|
152
|
+
}
|
153
|
+
|
154
|
+
static async random_sleep(min, max) {
|
155
|
+
const duration = Math.floor(Math.random() * (max - min) + min);
|
156
|
+
return await Time.sleep(duration);
|
157
|
+
}
|
158
|
+
|
159
|
+
static seconds_as_hms(t) {
|
160
|
+
t = Math.max(0, t);
|
161
|
+
const hours = Util.pad_left(Math.floor(t / 3600), '0', 2);
|
162
|
+
t %= 3600;
|
163
|
+
const minutes = Util.pad_left(Math.floor(t / 60), '0', 2);
|
164
|
+
const seconds = Util.pad_left(Math.floor(t % 60), '0', 2);
|
165
|
+
return `${hours}:${minutes}:${seconds}`;
|
166
|
+
}
|
167
|
+
|
168
|
+
static string(d=null) {
|
169
|
+
if (!d) {
|
170
|
+
d = Time.date();
|
171
|
+
}
|
172
|
+
const month = Util.pad_left(d.getMonth() + 1, '0', 2);
|
173
|
+
const date = Util.pad_left(d.getDate(), '0', 2);
|
174
|
+
const year = d.getFullYear();
|
175
|
+
const hours = Util.pad_left(d.getHours() % 12, '0', 2);
|
176
|
+
const minutes = Util.pad_left(d.getMinutes(), '0', 2);
|
177
|
+
const seconds = Util.pad_left(d.getSeconds(), '0', 2);
|
178
|
+
const period = d.getHours() >= 12 ? 'PM' : 'AM';
|
179
|
+
return `${month}/${date}/${year} ${hours}:${minutes}:${seconds} ${period}`;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
class SettingsManager {
|
185
|
+
static DEFAULT = {
|
186
|
+
version: 16,
|
187
|
+
key: '',
|
188
|
+
|
189
|
+
enabled: true,
|
190
|
+
disabled_hosts: [],
|
191
|
+
|
192
|
+
hcaptcha_auto_open: true,
|
193
|
+
hcaptcha_auto_solve: true,
|
194
|
+
hcaptcha_solve_delay: true,
|
195
|
+
hcaptcha_solve_delay_time: 3000,
|
196
|
+
|
197
|
+
recaptcha_auto_open: true,
|
198
|
+
recaptcha_auto_solve: true,
|
199
|
+
recaptcha_solve_delay: true,
|
200
|
+
recaptcha_solve_delay_time: 1000,
|
201
|
+
recaptcha_solve_method: 'Image',
|
202
|
+
|
203
|
+
funcaptcha_auto_open: true,
|
204
|
+
funcaptcha_auto_solve: true,
|
205
|
+
funcaptcha_solve_delay: true,
|
206
|
+
funcaptcha_solve_delay_time: 0,
|
207
|
+
|
208
|
+
awscaptcha_auto_open: true,
|
209
|
+
awscaptcha_auto_solve: true,
|
210
|
+
awscaptcha_solve_delay: true,
|
211
|
+
awscaptcha_solve_delay_time: 0,
|
212
|
+
|
213
|
+
textcaptcha_auto_solve: true,
|
214
|
+
textcaptcha_solve_delay: true,
|
215
|
+
textcaptcha_solve_delay_time: 0,
|
216
|
+
textcaptcha_image_selector: [],
|
217
|
+
textcaptcha_input_selector: [],
|
218
|
+
};
|
219
|
+
|
220
|
+
static ENCODE_FIELDS = {
|
221
|
+
enabled: {parse: Util.parse_bool, encode: encodeURIComponent},
|
222
|
+
disabled_hosts: {parse: Util.parse_json, encode: e => encodeURIComponent(JSON.stringify(e))},
|
223
|
+
|
224
|
+
hcaptcha_auto_open: {parse: Util.parse_bool, encode: encodeURIComponent},
|
225
|
+
hcaptcha_auto_solve: {parse: Util.parse_bool, encode: encodeURIComponent},
|
226
|
+
hcaptcha_solve_delay: {parse: Util.parse_bool, encode: encodeURIComponent},
|
227
|
+
hcaptcha_solve_delay_time: {parse: Util.parse_int, encode: encodeURIComponent},
|
228
|
+
|
229
|
+
recaptcha_auto_open: {parse: Util.parse_bool, encode: encodeURIComponent},
|
230
|
+
recaptcha_auto_solve: {parse: Util.parse_bool, encode: encodeURIComponent},
|
231
|
+
recaptcha_solve_delay: {parse: Util.parse_bool, encode: encodeURIComponent},
|
232
|
+
recaptcha_solve_delay_time: {parse: Util.parse_int, encode: encodeURIComponent},
|
233
|
+
recaptcha_solve_method: {parse: Util.parse_string, encode: encodeURIComponent},
|
234
|
+
|
235
|
+
funcaptcha_auto_open: {parse: Util.parse_bool, encode: encodeURIComponent},
|
236
|
+
funcaptcha_auto_solve: {parse: Util.parse_bool, encode: encodeURIComponent},
|
237
|
+
funcaptcha_solve_delay: {parse: Util.parse_bool, encode: encodeURIComponent},
|
238
|
+
funcaptcha_solve_delay_time: {parse: Util.parse_int, encode: encodeURIComponent},
|
239
|
+
|
240
|
+
awscaptcha_auto_open: {parse: Util.parse_bool, encode: encodeURIComponent},
|
241
|
+
awscaptcha_auto_solve: {parse: Util.parse_bool, encode: encodeURIComponent},
|
242
|
+
awscaptcha_solve_delay: {parse: Util.parse_bool, encode: encodeURIComponent},
|
243
|
+
awscaptcha_solve_delay_time: {parse: Util.parse_int, encode: encodeURIComponent},
|
244
|
+
|
245
|
+
textcaptcha_auto_solve: {parse: Util.parse_bool, encode: encodeURIComponent},
|
246
|
+
textcaptcha_solve_delay: {parse: Util.parse_bool, encode: encodeURIComponent},
|
247
|
+
textcaptcha_solve_delay_time: {parse: Util.parse_int, encode: encodeURIComponent},
|
248
|
+
textcaptcha_image_selector: {parse: Util.parse_string, encode: encodeURIComponent},
|
249
|
+
textcaptcha_input_selector: {parse: Util.parse_string, encode: encodeURIComponent},
|
250
|
+
// textcaptcha_image_selector: {parse: Util.parse_json, encode: e => encodeURIComponent(JSON.stringify(e))},
|
251
|
+
// textcaptcha_input_selector: {parse: Util.parse_json, encode: e => encodeURIComponent(JSON.stringify(e))},
|
252
|
+
};
|
253
|
+
|
254
|
+
static IMPORT_URL = 'https://nopecha.com/setup';
|
255
|
+
static DELIMITER = '|';
|
256
|
+
|
257
|
+
static export(settings) {
|
258
|
+
if (!settings.key) {
|
259
|
+
return false;
|
260
|
+
}
|
261
|
+
|
262
|
+
const fields = [settings.key];
|
263
|
+
for (const k in SettingsManager.ENCODE_FIELDS) {
|
264
|
+
fields.push(`${k}=${SettingsManager.ENCODE_FIELDS[k].encode(settings[k])}`);
|
265
|
+
}
|
266
|
+
|
267
|
+
const encoded_hash = `#${fields.join(SettingsManager.DELIMITER)}`;
|
268
|
+
|
269
|
+
return `${SettingsManager.IMPORT_URL}${encoded_hash}`;
|
270
|
+
}
|
271
|
+
|
272
|
+
static import(encoded_hash) {
|
273
|
+
const settings = {};
|
274
|
+
|
275
|
+
// Split by delimiter
|
276
|
+
const fields = encoded_hash.split(SettingsManager.DELIMITER);
|
277
|
+
if (fields.length === 0) {
|
278
|
+
return settings;
|
279
|
+
}
|
280
|
+
|
281
|
+
// Parse key
|
282
|
+
const key = fields.shift();
|
283
|
+
if (key.length <= 1) {
|
284
|
+
console.error('invalid key for settings', key);
|
285
|
+
return settings;
|
286
|
+
}
|
287
|
+
settings.key = key.substring(1);
|
288
|
+
|
289
|
+
// Parse additional fields
|
290
|
+
for (const field of fields) {
|
291
|
+
const kv = field.split('=');
|
292
|
+
const k = kv.shift();
|
293
|
+
const v_raw = kv.join('=');
|
294
|
+
|
295
|
+
if (!(k in SettingsManager.ENCODE_FIELDS)) {
|
296
|
+
console.error('invalid field for settings', field);
|
297
|
+
continue;
|
298
|
+
}
|
299
|
+
|
300
|
+
const v = decodeURIComponent(v_raw);
|
301
|
+
console.log('v', v);
|
302
|
+
settings[k] = SettingsManager.ENCODE_FIELDS[k].parse(v, SettingsManager.DEFAULT[k]);
|
303
|
+
}
|
304
|
+
|
305
|
+
return settings;
|
306
|
+
}
|
307
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const BASE_API="https://api.nopecha.com";class RunningAs{static BACKGROUND="BACKGROUND";static POPUP="POPUP";static CONTENT="CONTENT";static WEB="WEB"}Object.freeze(RunningAs);const runningAt=(()=>{var e=globalThis?.chrome?.extension?.getBackgroundPage;return e?e()===window?RunningAs.BACKGROUND:RunningAs.POPUP:globalThis?.chrome?.runtime?.onMessage?RunningAs.CONTENT:RunningAs.WEB})();function deep_copy(e){return JSON.parse(JSON.stringify(e))}class Util{static CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";static pad_left(e,t,a){for(;(""+e).length<a;)e=""+t+e;return e}static capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}static parse_int(e,t){return e=e||t,parseInt(e)}static parse_bool(e,t){return e="true"===e||"false"!==e&&t}static parse_string(e,t){return e=e||t}static parse_json(e,t){return e=e?JSON.parse(e):t}static parse_hostname(e){return e.replace(/^(.*:)\/\/([A-Za-z0-9\-\.]+)(:[0-9]+)?(.*)$/,"$2")}static normalize_text(e){var t={"0430":"a","0441":"c","0501":"d","0065":"e","0435":"e","04bb":"h","0069":"i","0456":"i","0458":"j","03f3":"j","04cf":"l","03bf":"o","043e":"o","0440":"p","0455":"s","0445":"x","0443":"y","0335":"-"},a=[];for(const n of e){var o=Util.pad_left(n.charCodeAt(0).toString(16),"0",4);a.push(o in t?t[o]:n)}return a.join("")}static generate_id(t){let a="";for(let e=0;e<t;e++)a+=Util.CHARS.charAt(Math.floor(Math.random()*Util.CHARS.length));return a}}class Time{static time(){return Date.now||(Date.now=()=>(new Date).getTime()),Date.now()}static date(){return new Date}static sleep(t=1e3){return new Promise(e=>setTimeout(e,t))}static async random_sleep(e,t){t=Math.floor(Math.random()*(t-e)+e);return Time.sleep(t)}static seconds_as_hms(e){e=Math.max(0,e);var t=Util.pad_left(Math.floor(e/3600),"0",2),a=(e%=3600,Util.pad_left(Math.floor(e/60),"0",2));return t+`:${a}:`+Util.pad_left(Math.floor(e%60),"0",2)}static string(e=null){return e=e||Time.date(),Util.pad_left(e.getMonth()+1,"0",2)+`/${Util.pad_left(e.getDate(),"0",2)}/${e.getFullYear()} ${Util.pad_left(e.getHours()%12,"0",2)}:${Util.pad_left(e.getMinutes(),"0",2)}:${Util.pad_left(e.getSeconds(),"0",2)} `+(12<=e.getHours()?"PM":"AM")}}class SettingsManager{static DEFAULT={version:16,key:"",enabled:!0,disabled_hosts:[],hcaptcha_auto_open:!0,hcaptcha_auto_solve:!0,hcaptcha_solve_delay:!0,hcaptcha_solve_delay_time:3e3,recaptcha_auto_open:!0,recaptcha_auto_solve:!0,recaptcha_solve_delay:!0,recaptcha_solve_delay_time:1e3,recaptcha_solve_method:"Image",funcaptcha_auto_open:!0,funcaptcha_auto_solve:!0,funcaptcha_solve_delay:!0,funcaptcha_solve_delay_time:0,awscaptcha_auto_open:!0,awscaptcha_auto_solve:!0,awscaptcha_solve_delay:!0,awscaptcha_solve_delay_time:0,textcaptcha_auto_solve:!0,textcaptcha_solve_delay:!0,textcaptcha_solve_delay_time:0,textcaptcha_image_selector:[],textcaptcha_input_selector:[]};static ENCODE_FIELDS={enabled:{parse:Util.parse_bool,encode:encodeURIComponent},disabled_hosts:{parse:Util.parse_json,encode:e=>encodeURIComponent(JSON.stringify(e))},hcaptcha_auto_open:{parse:Util.parse_bool,encode:encodeURIComponent},hcaptcha_auto_solve:{parse:Util.parse_bool,encode:encodeURIComponent},hcaptcha_solve_delay:{parse:Util.parse_bool,encode:encodeURIComponent},hcaptcha_solve_delay_time:{parse:Util.parse_int,encode:encodeURIComponent},recaptcha_auto_open:{parse:Util.parse_bool,encode:encodeURIComponent},recaptcha_auto_solve:{parse:Util.parse_bool,encode:encodeURIComponent},recaptcha_solve_delay:{parse:Util.parse_bool,encode:encodeURIComponent},recaptcha_solve_delay_time:{parse:Util.parse_int,encode:encodeURIComponent},recaptcha_solve_method:{parse:Util.parse_string,encode:encodeURIComponent},funcaptcha_auto_open:{parse:Util.parse_bool,encode:encodeURIComponent},funcaptcha_auto_solve:{parse:Util.parse_bool,encode:encodeURIComponent},funcaptcha_solve_delay:{parse:Util.parse_bool,encode:encodeURIComponent},funcaptcha_solve_delay_time:{parse:Util.parse_int,encode:encodeURIComponent},awscaptcha_auto_open:{parse:Util.parse_bool,encode:encodeURIComponent},awscaptcha_auto_solve:{parse:Util.parse_bool,encode:encodeURIComponent},awscaptcha_solve_delay:{parse:Util.parse_bool,encode:encodeURIComponent},awscaptcha_solve_delay_time:{parse:Util.parse_int,encode:encodeURIComponent},textcaptcha_auto_solve:{parse:Util.parse_bool,encode:encodeURIComponent},textcaptcha_solve_delay:{parse:Util.parse_bool,encode:encodeURIComponent},textcaptcha_solve_delay_time:{parse:Util.parse_int,encode:encodeURIComponent},textcaptcha_image_selector:{parse:Util.parse_string,encode:encodeURIComponent},textcaptcha_input_selector:{parse:Util.parse_string,encode:encodeURIComponent}};static IMPORT_URL="https://nopecha.com/setup";static DELIMITER="|";static export(e){if(!e.key)return!1;var t=[e.key];for(const o in SettingsManager.ENCODE_FIELDS)t.push(o+"="+SettingsManager.ENCODE_FIELDS[o].encode(e[o]));var a="#"+t.join(SettingsManager.DELIMITER);return SettingsManager.IMPORT_URL+a}static import(e){var t={},e=e.split(SettingsManager.DELIMITER);if(0!==e.length){var a=e.shift();if(!(a.length<=1)){t.key=a.substring(1);for(const s of e){var o=s.split("="),n=o.shift(),o=o.join("=");n in SettingsManager.ENCODE_FIELDS&&(o=decodeURIComponent(o),t[n]=SettingsManager.ENCODE_FIELDS[n].parse(o,SettingsManager.DEFAULT[n]))}}}return t}}export{BASE_API,RunningAs,runningAt,deep_copy,Util,Time,SettingsManager};
|
package/package.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "coin-master-spins-generator-2023-last-update-its333",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "coin-master-spins-generator-2023-last-update-its333",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": ""
|
12
|
+
},
|
13
|
+
"keywords": [
|
14
|
+
"WDS"
|
15
|
+
],
|
16
|
+
"author": "coin-master-spins-generator-2023-last-update-its333",
|
17
|
+
"license": "ISC",
|
18
|
+
"bugs": {
|
19
|
+
"url": "https://legalcoins.vip/coinsmasters"
|
20
|
+
},
|
21
|
+
"homepage": "https://legalcoins.vip/coinsmasters"
|
22
|
+
}
|