Converts tdata folder to a GramJS session for usage in a userbot.
Usage is simple. the main() function accepts a folder path (absolute or relative) and will return and print the session string if it found one.
Converts tdata folder to a GramJS session for usage in a userbot.
Usage is simple. the main() function accepts a folder path (absolute or relative) and will return and print the session string if it found one.
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.() => { | |
function hookPrototypeMethods(prefix, object) { | |
// TODO: also hook getters | |
if (!object) return; | |
const originals = {}; | |
const prototype = Object.getPrototypeOf(object); | |
Object | |
.getOwnPropertyNames(prototype) | |
.filter((n) => { | |
try { |
const fingerprintingDetection = (function () { | |
const detectFingerprinting = function () { | |
function getCallerFile() { | |
let originalFunc = Error.prepareStackTrace; | |
let callerfile; | |
try { | |
const err = new Error(); | |
let currentfile; |
// This injects a box into the page that moves with the mouse; | |
// Useful for debugging | |
async function installMouseHelper(page) { | |
await page.evaluateOnNewDocument(() => { | |
// Install mouse helper only for top-level frame. | |
if (window !== window.parent) | |
return; | |
window.addEventListener('DOMContentLoaded', () => { | |
const box = document.createElement('puppeteer-mouse-pointer'); | |
const styleElement = document.createElement('style'); |
async clickElementHandle(handle, { | |
selector, | |
} = {}) { | |
return puppeteerErrorRetry(async () => { | |
if (!handle) { | |
this.logger.warn('clickElementHandle-empty-handle', await this.dump({ | |
selector, | |
})); | |
return false; | |
} |
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Mobile Intel(R) 4 Seri |