@@ -71,19 +71,19 @@ async function getVideo(obj) {
7171 . then ( request => request . text ( ) )
7272 . catch ( ( ) => { } ) ;
7373
74- if ( ! req ) return { error : 'ErrorCouldntFetch ' } ;
74+ if ( ! req ) return { error : 'fetch.fail ' } ;
7575
7676 let json ;
7777 try {
7878 json = JSON . parse ( req ) ;
79- } catch { return { error : 'ErrorEmptyDownload ' } ; }
79+ } catch { return { error : 'fetch.empty ' } ; }
8080
8181 const videoData = getQuality ( json . sources , obj . quality ) ;
8282 if ( videoData == null ) {
83- return { error : 'ErrorCouldntFetch ' } ;
83+ return { error : 'fetch.empty ' } ;
8484 }
8585 if ( ! videoData . type . includes ( 'mp4' ) ) {
86- return { error : 'ErrorCouldntFetch ' } ;
86+ return { error : 'fetch.empty ' } ;
8787 }
8888
8989 let fileMetadata = {
@@ -115,14 +115,14 @@ async function getMusic(obj) {
115115 . then ( request => request . text ( ) )
116116 . catch ( ( ) => { } ) ;
117117
118- if ( ! req ) return { error : 'ErrorCouldntFetch ' } ;
118+ if ( ! req ) return { error : 'fetch.fail ' } ;
119119
120120 const titleMatch = req . match ( / " n a m e " \s * : \s * " ( [ ^ " ] + ) " / ) ;
121121 const artistMatch = req . match ( / " a r t i s t " \s * : \s * " ( [ ^ " ] + ) " / ) ;
122122 const urlMatch = req . match ( / " f i l e n a m e " \s * : \s * " ( [ ^ " ] + ) " / ) ;
123123
124124 if ( ! titleMatch || ! artistMatch || ! urlMatch ) {
125- return { error : 'ErrorCouldntFetch ' } ;
125+ return { error : 'fetch.empty ' } ;
126126 }
127127
128128 const title = titleMatch [ 1 ] ;
@@ -153,5 +153,5 @@ export default function(obj) {
153153 if ( obj . type == 'audio' ) {
154154 return getMusic ( obj ) ;
155155 }
156- return { error : 'ErrorUnsupported ' } ;
156+ return { error : 'link.unsupported ' } ;
157157}
0 commit comments