yt-dlp support

This commit is contained in:
synt-xerror
2026-03-12 01:22:29 -03:00
parent b96332e618
commit 240c392fad
5435 changed files with 991931 additions and 137 deletions

33
node_modules/buffer-indexof-polyfill/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,33 @@
{
"rules": {
"indent": [
2,
4,
{ "SwitchCase": 1 }
],
"quotes": [
2,
"double"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-console": [
0
],
"no-trailing-spaces":
[
2
]
},
"env": {
"node": true,
"mocha": true
},
"extends": "eslint:recommended"
}

17
node_modules/buffer-indexof-polyfill/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,17 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "1.0"
- "1.8"
- "2.0"
- "2.5"
- "3.0"
- "3.3"
- "4.0"
- "4.2"
- "5.0"
- "6"
sudo: false
script:
- "npm run lint && npm test"

22
node_modules/buffer-indexof-polyfill/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Sarosia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

33
node_modules/buffer-indexof-polyfill/README.md generated vendored Normal file
View File

@@ -0,0 +1,33 @@
# buffer-indexof-polyfill
[![Build Status][travis-image]][travis-url]
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
This is a polyfill for [`Buffer#indexOf`](https://nodejs.org/api/buffer.html#buffer_buf_indexof_value_byteoffset) and Buffer#lastIndexOf introduced in NodeJS 4.0.
## Example
```js
require("buffer-indexof-polyfill");
new Buffer("buffer").indexOf("uff") // return 1
new Buffer("buffer").indexOf("abc") // return -1
```
## Installation
```bash
npm install buffer-indexof-polyfill
```
## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/buffer-indexof-polyfill.svg
[npm-url]: https://npmjs.org/package/buffer-indexof-polyfill
[downloads-image]: https://img.shields.io/npm/dm/buffer-indexof-polyfill.svg
[downloads-url]: https://npmjs.org/package/buffer-indexof-polyfill
[travis-image]: https://travis-ci.org/sarosia/buffer-indexof-polyfill.svg?branch=master
[travis-url]: https://travis-ci.org/sarosia/buffer-indexof-polyfill

73
node_modules/buffer-indexof-polyfill/index.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
"use strict";
var initBuffer = require("./init-buffer");
if (!Buffer.prototype.indexOf) {
Buffer.prototype.indexOf = function (value, offset) {
offset = offset || 0;
// Always wrap the input as a Buffer so that this method will support any
// data type such as array octet, string or buffer.
if (typeof value === "string" || value instanceof String) {
value = initBuffer(value);
} else if (typeof value === "number" || value instanceof Number) {
value = initBuffer([ value ]);
}
var len = value.length;
for (var i = offset; i <= this.length - len; i++) {
var mismatch = false;
for (var j = 0; j < len; j++) {
if (this[i + j] != value[j]) {
mismatch = true;
break;
}
}
if (!mismatch) {
return i;
}
}
return -1;
};
}
function bufferLastIndexOf (value, offset) {
// Always wrap the input as a Buffer so that this method will support any
// data type such as array octet, string or buffer.
if (typeof value === "string" || value instanceof String) {
value = initBuffer(value);
} else if (typeof value === "number" || value instanceof Number) {
value = initBuffer([ value ]);
}
var len = value.length;
offset = offset || this.length - len;
for (var i = offset; i >= 0; i--) {
var mismatch = false;
for (var j = 0; j < len; j++) {
if (this[i + j] != value[j]) {
mismatch = true;
break;
}
}
if (!mismatch) {
return i;
}
}
return -1;
}
if (Buffer.prototype.lastIndexOf) {
// check Buffer#lastIndexOf is usable: https://github.com/nodejs/node/issues/4604
if (initBuffer("ABC").lastIndexOf ("ABC") === -1)
Buffer.prototype.lastIndexOf = bufferLastIndexOf;
} else {
Buffer.prototype.lastIndexOf = bufferLastIndexOf;
}

8
node_modules/buffer-indexof-polyfill/init-buffer.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
module.exports = function initBuffer(val) {
// assume old version
var nodeVersion = process && process.version ? process.version : "v5.0.0";
var major = nodeVersion.split(".")[0].replace("v", "");
return major < 6
? new Buffer(val)
: Buffer.from(val);
};

34
node_modules/buffer-indexof-polyfill/package.json generated vendored Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "buffer-indexof-polyfill",
"version": "1.0.2",
"description": "This is a polyfill for Buffer#indexOf introduced in NodeJS 4.0.",
"main": "index.js",
"scripts": {
"test": "mocha",
"lint": "eslint .",
"fix": "eslint . --fix"
},
"author": "https://github.com/sarosia",
"license": "MIT",
"engines": {
"node": ">=0.10"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sarosia/buffer-indexof-polyfill.git"
},
"devDependencies": {
"chai": "^3.3.0",
"eslint": "^1.10.3",
"mocha": "^2.3.3"
},
"keywords": [
"buffer",
"indexof",
"polyfill"
],
"bugs": {
"url": "https://github.com/sarosia/buffer-indexof-polyfill/issues"
},
"homepage": "https://github.com/sarosia/buffer-indexof-polyfill#readme"
}

128
node_modules/buffer-indexof-polyfill/test/indexof.js generated vendored Normal file
View File

@@ -0,0 +1,128 @@
"use strict";
var expect = require("chai").expect;
var initBuffer = require("../init-buffer");
require("../index.js");
describe("Buffer#indexOf", function () {
it("Buffer as value", function () {
var buffer = initBuffer("ABC");
expect(buffer.indexOf(initBuffer("ABC"))).to.be.equal(0);
expect(buffer.indexOf(initBuffer("AB"))).to.be.equal(0);
expect(buffer.indexOf(initBuffer("BC"))).to.be.equal(1);
expect(buffer.indexOf(initBuffer("C"))).to.be.equal(2);
expect(buffer.indexOf(initBuffer("CC"))).to.be.equal(-1);
expect(buffer.indexOf(initBuffer("CA"))).to.be.equal(-1);
expect(buffer.indexOf(initBuffer("ABC"), 1)).to.be.equal(-1);
expect(buffer.indexOf(initBuffer("AB"), 1)).to.be.equal(-1);
expect(buffer.indexOf(initBuffer("BC"), 1)).to.be.equal(1);
expect(buffer.indexOf(initBuffer("C"), 1)).to.be.equal(2);
expect(buffer.indexOf(initBuffer("CC"), 1)).to.be.equal(-1);
expect(buffer.indexOf(initBuffer("CA"), 1)).to.be.equal(-1);
});
it("String as value", function () {
var buffer = initBuffer("ABC");
expect(buffer.indexOf("ABC")).to.be.equal(0);
expect(buffer.indexOf("AB")).to.be.equal(0);
expect(buffer.indexOf("BC")).to.be.equal(1);
expect(buffer.indexOf("C")).to.be.equal(2);
expect(buffer.indexOf("CC")).to.be.equal(-1);
expect(buffer.indexOf("CA")).to.be.equal(-1);
expect(buffer.indexOf("ABC", 1)).to.be.equal(-1);
expect(buffer.indexOf("AB", 1)).to.be.equal(-1);
expect(buffer.indexOf("BC", 1)).to.be.equal(1);
expect(buffer.indexOf("C", 1)).to.be.equal(2);
expect(buffer.indexOf("CC", 1)).to.be.equal(-1);
expect(buffer.indexOf("CA", 1)).to.be.equal(-1);
});
it("Number as value", function () {
var buffer = initBuffer([ 1, 2, 3 ]);
expect(buffer.indexOf(1)).to.be.equal(0);
expect(buffer.indexOf(2)).to.be.equal(1);
expect(buffer.indexOf(3)).to.be.equal(2);
expect(buffer.indexOf(4)).to.be.equal(-1);
expect(buffer.indexOf(1, 1)).to.be.equal(-1);
expect(buffer.indexOf(2, 1)).to.be.equal(1);
expect(buffer.indexOf(3, 1)).to.be.equal(2);
expect(buffer.indexOf(4, 1)).to.be.equal(-1);
});
});
describe("Buffer#lastIndexOf", function () {
it("Buffer as value", function () {
var buffer = initBuffer("ABCABC");
expect(buffer.lastIndexOf(initBuffer("ABC"))).to.be.equal(3);
expect(buffer.lastIndexOf(initBuffer("AB"))).to.be.equal(3);
expect(buffer.lastIndexOf(initBuffer("BC"))).to.be.equal(4);
expect(buffer.lastIndexOf(initBuffer("C"))).to.be.equal(5);
expect(buffer.lastIndexOf(initBuffer("CC"))).to.be.equal(-1);
expect(buffer.lastIndexOf(initBuffer("CA"))).to.be.equal(2);
expect(buffer.lastIndexOf(initBuffer("ABC"), 1)).to.be.equal(0);
expect(buffer.lastIndexOf(initBuffer("AB"), 1)).to.be.equal(0);
expect(buffer.lastIndexOf(initBuffer("BC"), 1)).to.be.equal(1);
expect(buffer.lastIndexOf(initBuffer("C"), 1)).to.be.equal(-1);
expect(buffer.lastIndexOf(initBuffer("CC"), 1)).to.be.equal(-1);
expect(buffer.lastIndexOf(initBuffer("CA"), 1)).to.be.equal(-1);
});
it("String as value", function () {
var buffer = initBuffer("ABCABC");
expect(buffer.lastIndexOf("ABC")).to.be.equal(3);
expect(buffer.lastIndexOf("AB")).to.be.equal(3);
expect(buffer.lastIndexOf("BC")).to.be.equal(4);
expect(buffer.lastIndexOf("C")).to.be.equal(5);
expect(buffer.lastIndexOf("CC")).to.be.equal(-1);
expect(buffer.lastIndexOf("CA")).to.be.equal(2);
expect(buffer.lastIndexOf("ABC", 1)).to.be.equal(0);
expect(buffer.lastIndexOf("AB", 1)).to.be.equal(0);
expect(buffer.lastIndexOf("BC", 1)).to.be.equal(1);
expect(buffer.lastIndexOf("C", 1)).to.be.equal(-1);
expect(buffer.lastIndexOf("CC", 1)).to.be.equal(-1);
expect(buffer.lastIndexOf("CA", 1)).to.be.equal(-1);
// make sure it works predictable
buffer = buffer.toString();
expect(buffer.lastIndexOf("ABC")).to.be.equal(3);
expect(buffer.lastIndexOf("AB")).to.be.equal(3);
expect(buffer.lastIndexOf("BC")).to.be.equal(4);
expect(buffer.lastIndexOf("C")).to.be.equal(5);
expect(buffer.lastIndexOf("CC")).to.be.equal(-1);
expect(buffer.lastIndexOf("CA")).to.be.equal(2);
expect(buffer.lastIndexOf("ABC", 1)).to.be.equal(0);
expect(buffer.lastIndexOf("AB", 1)).to.be.equal(0);
expect(buffer.lastIndexOf("BC", 1)).to.be.equal(1);
expect(buffer.lastIndexOf("C", 1)).to.be.equal(-1);
expect(buffer.lastIndexOf("CC", 1)).to.be.equal(-1);
expect(buffer.lastIndexOf("CA", 1)).to.be.equal(-1);
});
it("Number as value", function () {
var buffer = initBuffer([ 1, 2, 3, 1, 2, 3]);
expect(buffer.lastIndexOf(1)).to.be.equal(3);
expect(buffer.lastIndexOf(2)).to.be.equal(4);
expect(buffer.lastIndexOf(3)).to.be.equal(5);
expect(buffer.lastIndexOf(4)).to.be.equal(-1);
expect(buffer.lastIndexOf(1, 1)).to.be.equal(0);
expect(buffer.lastIndexOf(2, 1)).to.be.equal(1);
expect(buffer.lastIndexOf(3, 1)).to.be.equal(-1);
expect(buffer.lastIndexOf(4, 1)).to.be.equal(-1);
});
});