react-native-consumet 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/consumet/HttpRequestModule.kt +88 -33
- package/android/src/main/java/com/consumet/WebViewTask.kt +18 -3
- package/ios/Consumet.mm +172 -72
- package/lib/commonjs/NativeConsumet.ts +11 -5
- package/lib/commonjs/extension-registry.json +6 -6
- package/lib/commonjs/extension-registry.json.sig +1 -1
- package/lib/commonjs/extractors/kwik.js +28 -29
- package/lib/commonjs/extractors/kwik.js.map +1 -1
- package/lib/commonjs/index.js +18 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/types.js +6 -0
- package/lib/commonjs/models/types.js.map +1 -1
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +12 -13
- package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/commonjs/providers/manga/asurascans.js +160 -96
- package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
- package/lib/commonjs/providers/manga/flamescans.js +173 -91
- package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
- package/lib/commonjs/providers/manga/index.js +1 -15
- package/lib/commonjs/providers/manga/index.js.map +1 -1
- package/lib/commonjs/providers/manga/mangadex.js +234 -227
- package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
- package/lib/commonjs/providers/manga/mangahere.js +279 -135
- package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
- package/lib/commonjs/providers/manga/mangakakalot.js +206 -107
- package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
- package/lib/commonjs/providers/manga/mangapill.js +126 -38
- package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
- package/lib/commonjs/providers/meta/anilist.js +41 -12
- package/lib/commonjs/providers/meta/anilist.js.map +1 -1
- package/lib/commonjs/utils/index.js +19 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/manga.js +60 -0
- package/lib/commonjs/utils/manga.js.map +1 -0
- package/lib/module/NativeConsumet.ts +11 -5
- package/lib/module/extension-registry.json +6 -6
- package/lib/module/extension-registry.json.sig +1 -1
- package/lib/module/extractors/kwik.js +28 -29
- package/lib/module/extractors/kwik.js.map +1 -1
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/types.js +9 -0
- package/lib/module/models/types.js.map +1 -1
- package/lib/module/providers/anime/animepahe/create-animepahe.js +12 -13
- package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
- package/lib/module/providers/manga/asurascans.js +161 -96
- package/lib/module/providers/manga/asurascans.js.map +1 -1
- package/lib/module/providers/manga/flamescans.js +174 -91
- package/lib/module/providers/manga/flamescans.js.map +1 -1
- package/lib/module/providers/manga/index.js +1 -15
- package/lib/module/providers/manga/index.js.map +1 -1
- package/lib/module/providers/manga/mangadex.js +236 -228
- package/lib/module/providers/manga/mangadex.js.map +1 -1
- package/lib/module/providers/manga/mangahere.js +276 -132
- package/lib/module/providers/manga/mangahere.js.map +1 -1
- package/lib/module/providers/manga/mangakakalot.js +207 -107
- package/lib/module/providers/manga/mangakakalot.js.map +1 -1
- package/lib/module/providers/manga/mangapill.js +128 -39
- package/lib/module/providers/manga/mangapill.js.map +1 -1
- package/lib/module/providers/meta/anilist.js +41 -12
- package/lib/module/providers/meta/anilist.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/manga.js +54 -0
- package/lib/module/utils/manga.js.map +1 -0
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts +11 -5
- package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts +1 -1
- package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/models/types.d.ts +38 -5
- package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +14 -4
- package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +18 -3
- package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +22 -5
- package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +15 -3
- package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +26 -4
- package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +16 -2
- package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/manga.d.ts +19 -0
- package/lib/typescript/commonjs/src/utils/manga.d.ts.map +1 -0
- package/lib/typescript/module/src/NativeConsumet.d.ts +11 -5
- package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts +1 -1
- package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/models/types.d.ts +38 -5
- package/lib/typescript/module/src/models/types.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts +14 -4
- package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts +18 -3
- package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/index.d.ts +0 -14
- package/lib/typescript/module/src/providers/manga/index.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts +22 -5
- package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts +15 -3
- package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +26 -4
- package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts +16 -2
- package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
- package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +1 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/manga.d.ts +19 -0
- package/lib/typescript/module/src/utils/manga.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/NativeConsumet.ts +11 -5
- package/src/extension-registry.json +6 -6
- package/src/extension-registry.json.sig +1 -1
- package/src/extractors/kwik.ts +30 -43
- package/src/index.tsx +6 -0
- package/src/models/types.ts +38 -3
- package/src/providers/anime/animepahe/create-animepahe.ts +15 -14
- package/src/providers/manga/asurascans.ts +200 -135
- package/src/providers/manga/flamescans.ts +221 -118
- package/src/providers/manga/index.ts +0 -14
- package/src/providers/manga/mangadex.ts +335 -282
- package/src/providers/manga/mangahere.ts +309 -156
- package/src/providers/manga/mangakakalot.ts +249 -152
- package/src/providers/manga/mangapill.ts +163 -64
- package/src/providers/meta/anilist.ts +50 -14
- package/src/utils/index.ts +1 -0
- package/src/utils/manga.ts +58 -0
- package/lib/commonjs/providers/manga/brmangas.js +0 -110
- package/lib/commonjs/providers/manga/brmangas.js.map +0 -1
- package/lib/commonjs/providers/manga/comick.js +0 -154
- package/lib/commonjs/providers/manga/comick.js.map +0 -1
- package/lib/commonjs/providers/manga/mangahost.js +0 -113
- package/lib/commonjs/providers/manga/mangahost.js.map +0 -1
- package/lib/commonjs/providers/manga/mangapark.js +0 -97
- package/lib/commonjs/providers/manga/mangapark.js.map +0 -1
- package/lib/commonjs/providers/manga/mangareader.js +0 -106
- package/lib/commonjs/providers/manga/mangareader.js.map +0 -1
- package/lib/commonjs/providers/manga/mangasee123.js +0 -161
- package/lib/commonjs/providers/manga/mangasee123.js.map +0 -1
- package/lib/commonjs/providers/manga/readmanga.js +0 -269
- package/lib/commonjs/providers/manga/readmanga.js.map +0 -1
- package/lib/commonjs/providers/manga/vyvymanga.js +0 -166
- package/lib/commonjs/providers/manga/vyvymanga.js.map +0 -1
- package/lib/module/providers/manga/brmangas.js +0 -105
- package/lib/module/providers/manga/brmangas.js.map +0 -1
- package/lib/module/providers/manga/comick.js +0 -149
- package/lib/module/providers/manga/comick.js.map +0 -1
- package/lib/module/providers/manga/mangahost.js +0 -108
- package/lib/module/providers/manga/mangahost.js.map +0 -1
- package/lib/module/providers/manga/mangapark.js +0 -92
- package/lib/module/providers/manga/mangapark.js.map +0 -1
- package/lib/module/providers/manga/mangareader.js +0 -101
- package/lib/module/providers/manga/mangareader.js.map +0 -1
- package/lib/module/providers/manga/mangasee123.js +0 -156
- package/lib/module/providers/manga/mangasee123.js.map +0 -1
- package/lib/module/providers/manga/readmanga.js +0 -264
- package/lib/module/providers/manga/readmanga.js.map +0 -1
- package/lib/module/providers/manga/vyvymanga.js +0 -161
- package/lib/module/providers/manga/vyvymanga.js.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts +0 -39
- package/lib/typescript/commonjs/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts +0 -14
- package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts +0 -18
- package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts +0 -17
- package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts +0 -31
- package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts +0 -17
- package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/comick.d.ts +0 -39
- package/lib/typescript/module/src/providers/manga/comick.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts +0 -14
- package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts +0 -18
- package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts +0 -17
- package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts +0 -31
- package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +0 -1
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts +0 -17
- package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +0 -1
- package/src/providers/manga/brmangas.ts +0 -148
- package/src/providers/manga/comick.ts +0 -285
- package/src/providers/manga/mangahost.ts +0 -134
- package/src/providers/manga/mangapark.ts +0 -115
- package/src/providers/manga/mangareader.ts +0 -132
- package/src/providers/manga/mangasee123.ts +0 -187
- package/src/providers/manga/readmanga.ts +0 -380
- package/src/providers/manga/vyvymanga.ts +0 -237
|
@@ -7,6 +7,7 @@ import android.util.Log
|
|
|
7
7
|
import android.webkit.ConsoleMessage
|
|
8
8
|
import android.webkit.CookieManager
|
|
9
9
|
import android.webkit.WebChromeClient
|
|
10
|
+
import android.webkit.WebView
|
|
10
11
|
import com.facebook.react.bridge.Promise
|
|
11
12
|
import com.facebook.react.bridge.ReadableMap
|
|
12
13
|
import com.facebook.react.bridge.WritableNativeMap
|
|
@@ -65,12 +66,29 @@ class HttpRequestModule(private val context: Context) {
|
|
|
65
66
|
private val handler = Handler(Looper.getMainLooper())
|
|
66
67
|
|
|
67
68
|
companion object {
|
|
68
|
-
private const val DEFAULT_USER_AGENT =
|
|
69
|
-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
|
|
70
|
-
|
|
71
69
|
// Time for scripts on the page to settle after it finishes loading (same as iOS).
|
|
72
70
|
private const val CAPTURE_DELAY_MS = 1500L
|
|
73
71
|
|
|
72
|
+
// How often a page that isn't ready yet is checked again.
|
|
73
|
+
private const val POLL_MS = 1000L
|
|
74
|
+
|
|
75
|
+
// "challenge" on a Cloudflare challenge page ("Just a moment..."), which turns into the real
|
|
76
|
+
// page once its script has run; otherwise "ready" once the document has loaded, else
|
|
77
|
+
// "loading" (same as iOS).
|
|
78
|
+
private val PAGE_STATE_SCRIPT = """
|
|
79
|
+
(function() {
|
|
80
|
+
try {
|
|
81
|
+
if (window._cf_chl_opt ||
|
|
82
|
+
document.getElementById('challenge-form') ||
|
|
83
|
+
document.getElementById('challenge-running') ||
|
|
84
|
+
document.title === 'Just a moment...') return 'challenge';
|
|
85
|
+
return document.readyState === 'complete' ? 'ready' : 'loading';
|
|
86
|
+
} catch(e) {
|
|
87
|
+
return 'ready';
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
""".trimIndent()
|
|
91
|
+
|
|
74
92
|
private val HTML_SCRIPT = """
|
|
75
93
|
(function() {
|
|
76
94
|
try {
|
|
@@ -138,22 +156,22 @@ class HttpRequestModule(private val context: Context) {
|
|
|
138
156
|
Log.d(TAG, "makeGetRequestWithWebView called with url: $url")
|
|
139
157
|
val requestHeaders = WebViewHeaders.from(headers)
|
|
140
158
|
handler.post {
|
|
141
|
-
|
|
159
|
+
// Without a User-Agent header the WebView keeps its own: Cloudflare fails a challenge
|
|
160
|
+
// whose user agent claims another browser than the WebView's client hints report.
|
|
161
|
+
val task = WebViewTask(context, promise, requestHeaders.userAgent)
|
|
142
162
|
logConsoleMessages(task)
|
|
143
163
|
task.onPageFinished = { view, loadedUrl ->
|
|
144
164
|
Log.d(TAG, "onPageFinished for url: $loadedUrl")
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
task.resolve(result)
|
|
154
|
-
}
|
|
165
|
+
captureUnlessChallenge(task, view) {
|
|
166
|
+
view.evaluateJavascript(HTML_SCRIPT) { htmlResponse: String? ->
|
|
167
|
+
val result = WritableNativeMap()
|
|
168
|
+
result.putString("url", loadedUrl)
|
|
169
|
+
result.putString("html", decodeJsString(htmlResponse) ?: "")
|
|
170
|
+
result.putString("cookies", CookieManager.getInstance().getCookie(loadedUrl) ?: "")
|
|
171
|
+
result.putString("status", "success")
|
|
172
|
+
task.resolve(result)
|
|
155
173
|
}
|
|
156
|
-
}
|
|
174
|
+
}
|
|
157
175
|
}
|
|
158
176
|
seedCookies(url, requestHeaders.cookie)
|
|
159
177
|
task.start { webView ->
|
|
@@ -182,29 +200,29 @@ class HttpRequestModule(private val context: Context) {
|
|
|
182
200
|
Log.d(TAG, "makePostRequestWithWebView called with url: $url")
|
|
183
201
|
val requestHeaders = WebViewHeaders.from(headers)
|
|
184
202
|
handler.post {
|
|
185
|
-
|
|
203
|
+
// Without a User-Agent header the WebView keeps its own: Cloudflare fails a challenge
|
|
204
|
+
// whose user agent claims another browser than the WebView's client hints report.
|
|
205
|
+
val task = WebViewTask(context, promise, requestHeaders.userAgent)
|
|
186
206
|
logConsoleMessages(task)
|
|
187
207
|
task.onPageFinished = { view, loadedUrl ->
|
|
188
208
|
Log.d(TAG, "onPageFinished for url: $loadedUrl")
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
JSONObject()
|
|
197
|
-
}
|
|
198
|
-
val result = WritableNativeMap()
|
|
199
|
-
result.putString("url", loadedUrl)
|
|
200
|
-
result.putString("response", json.optString("content", ""))
|
|
201
|
-
result.putString("cookies", CookieManager.getInstance().getCookie(loadedUrl) ?: "")
|
|
202
|
-
result.putString("status", "success")
|
|
203
|
-
result.putString("contentType", json.optString("contentType", "text/html"))
|
|
204
|
-
task.resolve(result)
|
|
209
|
+
captureUnlessChallenge(task, view) {
|
|
210
|
+
view.evaluateJavascript(POST_RESPONSE_SCRIPT) { responseJson: String? ->
|
|
211
|
+
// Like iOS, an unreadable capture gives an empty text/html response.
|
|
212
|
+
val json = try {
|
|
213
|
+
JSONObject(decodeJsString(responseJson) ?: "{}")
|
|
214
|
+
} catch (e: Exception) {
|
|
215
|
+
JSONObject()
|
|
205
216
|
}
|
|
217
|
+
val result = WritableNativeMap()
|
|
218
|
+
result.putString("url", loadedUrl)
|
|
219
|
+
result.putString("response", json.optString("content", ""))
|
|
220
|
+
result.putString("cookies", CookieManager.getInstance().getCookie(loadedUrl) ?: "")
|
|
221
|
+
result.putString("status", "success")
|
|
222
|
+
result.putString("contentType", json.optString("contentType", "text/html"))
|
|
223
|
+
task.resolve(result)
|
|
206
224
|
}
|
|
207
|
-
}
|
|
225
|
+
}
|
|
208
226
|
}
|
|
209
227
|
seedCookies(url, requestHeaders.cookie)
|
|
210
228
|
Log.d(TAG, "Making POST request to: $url with body length: ${body.length}")
|
|
@@ -212,6 +230,43 @@ class HttpRequestModule(private val context: Context) {
|
|
|
212
230
|
}
|
|
213
231
|
}
|
|
214
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Runs [capture] [CAPTURE_DELAY_MS] after the page finished loading, unless the page is a
|
|
235
|
+
* Cloudflare challenge: then the page is checked every [POLL_MS] until the challenge has turned
|
|
236
|
+
* into a loaded page, which is captured [CAPTURE_DELAY_MS] later, or the task times out.
|
|
237
|
+
* Polling the page, not waiting for navigation events, can't miss a reload that finished
|
|
238
|
+
* while a check was running.
|
|
239
|
+
*/
|
|
240
|
+
private fun captureUnlessChallenge(task: WebViewTask, view: WebView, capture: () -> Unit) {
|
|
241
|
+
handler.postDelayed({ captureWhenReady(task, view, false, capture) }, CAPTURE_DELAY_MS)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
private fun captureWhenReady(
|
|
245
|
+
task: WebViewTask,
|
|
246
|
+
view: WebView,
|
|
247
|
+
afterChallenge: Boolean,
|
|
248
|
+
capture: () -> Unit,
|
|
249
|
+
) {
|
|
250
|
+
if (task.isSettled) return
|
|
251
|
+
view.evaluateJavascript(PAGE_STATE_SCRIPT) { result: String? ->
|
|
252
|
+
if (task.isSettled) return@evaluateJavascript
|
|
253
|
+
val state = decodeJsString(result)
|
|
254
|
+
if (state == "challenge" || state == "loading") {
|
|
255
|
+
if (state == "challenge" && !afterChallenge) {
|
|
256
|
+
Log.d(TAG, "Cloudflare challenge page; waiting for the page it turns into")
|
|
257
|
+
}
|
|
258
|
+
task.keepOpen()
|
|
259
|
+
val sawChallenge = afterChallenge || state == "challenge"
|
|
260
|
+
handler.postDelayed({ captureWhenReady(task, view, sawChallenge, capture) }, POLL_MS)
|
|
261
|
+
} else if (afterChallenge) {
|
|
262
|
+
// The page the challenge turned into gets the same time to settle as a first page.
|
|
263
|
+
handler.postDelayed({ if (!task.isSettled) capture() }, CAPTURE_DELAY_MS)
|
|
264
|
+
} else {
|
|
265
|
+
capture()
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
215
270
|
/** Stores the pairs of a Cookie header for [url] before the WebView loads it. */
|
|
216
271
|
private fun seedCookies(url: String, cookieHeader: String?) {
|
|
217
272
|
if (cookieHeader.isNullOrEmpty()) return
|
|
@@ -3,6 +3,7 @@ package com.consumet
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.os.Handler
|
|
5
5
|
import android.os.Looper
|
|
6
|
+
import android.os.SystemClock
|
|
6
7
|
import android.util.Log
|
|
7
8
|
import android.webkit.CookieManager
|
|
8
9
|
import android.webkit.WebResourceError
|
|
@@ -18,10 +19,12 @@ import com.facebook.react.bridge.Promise
|
|
|
18
19
|
*
|
|
19
20
|
* The promise settles exactly once:
|
|
20
21
|
* - [onPageFinished] runs once, when the main document first finishes loading. Errors after
|
|
21
|
-
* that are ignored and the callback settles the promise with [resolve] or [reject]
|
|
22
|
+
* that are ignored and the callback settles the promise with [resolve] or [reject], or calls
|
|
23
|
+
* [keepOpen] while it polls the page (a challenge page that turns into the real page once
|
|
24
|
+
* solved).
|
|
22
25
|
* - A main-frame load error rejects with [WEBVIEW_ERROR]. Failed sub-resources (images, scripts,
|
|
23
26
|
* iframes) are ignored, as WKWebView ignores them.
|
|
24
|
-
* - No
|
|
27
|
+
* - No settled promise within [TIMEOUT_MS] of [start] rejects with [TIMEOUT].
|
|
25
28
|
*/
|
|
26
29
|
internal class WebViewTask(
|
|
27
30
|
context: Context,
|
|
@@ -38,6 +41,7 @@ internal class WebViewTask(
|
|
|
38
41
|
private val handler = Handler(Looper.getMainLooper())
|
|
39
42
|
private val timeout = Runnable { reject(TIMEOUT, "WebView request timed out") }
|
|
40
43
|
private var pageFinished = false
|
|
44
|
+
private var startedAt = 0L
|
|
41
45
|
|
|
42
46
|
var isSettled = false
|
|
43
47
|
private set
|
|
@@ -82,10 +86,21 @@ internal class WebViewTask(
|
|
|
82
86
|
reject(WEBVIEW_ERROR, "WebView error: ${error.description}")
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
|
-
|
|
89
|
+
startedAt = SystemClock.uptimeMillis()
|
|
90
|
+
handler.postAtTime(timeout, startedAt + TIMEOUT_MS)
|
|
86
91
|
load(webView)
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Keeps the task open after the page finished loading, for a caller that polls the page, until
|
|
96
|
+
* it settles or the [TIMEOUT_MS] deadline from [start] passes.
|
|
97
|
+
*/
|
|
98
|
+
fun keepOpen() {
|
|
99
|
+
if (isSettled) return
|
|
100
|
+
handler.removeCallbacks(timeout)
|
|
101
|
+
handler.postAtTime(timeout, startedAt + TIMEOUT_MS)
|
|
102
|
+
}
|
|
103
|
+
|
|
89
104
|
fun resolve(value: Any?) = settle { promise.resolve(value) }
|
|
90
105
|
|
|
91
106
|
fun reject(code: String, message: String) = settle { promise.reject(code, message) }
|
package/ios/Consumet.mm
CHANGED
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
#import <JavaScriptCore/JavaScriptCore.h>
|
|
4
4
|
#import <WebKit/WebKit.h>
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
// Without a User-Agent header a WebView keeps WKWebView's own user agent, with
|
|
7
|
+
// the tokens Mobile Safari adds for this iOS version, so it matches the engine:
|
|
8
|
+
// Cloudflare fails a challenge whose user agent claims another browser version
|
|
9
|
+
// (as on Android, where the WebView keeps its own).
|
|
10
|
+
static NSString *RCConsumetSafariApplicationName(void) {
|
|
11
|
+
NSArray<NSString *> *parts =
|
|
12
|
+
[UIDevice.currentDevice.systemVersion componentsSeparatedByString:@"."];
|
|
13
|
+
NSString *version =
|
|
14
|
+
parts.count > 1
|
|
15
|
+
? [NSString stringWithFormat:@"%@.%@", parts[0], parts[1]]
|
|
16
|
+
: parts.firstObject;
|
|
17
|
+
return [NSString
|
|
18
|
+
stringWithFormat:@"Version/%@ Mobile/15E148 Safari/604.1", version];
|
|
19
|
+
}
|
|
10
20
|
|
|
11
21
|
// Rejection codes shared with Android (see the contract in src/NativeConsumet.ts).
|
|
12
22
|
static NSString *const kWebViewErrorCode = @"WEBVIEW_ERROR";
|
|
@@ -112,6 +122,10 @@ static void RCConsumetReadCookies(
|
|
|
112
122
|
- (void)loadRequest:(NSURLRequest *)request
|
|
113
123
|
userAgent:(nullable NSString *)ua
|
|
114
124
|
cookieHeader:(nullable NSString *)cookieHeader;
|
|
125
|
+
/// Keeps the task open after the navigation finished, for a caller that polls
|
|
126
|
+
/// the page (a challenge page that turns into the real page once solved), until
|
|
127
|
+
/// it is cleaned up or the 30 s deadline from loadRequest passes.
|
|
128
|
+
- (void)keepOpen;
|
|
115
129
|
- (void)cleanup;
|
|
116
130
|
@end
|
|
117
131
|
|
|
@@ -119,7 +133,9 @@ static void RCConsumetReadCookies(
|
|
|
119
133
|
WKWebView *_webView;
|
|
120
134
|
UIWindow *_offscreenWindow;
|
|
121
135
|
NSTimer *_timer;
|
|
136
|
+
NSDate *_startedAt;
|
|
122
137
|
BOOL _done;
|
|
138
|
+
BOOL _keptOpen;
|
|
123
139
|
}
|
|
124
140
|
|
|
125
141
|
- (void)loadRequest:(NSURLRequest *)request
|
|
@@ -130,10 +146,12 @@ static void RCConsumetReadCookies(
|
|
|
130
146
|
|
|
131
147
|
WKWebViewConfiguration *cfg = [WKWebViewConfiguration new];
|
|
132
148
|
cfg.websiteDataStore = RCConsumetDataStore();
|
|
149
|
+
cfg.applicationNameForUserAgent = RCConsumetSafariApplicationName();
|
|
133
150
|
|
|
134
151
|
_webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)
|
|
135
152
|
configuration:cfg];
|
|
136
|
-
|
|
153
|
+
if (ua.length)
|
|
154
|
+
_webView.customUserAgent = ua;
|
|
137
155
|
_webView.navigationDelegate = self;
|
|
138
156
|
|
|
139
157
|
// Attach to a tiny off-screen window so WKWebView loads resources properly.
|
|
@@ -142,6 +160,7 @@ static void RCConsumetReadCookies(
|
|
|
142
160
|
_offscreenWindow.hidden = NO;
|
|
143
161
|
[_offscreenWindow addSubview:_webView];
|
|
144
162
|
|
|
163
|
+
_startedAt = [NSDate date];
|
|
145
164
|
_timer = [NSTimer scheduledTimerWithTimeInterval:30
|
|
146
165
|
target:self
|
|
147
166
|
selector:@selector(_didTimeout)
|
|
@@ -197,10 +216,25 @@ static void RCConsumetReadCookies(
|
|
|
197
216
|
return cookies;
|
|
198
217
|
}
|
|
199
218
|
|
|
219
|
+
- (void)keepOpen {
|
|
220
|
+
if (!_webView || _keptOpen)
|
|
221
|
+
return;
|
|
222
|
+
_keptOpen = YES;
|
|
223
|
+
[_timer invalidate];
|
|
224
|
+
NSTimeInterval elapsed = [[NSDate date] timeIntervalSinceDate:_startedAt];
|
|
225
|
+
_timer = [NSTimer scheduledTimerWithTimeInterval:MAX(30 - elapsed, 0)
|
|
226
|
+
target:self
|
|
227
|
+
selector:@selector(_didTimeout)
|
|
228
|
+
userInfo:nil
|
|
229
|
+
repeats:NO];
|
|
230
|
+
}
|
|
231
|
+
|
|
200
232
|
- (void)_didTimeout {
|
|
201
|
-
|
|
233
|
+
// A task kept open has finished its navigation (_done) but still times out.
|
|
234
|
+
if (_done && !_keptOpen)
|
|
202
235
|
return;
|
|
203
236
|
_done = YES;
|
|
237
|
+
_keptOpen = NO;
|
|
204
238
|
if (self.onError)
|
|
205
239
|
self.onError(kTimeoutCode, @"WebView request timed out");
|
|
206
240
|
[self cleanup];
|
|
@@ -264,6 +298,77 @@ static void RCConsumetReadCookies(
|
|
|
264
298
|
|
|
265
299
|
#pragma mark - Consumet Module
|
|
266
300
|
|
|
301
|
+
// "challenge" on a Cloudflare challenge page ("Just a moment..."), which turns
|
|
302
|
+
// into the real page once its script has run; otherwise "ready" once the
|
|
303
|
+
// document has loaded, else "loading" (as on Android).
|
|
304
|
+
static NSString *const kPageStateScript =
|
|
305
|
+
@"(function(){try{if(window._cf_chl_opt||"
|
|
306
|
+
@"document.getElementById('challenge-form')||"
|
|
307
|
+
@"document.getElementById('challenge-running')||"
|
|
308
|
+
@"document.title==='Just a moment...')return 'challenge';"
|
|
309
|
+
@"return document.readyState==='complete'?'ready':'loading';"
|
|
310
|
+
@"}catch(e){return 'ready';}})()";
|
|
311
|
+
|
|
312
|
+
/// Checks the page every second until a challenge has turned into a loaded
|
|
313
|
+
/// page, then runs capture 1.5 s later (or at once when there was none).
|
|
314
|
+
/// Polling the page, not waiting for navigation events, can't miss a reload
|
|
315
|
+
/// that finished while a check was running.
|
|
316
|
+
static void RCConsumetCaptureWhenReady(RCConsumetWebTask *task,
|
|
317
|
+
WKWebView *webView,
|
|
318
|
+
BOOL afterChallenge,
|
|
319
|
+
dispatch_block_t capture) {
|
|
320
|
+
__weak RCConsumetWebTask *wt = task;
|
|
321
|
+
__weak WKWebView *wv = webView;
|
|
322
|
+
[webView evaluateJavaScript:kPageStateScript
|
|
323
|
+
completionHandler:^(id result, NSError *error) {
|
|
324
|
+
if (!wv)
|
|
325
|
+
return;
|
|
326
|
+
BOOL challenge = [result isEqual:@"challenge"];
|
|
327
|
+
if (challenge || [result isEqual:@"loading"]) {
|
|
328
|
+
[wt keepOpen];
|
|
329
|
+
dispatch_after(
|
|
330
|
+
dispatch_time(DISPATCH_TIME_NOW, (int64_t)NSEC_PER_SEC),
|
|
331
|
+
dispatch_get_main_queue(), ^{
|
|
332
|
+
WKWebView *view = wv;
|
|
333
|
+
if (view)
|
|
334
|
+
RCConsumetCaptureWhenReady(wt, view,
|
|
335
|
+
afterChallenge || challenge,
|
|
336
|
+
capture);
|
|
337
|
+
});
|
|
338
|
+
} else if (afterChallenge) {
|
|
339
|
+
// The page the challenge turned into gets the same time to
|
|
340
|
+
// settle as a first page.
|
|
341
|
+
dispatch_after(
|
|
342
|
+
dispatch_time(DISPATCH_TIME_NOW,
|
|
343
|
+
(int64_t)(1.5 * NSEC_PER_SEC)),
|
|
344
|
+
dispatch_get_main_queue(), ^{
|
|
345
|
+
if (wv)
|
|
346
|
+
capture();
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
349
|
+
capture();
|
|
350
|
+
}
|
|
351
|
+
}];
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/// Runs capture 1.5 s after a navigation finished (so scripts on the page can
|
|
355
|
+
/// settle), unless the page is a Cloudflare challenge: then capture waits for
|
|
356
|
+
/// the page the challenge turns into, and the task times out as usual if it
|
|
357
|
+
/// never does.
|
|
358
|
+
static void RCConsumetCaptureUnlessChallenge(RCConsumetWebTask *task,
|
|
359
|
+
WKWebView *webView,
|
|
360
|
+
dispatch_block_t capture) {
|
|
361
|
+
__weak RCConsumetWebTask *wt = task;
|
|
362
|
+
__weak WKWebView *wv = webView;
|
|
363
|
+
dispatch_after(
|
|
364
|
+
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)),
|
|
365
|
+
dispatch_get_main_queue(), ^{
|
|
366
|
+
WKWebView *view = wv;
|
|
367
|
+
if (view)
|
|
368
|
+
RCConsumetCaptureWhenReady(wt, view, NO, capture);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
|
|
267
372
|
@implementation Consumet {
|
|
268
373
|
NSMutableSet<RCConsumetWebTask *> *_tasks;
|
|
269
374
|
}
|
|
@@ -304,7 +409,7 @@ RCT_EXPORT_MODULE()
|
|
|
304
409
|
timeoutInterval:30];
|
|
305
410
|
req.HTTPMethod = method;
|
|
306
411
|
|
|
307
|
-
__block NSString *ua =
|
|
412
|
+
__block NSString *ua = nil;
|
|
308
413
|
[headers enumerateKeysAndObjectsUsingBlock:^(NSString *k, NSString *v,
|
|
309
414
|
BOOL *stop) {
|
|
310
415
|
if ([k caseInsensitiveCompare:@"User-Agent"] == NSOrderedSame) {
|
|
@@ -464,7 +569,7 @@ RCT_EXPORT_MODULE()
|
|
|
464
569
|
requestWithURL:[NSURL URLWithString:urlStr]
|
|
465
570
|
cachePolicy:NSURLRequestReloadIgnoringCacheData
|
|
466
571
|
timeoutInterval:30]
|
|
467
|
-
userAgent:
|
|
572
|
+
userAgent:nil
|
|
468
573
|
cookieHeader:nil];
|
|
469
574
|
});
|
|
470
575
|
}
|
|
@@ -482,40 +587,37 @@ RCT_EXPORT_MODULE()
|
|
|
482
587
|
__weak RCConsumetWebTask *wt = task;
|
|
483
588
|
|
|
484
589
|
task.onFinish = ^(WKWebView *webView, NSString *loadedURL) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
});
|
|
510
|
-
}];
|
|
511
|
-
});
|
|
590
|
+
RCConsumetCaptureUnlessChallenge(wt, webView, ^{
|
|
591
|
+
[webView
|
|
592
|
+
evaluateJavaScript:@"(function(){try{return "
|
|
593
|
+
@"document.documentElement.outerHTML;}catch("
|
|
594
|
+
@"e){return '';}})()"
|
|
595
|
+
completionHandler:^(id html, NSError *e) {
|
|
596
|
+
NSString *htmlStr =
|
|
597
|
+
[html isKindOfClass:[NSString class]] ? html : @"";
|
|
598
|
+
NSString *finalURL = loadedURL.length ? loadedURL : urlStr;
|
|
599
|
+
RCConsumetReadCookies(
|
|
600
|
+
webView, finalURL,
|
|
601
|
+
^(NSArray<NSHTTPCookie *> *cookies,
|
|
602
|
+
NSString *cookieStr) {
|
|
603
|
+
resolve(@{
|
|
604
|
+
@"url" : finalURL,
|
|
605
|
+
@"html" : htmlStr,
|
|
606
|
+
@"cookies" : cookieStr,
|
|
607
|
+
@"status" : @"success"
|
|
608
|
+
});
|
|
609
|
+
[wt cleanup];
|
|
610
|
+
[ws _removeTask:wt];
|
|
611
|
+
});
|
|
612
|
+
}];
|
|
613
|
+
});
|
|
512
614
|
};
|
|
513
615
|
task.onError = ^(NSString *code, NSString *desc) {
|
|
514
616
|
reject(code, desc, nil);
|
|
515
617
|
[ws _removeTask:wt];
|
|
516
618
|
};
|
|
517
619
|
|
|
518
|
-
NSString *ua =
|
|
620
|
+
NSString *ua = nil;
|
|
519
621
|
NSMutableURLRequest *req = [self _requestWithURL:urlStr
|
|
520
622
|
method:@"GET"
|
|
521
623
|
headers:headers
|
|
@@ -554,48 +656,46 @@ RCT_EXPORT_MODULE()
|
|
|
554
656
|
@"})()";
|
|
555
657
|
|
|
556
658
|
task.onFinish = ^(WKWebView *webView, NSString *loadedURL) {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
NSString
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}];
|
|
591
|
-
});
|
|
659
|
+
RCConsumetCaptureUnlessChallenge(wt, webView, ^{
|
|
660
|
+
[webView
|
|
661
|
+
evaluateJavaScript:jsExtract
|
|
662
|
+
completionHandler:^(id r, NSError *e) {
|
|
663
|
+
NSString *finalURL = loadedURL.length ? loadedURL : urlStr;
|
|
664
|
+
RCConsumetReadCookies(
|
|
665
|
+
webView, finalURL,
|
|
666
|
+
^(NSArray<NSHTTPCookie *> *cookies,
|
|
667
|
+
NSString *cookieStr) {
|
|
668
|
+
NSString *jsonStr =
|
|
669
|
+
[r isKindOfClass:[NSString class]] ? r : @"{}";
|
|
670
|
+
id json = [NSJSONSerialization
|
|
671
|
+
JSONObjectWithData:
|
|
672
|
+
[jsonStr
|
|
673
|
+
dataUsingEncoding:NSUTF8StringEncoding]
|
|
674
|
+
options:0
|
|
675
|
+
error:nil];
|
|
676
|
+
NSDictionary *parsed =
|
|
677
|
+
[json isKindOfClass:[NSDictionary class]] ? json
|
|
678
|
+
: @{};
|
|
679
|
+
resolve(@{
|
|
680
|
+
@"url" : finalURL,
|
|
681
|
+
@"response" : parsed[@"content"] ?: @"",
|
|
682
|
+
@"cookies" : cookieStr,
|
|
683
|
+
@"status" : @"success",
|
|
684
|
+
@"contentType" : parsed[@"contentType"]
|
|
685
|
+
?: @"text/html"
|
|
686
|
+
});
|
|
687
|
+
[wt cleanup];
|
|
688
|
+
[ws _removeTask:wt];
|
|
689
|
+
});
|
|
690
|
+
}];
|
|
691
|
+
});
|
|
592
692
|
};
|
|
593
693
|
task.onError = ^(NSString *code, NSString *desc) {
|
|
594
694
|
reject(code, desc, nil);
|
|
595
695
|
[ws _removeTask:wt];
|
|
596
696
|
};
|
|
597
697
|
|
|
598
|
-
NSString *ua =
|
|
698
|
+
NSString *ua = nil;
|
|
599
699
|
NSMutableURLRequest *req = [self _requestWithURL:urlStr
|
|
600
700
|
method:@"POST"
|
|
601
701
|
headers:headers
|
|
@@ -11,7 +11,7 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
11
11
|
* | code | methods | meaning |
|
|
12
12
|
* | ----------------- | ------------------------------ | --------------------------------------------------------------- |
|
|
13
13
|
* | `WEBVIEW_ERROR` | WebView requests (below) | The main document failed to load (DNS, TLS, connection). |
|
|
14
|
-
* | `TIMEOUT` | WebView requests (below) |
|
|
14
|
+
* | `TIMEOUT` | WebView requests (below) | No page (past any Cloudflare challenge) finished within 30 s. |
|
|
15
15
|
* | `COOKIE_ERROR` | getDdosGuardCookiesWithWebView | The page loaded but set no `__ddg2_` cookie. |
|
|
16
16
|
* | `ERROR` | bypassDdosGuard | Invalid URL, or no DDoS-Guard cookie could be obtained. |
|
|
17
17
|
* | `HTTP_ERROR` | makePostRequest | Invalid URL or transport failure. HTTP error statuses resolve. |
|
|
@@ -23,7 +23,10 @@ import { TurboModuleRegistry } from 'react-native';
|
|
|
23
23
|
* makePostRequestWithWebView) load the URL in a hidden WebView:
|
|
24
24
|
* - Only the main document decides the outcome. Failed sub-resources (images, scripts, iframes)
|
|
25
25
|
* are ignored, and HTTP error statuses (403, 503, ...) still resolve with the page.
|
|
26
|
-
* - The first finished page settles the request; later navigations and errors are ignored.
|
|
26
|
+
* - The first finished page settles the request; later navigations and errors are ignored. The
|
|
27
|
+
* exception is a Cloudflare challenge page ("Just a moment..."): makeGetRequestWithWebView and
|
|
28
|
+
* makePostRequestWithWebView wait for the page the challenge reloads into once its script has
|
|
29
|
+
* run, within the same 30 s.
|
|
27
30
|
* - `cookies` (and the getDdosGuardCookiesWithWebView result) is a Cookie header string with the
|
|
28
31
|
* cookies that apply to the loaded URL.
|
|
29
32
|
* - Cookies carry over between calls. Android uses the app-wide CookieManager; iOS uses an
|
|
@@ -46,9 +49,12 @@ export interface Spec extends TurboModule {
|
|
|
46
49
|
*/
|
|
47
50
|
getDdosGuardCookiesWithWebView(url: string): Promise<string>;
|
|
48
51
|
/**
|
|
49
|
-
* Loads `url` in a hidden WebView and resolves 1.5 s after the main document finishes loading
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
+
* Loads `url` in a hidden WebView and resolves 1.5 s after the main document finishes loading
|
|
53
|
+
* (the page a Cloudflare challenge reloads into, when the first page is one), with its
|
|
54
|
+
* `outerHTML`, the final URL and its cookies. User-Agent and Cookie headers are applied
|
|
55
|
+
* to the WebView; other headers are sent with the request. Without a User-Agent header the
|
|
56
|
+
* WebView keeps the engine's own (on iOS with Mobile Safari's tokens), which Cloudflare checks
|
|
57
|
+
* against what the engine reports. `status` is always `'success'`:
|
|
52
58
|
* failures and timeouts reject (`WEBVIEW_ERROR`, `TIMEOUT`).
|
|
53
59
|
*/
|
|
54
60
|
makeGetRequestWithWebView(
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "Kwik",
|
|
18
|
-
"version": "1.2.
|
|
18
|
+
"version": "1.2.5",
|
|
19
19
|
"minContextVersion": 1,
|
|
20
|
-
"main": "https://raw.githubusercontent.com/uwumilabs/react-native-consumet/refs/heads/main/registry/extractors/kwik/1.2.
|
|
21
|
-
"sha256": "
|
|
20
|
+
"main": "https://raw.githubusercontent.com/uwumilabs/react-native-consumet/refs/heads/main/registry/extractors/kwik/1.2.5.js",
|
|
21
|
+
"sha256": "d4b4992d35d6e8f5e00143deaf61e0c54c5bd1f402a64f376e8550dd77dbb68a",
|
|
22
22
|
"distFile": "dist/bundles/extractors/kwik.js"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
"id": "animepahe",
|
|
76
76
|
"name": "AnimePahe",
|
|
77
77
|
"description": "High-quality anime streaming from AnimePahe with multiple servers and subtitles",
|
|
78
|
-
"version": "1.2.
|
|
78
|
+
"version": "1.2.7",
|
|
79
79
|
"minContextVersion": 1,
|
|
80
80
|
"author": {
|
|
81
81
|
"name": "RNConsumet Team",
|
|
82
82
|
"url": "https://github.com/uwumilabs"
|
|
83
83
|
},
|
|
84
84
|
"category": "anime",
|
|
85
|
-
"main": "https://raw.githubusercontent.com/uwumilabs/react-native-consumet/refs/heads/main/registry/extensions/animepahe/1.2.
|
|
85
|
+
"main": "https://raw.githubusercontent.com/uwumilabs/react-native-consumet/refs/heads/main/registry/extensions/animepahe/1.2.7.js",
|
|
86
86
|
"factoryName": "createAnimePahe",
|
|
87
87
|
"baseUrl": "https://animepahe.pw",
|
|
88
88
|
"logo": "https://animepahe.pw/web-app-manifest-512x512.png",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"dubbed": true,
|
|
101
101
|
"isSourceEmbed": true,
|
|
102
102
|
"haveMultiServers": false,
|
|
103
|
-
"sha256": "
|
|
103
|
+
"sha256": "63b4fbf8c7333984e518545171571d43cd983479c9b1f14b9c194beec5966811",
|
|
104
104
|
"distFile": "dist/bundles/providers/anime/animepahe/create-animepahe.js"
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
fa54678c129da118d355e4e5c0d0077224807ca6deb394e653ddc067c65958d371b89425d58e09836631c4b1c2ca19ef1520b73ca9dc9170598c56b9b3c56b0e
|