2.0.0 • Published 1 year ago
@mrhansamala/ytdl-core v2.0.0
@mrhansamala/ytdl-core
YouTube fork of @mrhansamala/ytdl-core. This fork is dedicated to fixing bugs and adding features that are not merged into the original repo as soon as possible.
Installation
npm install @mrhansamala/ytdl-core@latestMake sure you're installing the latest version of @mrhansamala/ytdl-core to keep up with the latest fixes.
Usage
const ytdl = require("@mrhansamala/ytdl-core"); import ytdl from '@mrhansamala/ytdl-core'; import * as ytdl from '@mrhansamala/ytdl-core'; import ytdl = require('@mrhansamala/ytdl-core'); - Or you can paste your cookies array into a file and use
fs.readFileSyncto read it.
const ytdl = require("@mrhansamala/ytdl-core");
const fs = require("fs");
const agent = ytdl.createAgent(JSON.parse(fs.readFileSync("cookies.json")));Proxy Support
const ytdl = require("@mrhansamala/ytdl-core");
const agent = ytdl.createProxyAgent({ uri: "my.proxy.server" });
ytdl.getBasicInfo("http://www.youtube.com/watch?v=", { agent });
ytdl.getInfo("http://www.youtube.com/watch?v=", { agent });Use both proxy and cookies:
const ytdl = require("@mrhansamala/ytdl-core");
const agent = ytdl.createProxyAgent({ uri: "my.proxy.server" }, [{ name: "cookie", value: "COOKIE_HERE" }]);
ytdl.getBasicInfo("http://www.youtube.com/watch?v=", { agent });
ytdl.getInfo("http://www.youtube.com/watch?v=", { agent });✍️ Authors
- @mrhansamala - scraped author