File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
api/src/processing/services Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -15,24 +15,27 @@ async function findClientID() {
1515 return cachedID . id ;
1616 }
1717
18- const scripts = sc . matchAll ( / < s c r i p t .+ s r c = " ( .+ ) " > / g) ;
18+ let clientid = sc . match ( / " h y d r a t a b l e " \s * : \s * " a p i C l i e n t " \s * , \s * " d a t a " \s * : \s * \{ \s * " i d " \s * : \s * " ( [ ^ " ] + ) " / ) ?. [ 1 ] ;
19+ if ( ! clientid ) {
20+ const scripts = sc . matchAll ( / < s c r i p t .+ s r c = " ( .+ ) " > / g) ;
1921
20- let clientid ;
21- for ( let script of scripts ) {
22- const url = script [ 1 ] ;
22+ for ( let script of scripts ) {
23+ const url = script [ 1 ] ;
2324
24- if ( ! url ?. startsWith ( 'https://a-v2.sndcdn.com/' ) ) {
25- return ;
26- }
25+ if ( ! url ?. startsWith ( 'https://a-v2.sndcdn.com/' ) ) {
26+ return ;
27+ }
2728
28- const scrf = await fetch ( url ) . then ( r => r . text ( ) ) . catch ( ( ) => { } ) ;
29- const id = scrf . match ( / \( " c l i e n t _ i d = [ A - Z a - z 0 - 9 ] { 32 } " \) / ) ;
29+ const scrf = await fetch ( url ) . then ( r => r . text ( ) ) . catch ( ( ) => { } ) ;
30+ const id = scrf . match ( / , c l i e n t _ i d : " ( [ A - Z a - z 0 - 9 ] { 32 } ) " , / ) ;
3031
31- if ( id && typeof id [ 0 ] === 'string' ) {
32- clientid = id [ 0 ] . match ( / [ A - Z a - z 0 - 9 ] { 32 } / ) [ 0 ] ;
33- break ;
32+ if ( id && id . length >= 2 ) {
33+ clientid = id [ 1 ] ;
34+ break ;
35+ }
3436 }
3537 }
38+
3639 cachedID . version = scVersion ;
3740 cachedID . id = clientid ;
3841
You can’t perform that action at this time.
0 commit comments