Implement FlareSolverr (#844)

* Implement FlareSolverr

* Oops
This commit is contained in:
Mitchell Syer
2024-01-23 18:48:55 -05:00
committed by GitHub
parent 9121a6341c
commit d658e07583
8 changed files with 207 additions and 191 deletions

View File

@@ -81,4 +81,8 @@ object GetCatalogueSource {
fun unregisterCatalogueSource(sourceId: Long) {
sourceCache.remove(sourceId)
}
fun unregisterAllCatalogueSources() {
sourceCache.clear()
}
}

View File

@@ -131,6 +131,11 @@ class ServerConfig(getConfig: () -> Config, val moduleName: String = SERVER_CONF
// local source
val localSourcePath: MutableStateFlow<String> by OverrideConfigValue(StringConfigAdapter)
// cloudflare bypass
val flareSolverrEnabled: MutableStateFlow<Boolean> by OverrideConfigValue(BooleanConfigAdapter)
val flareSolverrUrl: MutableStateFlow<String> by OverrideConfigValue(StringConfigAdapter)
val flareSolverrTimeout: MutableStateFlow<Int> by OverrideConfigValue(IntConfigAdapter)
@OptIn(ExperimentalCoroutinesApi::class)
fun <T> subscribeTo(
flow: Flow<T>,