File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2
2
/* eslint-disable @typescript-eslint/no-unsafe-return */
3
3
4
4
import { hookNative } from './anti-detection'
5
- import { console } from './utils'
5
+ import { console , useTimeout } from './utils'
6
6
7
7
type FileType = 'img' | 'mp3' | 'midi'
8
8
@@ -97,7 +97,17 @@ const getApiAuth = async (type: FileType, index: number): Promise<string> => {
97
97
}
98
98
}
99
99
100
- return magic
100
+ try {
101
+ return await useTimeout ( magic , 5 * 1000 /* 5s */ )
102
+ } catch {
103
+ console . error ( type , 'token timeout' )
104
+ switch ( type ) {
105
+ // try hard-coded tokens
106
+ case 'img' : return '8c022bdef45341074ce876ae57a48f64b86cdcf5'
107
+ case 'midi' : return '38fb9efaae51b0c83b5bb5791a698b48292129e7'
108
+ case 'mp3' : return '63794e5461e4cfa046edfbdddfccc1ac16daffd2'
109
+ }
110
+ }
101
111
}
102
112
103
113
export const getFileUrl = async ( id : number , type : FileType , index = 0 ) : Promise < string > => {
You can’t perform that action at this time.
0 commit comments