@@ -71,19 +71,19 @@ async function getVideo(obj) {
71
71
. then ( request => request . text ( ) )
72
72
. catch ( ( ) => { } ) ;
73
73
74
- if ( ! req ) return { error : 'ErrorCouldntFetch ' } ;
74
+ if ( ! req ) return { error : 'fetch.fail ' } ;
75
75
76
76
let json ;
77
77
try {
78
78
json = JSON . parse ( req ) ;
79
- } catch { return { error : 'ErrorEmptyDownload ' } ; }
79
+ } catch { return { error : 'fetch.empty ' } ; }
80
80
81
81
const videoData = getQuality ( json . sources , obj . quality ) ;
82
82
if ( videoData == null ) {
83
- return { error : 'ErrorCouldntFetch ' } ;
83
+ return { error : 'fetch.empty ' } ;
84
84
}
85
85
if ( ! videoData . type . includes ( 'mp4' ) ) {
86
- return { error : 'ErrorCouldntFetch ' } ;
86
+ return { error : 'fetch.empty ' } ;
87
87
}
88
88
89
89
let fileMetadata = {
@@ -115,14 +115,14 @@ async function getMusic(obj) {
115
115
. then ( request => request . text ( ) )
116
116
. catch ( ( ) => { } ) ;
117
117
118
- if ( ! req ) return { error : 'ErrorCouldntFetch ' } ;
118
+ if ( ! req ) return { error : 'fetch.fail ' } ;
119
119
120
120
const titleMatch = req . match ( / " n a m e " \s * : \s * " ( [ ^ " ] + ) " / ) ;
121
121
const artistMatch = req . match ( / " a r t i s t " \s * : \s * " ( [ ^ " ] + ) " / ) ;
122
122
const urlMatch = req . match ( / " f i l e n a m e " \s * : \s * " ( [ ^ " ] + ) " / ) ;
123
123
124
124
if ( ! titleMatch || ! artistMatch || ! urlMatch ) {
125
- return { error : 'ErrorCouldntFetch ' } ;
125
+ return { error : 'fetch.empty ' } ;
126
126
}
127
127
128
128
const title = titleMatch [ 1 ] ;
@@ -153,5 +153,5 @@ export default function(obj) {
153
153
if ( obj . type == 'audio' ) {
154
154
return getMusic ( obj ) ;
155
155
}
156
- return { error : 'ErrorUnsupported ' } ;
156
+ return { error : 'link.unsupported ' } ;
157
157
}
0 commit comments