{"_id":"@ru-hend/ytdl-core","_rev":"3-503e247035211fad29f6fa3e6e64f0bd","name":"@ru-hend/ytdl-core","dist-tags":{"latest":"4.16.15"},"versions":{"4.16.13":{"name":"@ru-hend/ytdl-core","version":"4.16.13","keywords":["youtube","video","download","distube"],"author":{"url":"https://github.com/skick1234","name":"Skick"},"license":"MIT","_id":"@ru-hend/ytdl-core@4.16.13","maintainers":[{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"}],"contributors":[{"url":"https://github.com/fent","name":"fent","email":"fentbox@gmail.com"},{"url":"https://github.com/TimeForANinja","name":"Tobias Kutscha"},{"url":"https://github.com/andrewrk","name":"Andrew Kelley"},{"url":"https://github.com/mallendeo","name":"Mauricio Allende"},{"url":"https://github.com/raltamirano","name":"Rodrigo Altamirano"},{"url":"https://github.com/JimmyBoh","name":"Jim Buck"},{"url":"https://github.com/Roki100","name":"Pawel Rucinski"},{"url":"https://github.com/Million900o","name":"Alexander Paolini"}],"homepage":"https://github.com/distubejs/ytdl-core#readme","bugs":{"url":"https://github.com/distubejs/ytdl-core/issues"},"dist":{"shasum":"59518cbbb9408ba56895562dd26c3288ca7a17d5","tarball":"https://registry.npmjs.org/@ru-hend/ytdl-core/-/ytdl-core-4.16.13.tgz","fileCount":13,"integrity":"sha512-aMU2Im2gVtg9f9YPCPLoB2aVogneusO25yjVV7UA1zhgZB7zqASAkT9VhmF9j2Yw8B1QU0jjO+TsY9DZv5Y6RQ==","signatures":[{"sig":"MEYCIQCM6hyo8Eszwq5We+WgvOTioOwNK32qKg8gbcNbiW+DoQIhAMZaUEFOb2dCqCPsUw2gWuyc+N14lQpL8Gco7JD0aIjz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103212},"main":"./lib/index.js","engines":{"node":">=10"},"funding":"https://github.com/distubejs/ytdl-core?sponsor","gitHead":"732525935f3b03208be520b92c9764321fa5bcd3","scripts":{"prettier":"prettier --write \"**/*.{js,json,yml,md,ts}\""},"_npmUser":{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"},"repository":{"url":"git://github.com/distubejs/ytdl-core.git","type":"git"},"_npmVersion":"10.7.0","description":"DisTube fork of ytdl-core. YouTube video downloader in pure javascript.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"sax":"^1.4.1","undici":"7.8.0","miniget":"^4.2.3","m3u8stream":"^0.8.6","tough-cookie":"^5.1.2","http-cookie-agent":"^7.0.1","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.2"},"_npmOperationalInternal":{"tmp":"tmp/ytdl-core_4.16.13_1753974728398_0.668564984870778","host":"s3://npm-registry-packages-npm-production"}},"4.16.14":{"name":"@ru-hend/ytdl-core","version":"4.16.14","keywords":["youtube","video","download","distube"],"author":{"url":"https://github.com/skick1234","name":"Skick"},"license":"MIT","_id":"@ru-hend/ytdl-core@4.16.14","maintainers":[{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"}],"contributors":[{"url":"https://github.com/fent","name":"fent","email":"fentbox@gmail.com"},{"url":"https://github.com/TimeForANinja","name":"Tobias Kutscha"},{"url":"https://github.com/andrewrk","name":"Andrew Kelley"},{"url":"https://github.com/mallendeo","name":"Mauricio Allende"},{"url":"https://github.com/raltamirano","name":"Rodrigo Altamirano"},{"url":"https://github.com/JimmyBoh","name":"Jim Buck"},{"url":"https://github.com/Roki100","name":"Pawel Rucinski"},{"url":"https://github.com/Million900o","name":"Alexander Paolini"}],"homepage":"https://github.com/distubejs/ytdl-core#readme","bugs":{"url":"https://github.com/distubejs/ytdl-core/issues"},"dist":{"shasum":"408a68a842191dc08f38e32630eac3ad302a8e35","tarball":"https://registry.npmjs.org/@ru-hend/ytdl-core/-/ytdl-core-4.16.14.tgz","fileCount":13,"integrity":"sha512-0/xIFacI4DFd5Ei1O06KNJ+e/FglwEf2RiJbHJJiRHmkXtkyjhY7fougkoPD6qrSfedsrPsCN5nsJX89c/YguA==","signatures":[{"sig":"MEUCIQDyCjaEZyb8Bm3cU4O1uUeUkYmcS803I2Pe5DOcQzBmzwIgTJRYBgfwlp0fCDPMzHle9+tL+yy20JmjAgig4aft+Rc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103226},"main":"./lib/index.js","engines":{"node":">=10"},"funding":"https://github.com/distubejs/ytdl-core?sponsor","gitHead":"f89f6db2b695de30c9272cafe975645af5bf19e0","scripts":{"prettier":"prettier --write \"**/*.{js,json,yml,md,ts}\""},"_npmUser":{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"},"repository":{"url":"git://github.com/distubejs/ytdl-core.git","type":"git"},"_npmVersion":"10.7.0","description":"DisTube fork of ytdl-core. YouTube video downloader in pure javascript.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"sax":"^1.4.1","undici":"npm:@ru-hend/undici","miniget":"^4.2.3","m3u8stream":"^0.8.6","tough-cookie":"^5.1.2","http-cookie-agent":"^7.0.1","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.5.3","typescript":"^5.8.3","@types/node":"^22.15.2"},"_npmOperationalInternal":{"tmp":"tmp/ytdl-core_4.16.14_1754264399195_0.6072270474965624","host":"s3://npm-registry-packages-npm-production"}},"4.16.15":{"name":"@ru-hend/ytdl-core","description":"DisTube fork of ytdl-core. YouTube video downloader in pure javascript.","keywords":["youtube","video","download","distube"],"version":"4.16.15","repository":{"type":"git","url":"git://github.com/distubejs/ytdl-core.git"},"author":{"name":"Skick","url":"https://github.com/skick1234"},"contributors":[{"name":"fent","email":"fentbox@gmail.com","url":"https://github.com/fent"},{"name":"Tobias Kutscha","url":"https://github.com/TimeForANinja"},{"name":"Andrew Kelley","url":"https://github.com/andrewrk"},{"name":"Mauricio Allende","url":"https://github.com/mallendeo"},{"name":"Rodrigo Altamirano","url":"https://github.com/raltamirano"},{"name":"Jim Buck","url":"https://github.com/JimmyBoh"},{"name":"Pawel Rucinski","url":"https://github.com/Roki100"},{"name":"Alexander Paolini","url":"https://github.com/Million900o"}],"main":"./lib/index.js","dependencies":{"http-cookie-agent":"npm:@ru-hend/http-cookie-agent","https-proxy-agent":"^7.0.6","m3u8stream":"^0.8.6","miniget":"^4.2.3","sax":"^1.4.1","tough-cookie":"^5.1.2","undici":"npm:@ru-hend/undici"},"devDependencies":{"@types/node":"^22.15.2","prettier":"^3.5.3","typescript":"^5.8.3"},"engines":{"node":">=10"},"license":"MIT","funding":"https://github.com/distubejs/ytdl-core?sponsor","scripts":{"prettier":"prettier --write \"**/*.{js,json,yml,md,ts}\""},"_id":"@ru-hend/ytdl-core@4.16.15","gitHead":"f89f6db2b695de30c9272cafe975645af5bf19e0","bugs":{"url":"https://github.com/distubejs/ytdl-core/issues"},"homepage":"https://github.com/distubejs/ytdl-core#readme","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-JfZ9oNJotoGtjejK1J0SlSIV4xPwWXQahqQ/9/ixIojFETH7zRdGFIkP82wkfrlFmMc6jUSVTcB48JonHunACg==","shasum":"91b25dfe4503ce6d86f4a7aa3c1270d3beb50611","tarball":"https://registry.npmjs.org/@ru-hend/ytdl-core/-/ytdl-core-4.16.15.tgz","fileCount":13,"unpackedSize":103250,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDr7SHZTCNpvYeKR5mPsZ8+TIc9Kdu0oSQgAQsT8wbU8gIgDOZYZPvo8Tzd+EDt7vQ7fzlLYGFVEFfhADr0JqLqPdQ="}]},"_npmUser":{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"},"directories":{},"maintainers":[{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ytdl-core_4.16.15_1754265487325_0.6987389396684269"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-31T15:12:08.323Z","modified":"2025-08-03T23:58:07.711Z","4.16.13":"2025-07-31T15:12:08.604Z","4.16.14":"2025-08-03T23:39:59.364Z","4.16.15":"2025-08-03T23:58:07.521Z"},"bugs":{"url":"https://github.com/distubejs/ytdl-core/issues"},"author":{"name":"Skick","url":"https://github.com/skick1234"},"license":"MIT","homepage":"https://github.com/distubejs/ytdl-core#readme","keywords":["youtube","video","download","distube"],"repository":{"type":"git","url":"git://github.com/distubejs/ytdl-core.git"},"description":"DisTube fork of ytdl-core. YouTube video downloader in pure javascript.","contributors":[{"name":"fent","email":"fentbox@gmail.com","url":"https://github.com/fent"},{"name":"Tobias Kutscha","url":"https://github.com/TimeForANinja"},{"name":"Andrew Kelley","url":"https://github.com/andrewrk"},{"name":"Mauricio Allende","url":"https://github.com/mallendeo"},{"name":"Rodrigo Altamirano","url":"https://github.com/raltamirano"},{"name":"Jim Buck","url":"https://github.com/JimmyBoh"},{"name":"Pawel Rucinski","url":"https://github.com/Roki100"},{"name":"Alexander Paolini","url":"https://github.com/Million900o"}],"maintainers":[{"name":"rulihenderson","email":"matsunagahisahde@gmail.com"}],"readme":"# @distube/ytdl-core\n\n> [!IMPORTANT]\n> [@distube/youtube](https://github.com/distubejs/extractor-plugins) depends on [youtubei.js](https://github.com/LuanRT/YouTube.js) from now on.\\\n> This fork will be no longer maintained. Please use alternatives (e.g. [youtubei.js](https://github.com/LuanRT/YouTube.js)) instead.\n\nDisTube fork of `ytdl-core`. This fork is dedicated to fixing bugs and adding features that are not merged into the original repo as soon as possible.\n\n<a href='https://ko-fi.com/skick' target='_blank'><img height='48' src='https://storage.ko-fi.com/cdn/kofi3.png' alt='Buy Me a Coffee at ko-fi.com' /></a>\n\n## Installation\n\n```bash\nnpm install @distube/ytdl-core@latest\n```\n\nMake sure you're installing the latest version of `@distube/ytdl-core` to keep up with the latest fixes.\n\n## Usage\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\n// TypeScript: import ytdl from '@distube/ytdl-core'; with --esModuleInterop\n// TypeScript: import * as ytdl from '@distube/ytdl-core'; with --allowSyntheticDefaultImports\n// TypeScript: import ytdl = require('@distube/ytdl-core'); with neither of the above\n\n// Download a video\nytdl(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\").pipe(require(\"fs\").createWriteStream(\"video.mp4\"));\n\n// Get video info\nytdl.getBasicInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\").then(info => {\n  console.log(info.videoDetails.title);\n});\n\n// Get video info with download formats\nytdl.getInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\").then(info => {\n  console.log(info.formats);\n});\n```\n\n### Cookies Support\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\n\n// (Optional) Below are examples, NOT the recommended options\nconst cookies = [\n  { name: \"cookie1\", value: \"COOKIE1_HERE\" },\n  { name: \"cookie2\", value: \"COOKIE2_HERE\" },\n];\n\n// (Optional) http-cookie-agent / undici agent options\n// Below are examples, NOT the recommended options\nconst agentOptions = {\n  pipelining: 5,\n  maxRedirections: 0,\n  localAddress: \"127.0.0.1\",\n};\n\n// agent should be created once if you don't want to change your cookie\nconst agent = ytdl.createAgent(cookies, agentOptions);\n\nytdl.getBasicInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\nytdl.getInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\n```\n\n#### How to get cookies\n\n- Install [EditThisCookie](http://www.editthiscookie.com/) extension for your browser.\n- Go to [YouTube](https://www.youtube.com/).\n- Log in to your account. (You should use a new account for this purpose)\n- Click on the extension icon and click \"Export\" icon.\n- Your cookies will be added to your clipboard and paste it into your code.\n\n> [!WARNING]\n> Don't logout it by clicking logout button on youtube/google account manager, it will expire your cookies.\n> You can delete your browser's cookies to log it out on your browser.\n> Or use incognito mode to get your cookies then close it.\n\n> [!WARNING]\n> Paste all the cookies array from clipboard into `createAgent` function. Don't remove/edit any cookies if you don't know what you're doing.\n\n> [!WARNING]\n> Make sure your account, which logged in when you getting your cookies, use 1 IP at the same time only. It will make your cookies alive longer.\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\nconst agent = ytdl.createAgent([\n  {\n    domain: \".youtube.com\",\n    expirationDate: 1234567890,\n    hostOnly: false,\n    httpOnly: true,\n    name: \"---xxx---\",\n    path: \"/\",\n    sameSite: \"no_restriction\",\n    secure: true,\n    session: false,\n    value: \"---xxx---\",\n  },\n  {\n    \"...\": \"...\",\n  },\n]);\n```\n\n- Or you can paste your cookies array into a file and use `fs.readFileSync` to read it.\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\nconst fs = require(\"fs\");\nconst agent = ytdl.createAgent(JSON.parse(fs.readFileSync(\"cookies.json\")));\n```\n\n### Proxy Support\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\n\nconst agent = ytdl.createProxyAgent({ uri: \"my.proxy.server\" });\n\nytdl.getBasicInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\nytdl.getInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\n```\n\nUse both proxy and cookies:\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\n\nconst agent = ytdl.createProxyAgent({ uri: \"my.proxy.server\" }, [{ name: \"cookie\", value: \"COOKIE_HERE\" }]);\n\nytdl.getBasicInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\nytdl.getInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent });\n```\n\n### IP Rotation\n\n_Built-in ip rotation (`getRandomIPv6`) won't be updated and will be removed in the future, create your own ip rotation instead._\n\nTo implement IP rotation, you need to assign the desired IP address to the `localAddress` property within `undici.Agent.Options`.\nTherefore, you'll need to use a different `ytdl.Agent` for each IP address you want to use.\n\n```js\nconst ytdl = require(\"@distube/ytdl-core\");\nconst { getRandomIPv6 } = require(\"@distube/ytdl-core/lib/utils\");\n\nconst agentForARandomIP = ytdl.createAgent(undefined, {\n  localAddress: getRandomIPv6(\"2001:2::/48\"),\n});\n\nytdl.getBasicInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent: agentForARandomIP });\n\nconst agentForAnotherRandomIP = ytdl.createAgent(undefined, {\n  localAddress: getRandomIPv6(\"2001:2::/48\"),\n});\n\nytdl.getInfo(\"http://www.youtube.com/watch?v=aqz-KE-bpKQ\", { agent: agentForAnotherRandomIP });\n```\n\n## API\n\nYou can find the API documentation in the [original repo](https://github.com/fent/node-ytdl-core#api). Except a few changes:\n\n### `ytdl.getInfoOptions`\n\n- `requestOptions` is now `undici`'s [`RequestOptions`](https://github.com/nodejs/undici#undicirequesturl-options-promise).\n- `agent`: [`ytdl.Agent`](https://github.com/distubejs/ytdl-core/blob/master/typings/index.d.ts#L10-L14)\n- `playerClients`: An array of player clients to use. Accepts `WEB`, `WEB_EMBEDDED`, `TV`, `IOS`, and `ANDROID`. Defaults to `[\"WEB_EMBEDDED\", \"IOS\", \"ANDROID\",\"TV\"]`.\n- `fetch`: Custom fetch implementation. Defaults to `undici`'s request.\n\n### `ytdl.createAgent([cookies]): ytdl.Agent`\n\n`cookies`: an array of json cookies exported with [EditThisCookie](http://www.editthiscookie.com/).\n\n### `ytdl.createProxyAgent(proxy[, cookies]): ytdl.Agent`\n\n`proxy`: [`ProxyAgentOptions`](https://github.com/nodejs/undici/blob/main/docs/api/ProxyAgent.md#parameter-proxyagentoptions) contains your proxy server information.\n\n#### How to implement `ytdl.Agent` with your own Dispatcher\n\nYou can find the example [here](https://github.com/distubejs/ytdl-core/blob/master/lib/cookie.js#L73-L86)\n\n## Limitations\n\nytdl cannot download videos that fall into the following\n\n- Regionally restricted (requires a [proxy](#proxy-support))\n- Private (if you have access, requires [cookies](#cookies-support))\n- Rentals (if you have access, requires [cookies](#cookies-support))\n- YouTube Premium content (if you have access, requires [cookies](#cookies-support))\n- Only [HLS Livestreams](https://en.wikipedia.org/wiki/HTTP_Live_Streaming) are currently supported. Other formats will get filtered out in ytdl.chooseFormats\n\nGenerated download links are valid for 6 hours, and may only be downloadable from the same IP address.\n\n## Rate Limiting\n\nWhen doing too many requests YouTube might block. This will result in your requests getting denied with HTTP-StatusCode 429. The following steps might help you:\n\n- Update `@distube/ytdl-core` to the latest version\n- Use proxies (you can find an example [here](#proxy-support))\n- Extend the Proxy Idea by rotating (IPv6-)Addresses\n  - read [this](https://github.com/fent/node-ytdl-core#how-does-using-an-ipv6-block-help) for more information about this\n- Use cookies (you can find an example [here](#cookies-support))\n  - for this to take effect you have to FIRST wait for the current rate limit to expire\n- Wait it out (it usually goes away within a few days)\n\n## Update Checks\n\nThe issue of using an outdated version of ytdl-core became so prevalent, that ytdl-core now checks for updates at run time, and every 12 hours. If it finds an update, it will print a warning to the console advising you to update. Due to the nature of this library, it is important to always use the latest version as YouTube continues to update.\n\nIf you'd like to disable this update check, you can do so by providing the `YTDL_NO_UPDATE` env variable.\n\n```\nenv YTDL_NO_UPDATE=1 node myapp.js\n```\n\n## Related Projects\n\n- [DisTube](https://github.com/skick1234/DisTube) - A Discord.js module to simplify your music commands and play songs with audio filters on Discord without any API key.\n- [@distube/ytsr](https://github.com/distubejs/ytsr) - DisTube fork of [ytsr](https://github.com/TimeForANinja/node-ytsr).\n- [@distube/ytpl](https://github.com/distubejs/ytpl) - DisTube fork of [ytpl](https://github.com/TimeForANinja/node-ytpl).\n","readmeFilename":"README.md"}