From 6152873a50805d7b3b6cf870a7b0ae7182f44028 Mon Sep 17 00:00:00 2001 From: Vitaly Gashkov Date: Tue, 26 Aug 2025 12:21:50 +0500 Subject: [PATCH] feat: add `pull` to fetch credentials from json in repo --- crextractor.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crextractor.js b/crextractor.js index 6bc0872..9fa98b3 100644 --- a/crextractor.js +++ b/crextractor.js @@ -96,7 +96,7 @@ const parseVersion = async (decompiledDir) => { } }; -const extract = async ({ target, output, cleanup = false } = {}) => { +const extract = async ({ target = 'mobile', output, cleanup = false } = {}) => { console.log('Downloading APK...'); const apkPath = target === 'tv' ? await downloadTvApk() : await downloadMobileApk(); @@ -128,4 +128,10 @@ const extract = async ({ target, output, cleanup = false } = {}) => { return { version, id, secret, encoded, authorization }; }; -module.exports = { extract }; +const pull = async ({ target = 'mobile' } = {}) => { + const url = `https://raw.githubusercontent.com/vitalygashkov/crextractor/refs/heads/main/credentials.${target}.json`; + const credentials = await fetch(url).then((response) => response.json()); + return credentials; +}; + +module.exports = { extract, pull };