{"id":15685388,"url":"https://github.com/lysandrejik/omegle-crawler-node","last_synced_at":"2026-03-06T10:30:57.988Z","repository":{"id":57314285,"uuid":"183642964","full_name":"LysandreJik/omegle-crawler-node","owner":"LysandreJik","description":"Node library to connect to and interact with the Omegle website.","archived":false,"fork":false,"pushed_at":"2019-05-03T13:45:40.000Z","size":62,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-20T10:43:57.264Z","etag":null,"topics":["crawler","omegle","puppeteer"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LysandreJik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-26T14:27:43.000Z","updated_at":"2024-04-25T10:51:35.000Z","dependencies_parsed_at":"2022-09-20T23:21:21.455Z","dependency_job_id":null,"html_url":"https://github.com/LysandreJik/omegle-crawler-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LysandreJik%2Fomegle-crawler-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LysandreJik%2Fomegle-crawler-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LysandreJik%2Fomegle-crawler-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LysandreJik%2Fomegle-crawler-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LysandreJik","download_url":"https://codeload.github.com/LysandreJik/omegle-crawler-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922219,"owners_count":21825633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawler","omegle","puppeteer"],"created_at":"2024-10-03T17:25:03.651Z","updated_at":"2026-03-06T10:30:57.883Z","avatar_url":"https://github.com/LysandreJik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# omegle-crawler-node\n\nNode library to connect to and interact with the Omegle website. This library includes support for captcha solving, as well as video chat.\nThis library is using puppeteer and is therefore using an instance of chromium to access Omegle exactly as a browser.\n\n## Getting started\n\n### Installation\n\nTo use omegle-node-crawler in your project, run:\n\n```\nnpm i omegle-node-crawler\n```\n\nor\n\n```\nyarn add omegle-node-crawler\n```\n\n### Usage\n\nThis library uses an event-based mechanism.\nStart by binding your functions to the possible events and then start a conversation. All the events and methods are available in the documentation section [below](#documentation).\n\nCrawler example usage:\n\n```javascript\nimport { Handler } from \"omegle-crawler-node\";\n\nconst handler = new Handler({ headless: false });\n\nhandler.onConnected(() =\u003e handler.sendMessage(\"Hello.\"));\nhandler.onDisconnected(() =\u003e console.log(\"Disconnected\"));\nhandler.onCaptcha(() =\u003e console.log(\"Captcha found\"));\n\nhandler.startConversation(\"text\");\nhandler.sendMessage(\"Hello\");\n```\n\n### Usage with video\n\nThis library allows for video chat. In order to use video chat, you must provide a valid video file in the format `.y4m` so that Chromium may read it. More information about this format and how to create files that work can be found [here](https://testrtc.com/y4m-video-chrome/).\n\nThe path to the video file must be **absolute**.\n\nHere is an example of using video chat:\n\n```javascript\nimport { Handler } from \"omegle-crawler-node\";\n\nconst handler = new Handler();\n\nhandler.onConnected(() =\u003e handler.sendMessage(\"Hello.\"));\nhandler.onDisconnected(() =\u003e console.log(\"Disconnected\"));\nhandler.onCaptcha(captchaIdentifier =\u003e console.log(\"Captcha found\", captchaIdentifier));\n\nhandler.startConversation(\"video\", __dirname + \"/video.y4m\");\nhandler.sendMessage(\"Hello\"); // __dirname returns the path of the current directory.\n```\n\n## Documentation\n\n### Instanciation\n\nEach instance of `Handler` is independant, allowing you to have multiple crawlers running at the same time. _Keep in mind that the most crawlers are running, the highter the chance that Omegle detects you're a bot and flags you, increasing your captcha rate and the chance to get IP banned._\n\nCreate a new instance using the `new` keyword:\n\n#### new Handler(options)\n\nThe options are puppeteer options, and can therefore be found on their [API page](https://github.com/GoogleChrome/puppeteer/blob/v1.15.0/docs/api.md#puppeteerlaunchoptions).\nSome of them are overriden when trying to use the video: `--use-fake-ui-for-media-stream`, `--use-fake-device-for-media-stream`, `--use-file-for-fake-video-capture=${videoPath}`\n\nExample:\n\n```typescript\nconst handler = new Handler();\n```\n\n### Events\n\nHere are listed all the events that can be triggered by this library.\n\n#### onConnected(event: () =\u003e any)\n\nTriggered when the instance has connected to a stranger.\n\nExample:\n\n```javascript\nhandler.onConnected(() =\u003e console.log(\"Connected to stranger!\"));\n```\n\n#### onDisconnected(event: () =\u003e any)\n\nTriggered when the instance has been disconnected from the stranger.\n\nExample:\n\n```javascript\nhandler.onDisconnected(() =\u003e console.log(\"Disconnected from stranger!\"));\n```\n\n#### onCaptcha(even: (captchaID: string) =\u003e any)\n\nTriggered when the instance has received a captcha.\n\nExample:\n\n```javascript\nhandler.onCaptcha(captchaID =\u003e console.log(\"Captcha detected\", captchaID));\n```\n\n#### onMessageReceived(event: (message: string) =\u003e any)\n\nTriggered when the stranger has sent a message\n\nExample:\n\n```javascript\nhandler.onMessageReceived(message =\u003e console.log(\"Message received:\", message));\n```\n\n#### onInformation(event: (information: string) =\u003e any)\n\nTriggered when an information was printed on screen.\n\nExample of information messages: \"Omegle couldn't find someone with the same interests\".\n\nExample:\n\n```javascript\nhandler.onInformation(information =\u003e console.log(\"Received information\", information));\n```\n\n#### onError(event: (error: string) =\u003e any)\n\nTriggered when the instance has received an error.\n\nThe error \"Connection to server blocked.\" means you have been IP blocked by Omegle. This usually happens if you're connecting from a server based on a platform such as Azure or AWS.\n\nExample:\n\n```javascript\nhandler.onError(error =\u003e console.log(\"Received error\", error));\n```\n\n#### onMessageSent(event: (message: string) =\u003e any)\n\nTriggered when the instance successfully sent a message.\n\nExample:\n\n```javascript\nhandler.onConnected(message =\u003e console.log(\"Script sent message\", message));\n```\n\n#### onUnexpectedToken(event: (unexpectedToken: string) =\u003e any)\n\nTriggered when the instance has received an unexpected token.\n\nExample:\n\n```javascript\nhandler.onConnected(unexpectedToken =\u003e console.log(\"Unexpected token!\", unexpectedToken));\n```\n\n### Methods\n\nMethods you can call on your `Handler` instance\n\n#### startConversation(conversationType: \"text\" | \"video\" [,options])\n\nStart looking for a conversation. Launches the browser if it is not already open. The parameters are different according to the conversation type specified (text or video).\n\nFor text:\n\n```typescript\nstartConversation(\"text\", topics?: string[], cookiesFilePath?: string)\n```\n\nFor video:\n\n```typescript\nstartConversation(conversationType: \"video\", videoPath: string, topics?: string[], cookiesFilePath?: string)\n```\n\nReturns a promise that resolves once the page has been opened and all listeners have been initialized.\n\nExample:\n\n```javascript\nhandler.startConversation(\"text\", [\"chat\", \"friends\"], \"./cookies\");\nhandler.startConversation(\"video\", \"/Users/\u003cuser\u003e/file.y4m\", [\"chat\", \"friends\"], \"./cookies\");\n```\n\n#### sendMessage(message: string, delay?: number)\n\nSends message to the stranger. A delay between keystrokes can be given.\nThis delay is so that the information \"Stranger is typing...\" is displayed for a given amount of time.\nThe default delay is 50ms.\n\nReturns a promise that resolves once the message has been sent.\n\nExample:\n\n```javascript\nhandler.sendMessage(\"Hi there\", 50);\n```\n\n#### solveCaptchaWith2CaptchaApiKey(captchaIdentifier: string, twoCaptchaAPIKey: string)\n\nIncluded is a way to solve captchas using the 2captcha API. When a captcha is displayed on screen, the `onCaptcha` event is triggered, calling the bound function with a captcha identifier. This built-in method can be used as follows:\n\nReturns a promise that resolves once the captcha has been solved.\n\n```javascript\nhandler.onCaptcha(captchaIdentifier =\u003e {\n\thandler.solveCaptchaWith2CaptchaApiKey(captchaIdentifier, \"api_key\");\n});\n```\n\n#### solveCaptcha(captchaResult: string)\n\nYou can use the captcha identifier with any API to solve this captcha. Once a result is given by the API, you can solve the captcha as follows:\n\nReturns a promise that resolves once the captcha has been solved.\n\n```javascript\nhandler.onCaptcha(captchaIdentifier =\u003e {\n\tconst result = getResultFromYourAPI(captchaIdentifier).then(result =\u003e handler.solveCaptcha(result));\n});\n```\n\n#### exit()\n\nCloses the browser.\n\nReturns a promise that resolves once the browser has been closed.\n\n```javascript\nhandler.exit();\n```\n\n## License\n\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)\n\n-   **[MIT license](http://opensource.org/licenses/mit-license.php)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysandrejik%2Fomegle-crawler-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flysandrejik%2Fomegle-crawler-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysandrejik%2Fomegle-crawler-node/lists"}