@@ -87,76 +87,65 @@ export const scrappers = {
87
87
domain : 'streamcloud.eu' ,
88
88
runner : 'url' ,
89
89
exec : async ( { url, runners} ) => {
90
- let retry = false ;
91
- const s = async ( ) => {
92
- const dataRegex = new RegExp ( / \/ ( [ ^ \/ . ] + ) \/ ( .* ) \. [ ^ . ] + / , 'i' ) ;
93
- const data = dataRegex . exec ( url ) ;
94
- if ( data === null || data . length <= 2 )
95
- return null ;
96
- const id = data [ 1 ] ;
97
- const name = data [ 2 ] ;
98
- if ( ! id || ! name )
99
- return null ;
90
+ const dataRegex = new RegExp ( / \/ ( [ ^ \/ . ] + ) \/ ( .* ) \. [ ^ . ] + / , 'i' ) ;
91
+ const data = dataRegex . exec ( url ) ;
92
+ if ( data === null || data . length <= 2 )
93
+ return null ;
94
+ const id = data [ 1 ] ;
95
+ const name = data [ 2 ] ;
96
+ if ( ! id || ! name )
97
+ return null ;
100
98
101
- const htmlRunner = runners . getByType ( 'html' ) ;
102
- if ( ! ( htmlRunner instanceof Runner ) )
103
- return null ;
104
- const html = await htmlRunner . run ( {
105
- url,
106
- scrapper : ( { html : _html } ) => removeNewline ( _html ) ,
107
- options : {
108
- axios : {
109
- config : {
110
- method : 'post' ,
111
- headers : {
112
- 'Referer' : url ,
113
- 'Content-Type' : 'application/x-www-form-urlencoded' ,
114
- 'Cache-Control' : 'no-cache' ,
115
- 'Connection' : 'Keep-Alive'
116
- } ,
117
- data : queryString . stringify ( {
118
- fname : name ,
119
- hash : '' ,
120
- id,
121
- op : 'download1' ,
122
- referer : '' ,
123
- usr_login : '' ,
124
- imhuman : 'Weiter+zum+Video'
125
- } )
126
- }
99
+ const htmlRunner = runners . getByType ( 'html' ) ;
100
+ if ( ! ( htmlRunner instanceof Runner ) )
101
+ return null ;
102
+ const html = await htmlRunner . run ( {
103
+ url,
104
+ scrapper : ( { html : _html } ) => removeNewline ( _html ) ,
105
+ options : {
106
+ axios : {
107
+ config : {
108
+ method : 'post' ,
109
+ headers : {
110
+ 'Referer' : url ,
111
+ 'Content-Type' : 'application/x-www-form-urlencoded' ,
112
+ 'Cache-Control' : 'no-cache' ,
113
+ 'Connection' : 'Keep-Alive'
114
+ } ,
115
+ data : queryString . stringify ( {
116
+ fname : name ,
117
+ hash : '' ,
118
+ id,
119
+ op : 'download1' ,
120
+ referer : '' ,
121
+ usr_login : '' ,
122
+ imhuman : 'Weiter+zum+Video'
123
+ } )
127
124
}
128
125
}
129
- } ) as string ;
130
-
131
- const configRegex = new RegExp ( / j w p l a y e r \( " [ ^ " ] + " \) .s e t u p \( { ( .* ?) } \) ; / , 'i' ) ;
132
- const propRegex = new RegExp ( / ( \w + ) \s * : \s * " ? ( .* ?) " ? \s * , / , 'ig' ) ;
133
- const tabRegex = / (?: \\ t | \t ) / g;
134
- const configData = configRegex . exec ( html ) ;
135
- if ( ! configData || configData . length < 1 ) {
136
- retry = true ;
137
- return null ;
138
126
}
139
- const configRAW = configData [ 1 ] . replace ( tabRegex , '' ) ;
140
- const propData = propRegex . execAll ( configRAW ) ;
141
- const props : any = { } ;
142
- for ( const e of propData )
143
- if ( e && e . length >= 2 )
144
- props [ e [ 1 ] ] = e [ 2 ] ;
145
- return new SourceInfo ( {
146
- poster : props . image ,
147
- title : name ,
148
- source : new Source ( {
149
- url : props . file ,
150
- resolution : props . width + 'x' + props . height
151
- } )
152
- } ) ;
153
- } ;
154
- let info = await s ( ) ;
155
- if ( retry ) {
156
- await sleep ( 10000 ) ;
157
- info = await s ( ) ;
158
- }
159
- return info ;
127
+ } ) as string ;
128
+
129
+ const configRegex = new RegExp ( / j w p l a y e r \( " [ ^ " ] + " \) .s e t u p \( { ( .* ?) } \) ; / , 'i' ) ;
130
+ const propRegex = new RegExp ( / ( \w + ) \s * : \s * " ? ( .* ?) " ? \s * , / , 'ig' ) ;
131
+ const tabRegex = / (?: \\ t | \t ) / g;
132
+ const configData = configRegex . exec ( html ) ;
133
+ if ( ! configData || configData . length < 1 )
134
+ return null ;
135
+ const configRAW = configData [ 1 ] . replace ( tabRegex , '' ) ;
136
+ const propData = propRegex . execAll ( configRAW ) ;
137
+ const props : any = { } ;
138
+ for ( const e of propData )
139
+ if ( e && e . length >= 2 )
140
+ props [ e [ 1 ] ] = e [ 2 ] ;
141
+ return new SourceInfo ( {
142
+ poster : props . image ,
143
+ title : name ,
144
+ source : new Source ( {
145
+ url : props . file ,
146
+ resolution : props . width + 'x' + props . height
147
+ } )
148
+ } ) ;
160
149
}
161
150
} ) ,
162
151
new SourceScrapper ( {
0 commit comments