vdj 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ import { IService, SongInfo } from '.';
4
4
  export default abstract class Song {
5
5
  readonly service: IService;
6
6
  loop: boolean;
7
+ live: boolean;
8
+ seek: number;
7
9
  abstract readonly type: string;
8
10
  abstract readonly streamURL: string;
9
11
  abstract readonly URL: string;
@@ -11,6 +13,7 @@ export default abstract class Song {
11
13
  readonly title?: string;
12
14
  readonly playlistID?: string | number;
13
15
  constructor(service: IService);
14
- toggleLoop(): boolean;
16
+ abstract getSongInfo(): Promise<SongInfo>;
15
17
  abstract stream(): Promise<ReadableStream> | ReadableStream | null;
18
+ toggleLoop(): boolean;
16
19
  }
package/dist/core/song.js CHANGED
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class Song {
4
4
  constructor(service) {
5
5
  this.loop = false;
6
+ this.live = false;
7
+ this.seek = 0;
6
8
  this.service = service;
7
9
  Object.defineProperty(this, 'service', { value: service });
8
10
  }
9
11
  toggleLoop() {
10
12
  return this.loop = !this.loop;
11
13
  }
14
+ ;
12
15
  }
13
16
  exports.default = Song;
@@ -12,7 +12,6 @@ export default class YouTubeSong extends Song {
12
12
  readonly URL: string;
13
13
  readonly live: boolean;
14
14
  info: SongInfo;
15
- seek: number;
16
15
  logger?: Logger;
17
16
  constructor(service: YouTubeService, video: Video, playlistID?: string, logger?: Logger, seek?: number);
18
17
  getSongInfo(): Promise<SongInfo>;
@@ -60,7 +60,7 @@ class YouTubeSong extends core_1.Song {
60
60
  return 0;
61
61
  }
62
62
  stream() {
63
- const stream = (0, youtube_dl_exec_1.exec)(this.streamURL, {
63
+ const stream = youtube_dl_exec_1.exec(this.streamURL, {
64
64
  output: '-',
65
65
  format: 'bestaudio/best',
66
66
  limitRate: '1M',
@@ -31,13 +31,13 @@ class YoutubedlService {
31
31
  }
32
32
  canFetch(target, logger) {
33
33
  return __awaiter(this, void 0, void 0, function* () {
34
- var res = yield (0, youtube_dl_exec_1.default)(target, { dumpSingleJson: true }, {});
34
+ var res = yield youtube_dl_exec_1.default(target, { dumpSingleJson: true }, {});
35
35
  return !!res;
36
36
  });
37
37
  }
38
38
  getSongInfo(url, logger) {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
- var res = yield (0, youtube_dl_exec_1.default)(url, { dumpSingleJson: true, noCheckCertificates: true, addMetadata: true }, {});
40
+ var res = yield youtube_dl_exec_1.default(url, { dumpSingleJson: true, noCheckCertificates: true, addMetadata: true }, {});
41
41
  return {
42
42
  full: true,
43
43
  metadataType: "youtubedl",
@@ -33,7 +33,7 @@ class YoutubedlSong extends core_1.Song {
33
33
  });
34
34
  }
35
35
  stream() {
36
- const stream = (0, youtube_dl_exec_1.exec)(this.streamURL, {
36
+ const stream = youtube_dl_exec_1.exec(this.streamURL, {
37
37
  output: '-',
38
38
  format: 'bestaudio/best',
39
39
  limitRate: '1M',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vdj",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -20,6 +20,6 @@
20
20
  "got": "^11.8.0",
21
21
  "simple-youtube-api": "^5.2.1",
22
22
  "youtube-dl-exec": "^2.2.3",
23
- "ytdl-core": "^4.11.2"
23
+ "ytdl-core": "^4.11.4"
24
24
  }
25
25
  }
package/src/core/song.ts CHANGED
@@ -5,6 +5,8 @@ export default abstract class Song {
5
5
  public readonly service: IService;
6
6
 
7
7
  public loop: boolean = false;
8
+ public live = false;
9
+ public seek = 0;
8
10
  public abstract readonly type: string;
9
11
  public abstract readonly streamURL: string;
10
12
  public abstract readonly URL: string;
@@ -17,9 +19,11 @@ export default abstract class Song {
17
19
  Object.defineProperty(this, 'service', { value: service });
18
20
  }
19
21
 
20
- public toggleLoop(): boolean {
21
- return this.loop = !this.loop;
22
- }
22
+ public abstract getSongInfo(): Promise<SongInfo>;
23
23
 
24
24
  public abstract stream(): Promise<ReadableStream> | ReadableStream | null;
25
+
26
+ public toggleLoop(): boolean {
27
+ return this.loop = !this.loop;
28
+ };
25
29
  }
@@ -14,7 +14,6 @@ export default class YouTubeSong extends Song {
14
14
  public readonly URL: string;
15
15
  public readonly live: boolean;
16
16
  public info: SongInfo;
17
- public seek: number;
18
17
  public logger?: Logger;
19
18
 
20
19
  constructor(service: YouTubeService, video: Video, playlistID?: string, logger?: Logger, seek: number = 0) {
package/test/test.js CHANGED
@@ -154,8 +154,10 @@ describe("Playlist", function () {
154
154
  metadataType: "youtubedl",
155
155
  url: input[0],
156
156
  },
157
+ live: false,
157
158
  logger: undefined,
158
159
  loop: false,
160
+ seek: 0,
159
161
  service: playlist.services[0],
160
162
  streamURL: input[0],
161
163
  type: "youtubedl",