first commit
This commit is contained in:
19
lib/event.js
Normal file
19
lib/event.js
Normal file
@@ -0,0 +1,19 @@
|
||||
var Transform = require('stream').Transform;
|
||||
|
||||
class SSE extends Transform{
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
if (!(this instanceof SSE))
|
||||
return new SSE(options);
|
||||
|
||||
options = options || {};
|
||||
Transform.call(this, options);
|
||||
}
|
||||
_transform(data, enc, cb) {
|
||||
this.push('data: ' + data.toString('utf8') + '\n\n');
|
||||
cb();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SSE;
|
||||
5
lib/logger.js
Normal file
5
lib/logger.js
Normal file
@@ -0,0 +1,5 @@
|
||||
const logger = (proto, args) => {
|
||||
console.log(`[${proto}] ${args}`)
|
||||
}
|
||||
|
||||
module.exports = logger
|
||||
BIN
lib/yt-dlp.exe
Normal file
BIN
lib/yt-dlp.exe
Normal file
Binary file not shown.
24
lib/yt-dlpCaller.js
Normal file
24
lib/yt-dlpCaller.js
Normal file
@@ -0,0 +1,24 @@
|
||||
const Readable = require('stream').Readable;
|
||||
|
||||
class Subscription extends Readable{
|
||||
constructor(options) {
|
||||
super();
|
||||
if (!(this instanceof Subscription))
|
||||
return new Subscription(options);
|
||||
|
||||
options = options || {};
|
||||
Readable.call(this, options);
|
||||
|
||||
this.value = 0;
|
||||
}
|
||||
_read() {
|
||||
while(this.value <= 100){
|
||||
this.push(String(this.value++));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
exports.subscribe = function(event, options){
|
||||
return new Subscription(options);
|
||||
}
|
||||
Reference in New Issue
Block a user