Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Published branch "master"
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzeng0 committed Aug 5, 2023
1 parent 7d0a7d3 commit aa7b688
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"main": "index.js",
"types": "index.d.ts",
"name": "yasha",
"version": "3.0.2",
"version": "3.1.0",
"dependencies": {
"@discordjs/voice": "github:davidzeng0/voice#dist",
"discord.js": "^14.11.0",
Expand Down
12 changes: 6 additions & 6 deletions src/api/File.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const {Track, TrackStream, TrackStreams} = require('../Track');
const {UnplayableError} = require('../Error');
const {InternalError} = require('js-common');
const {UnsupportedError} = require('js-common');

class FileStream extends TrackStream{
constructor(url, isfile){
Expand Down Expand Up @@ -34,11 +34,11 @@ class FileTrack extends Track{
}

async getStreams(){
throw new UnplayableError('Stream expired or not available');
throw new UnplayableError({simpleMessage: 'Stream expired or not available'});
}

async fetch(){
throw new InternalError('Cannot fetch on a FileTrack');
throw new UnsupportedError('Cannot fetch on a FileTrack');
}

get url(){
Expand All @@ -53,7 +53,7 @@ class File{
* @returns {Promise<never>}
*/
async get(url) {
throw new Error('Unsupported');
throw new UnsupportedError();
}

/**
Expand All @@ -62,7 +62,7 @@ class File{
* @returns {Promise<never>}
*/
async get_streams(url) {
throw new Error('Unsupported');
throw new UnsupportedError();
}

/**
Expand All @@ -72,7 +72,7 @@ class File{
* @returns {Promise<never>}
*/
async playlist(url, length) {
throw new Error('Unsupported');
throw new UnsupportedError();
}

create(url, isfile){
Expand Down
6 changes: 3 additions & 3 deletions src/api/Youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function check_playable(st){
return;
case 'error':
if(reason == 'Video unavailable')
throw new NotFoundError('Video not found');
throw new NotFoundError({simpleMessage: 'Video not found'});
case 'unplayable':
throw new UnplayableError(reason || status);
case 'login_required':
Expand Down Expand Up @@ -383,7 +383,7 @@ const api = new class YoutubeAPI{
var data = await this.api_request('browse', {continuation: gen_playlist_continuation(id, start)});

if(!data.sidebar)
throw new NotFoundError('Playlist not found');
throw new NotFoundError({simpleMessage: 'Playlist not found'});
if(!data.onResponseReceivedActions)
return results;
try{
Expand Down Expand Up @@ -610,7 +610,7 @@ const api = new class YoutubeAPI{
return result;
}

throw new UnplayableError('Could not find streams for this track');
throw new UnplayableError({simpleMessage: 'Could not fetch streams for this track'});
}
}

Expand Down

0 comments on commit aa7b688

Please sign in to comment.