Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates and Chillx Extractor Updated #1065

Merged
merged 11 commits into from
May 4, 2024

Conversation

phisher98
Copy link
Contributor

@phisher98 phisher98 commented Apr 29, 2024

Updates and Chillx Extractor Updated

Kudos to @rushi-chavan for updated Keys

).text
)?.groupValues?.get(1)
val decrypt = cryptoAESHandler(master ?: return, getKey().toByteArray(), false)?.replace("\\", "") ?: throw ErrorLoadingException("failed to decrypt")

val key = app.get("https://raw.githubusercontent.com/rushi-chavan/multi-keys/keys/keys.json").parsedSafe<Keys>()?.key?.get(0) ?: throw ErrorLoadingException("Unable to get key")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this cached, we dont want to ddos github for every url.

Copy link
Contributor Author

@phisher98 phisher98 May 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have assigned that as key url as it can be updated and previously as well its fetching from a Github json hosted on github so do you want me to assign key static in Extractor ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several other extractors using GitHub links. We might have to work on them as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phisher98 What I mean is that you should do something like this, as then you dont have to do an extra get request for every time you use this extractor

companion object {
  private val key : String? = null
  suspend fun getKey() {
    key ?: app.get("...").parsedSafe<Keys>()?.key?.get(0)?.also { key = it }
  }
}

@b4byhuey
Copy link
Contributor

b4byhuey commented May 2, 2024

private var key: String? = null

val key = fetchKey() ?: throw ErrorLoadingException("Unable to get key")

val decrypt = cryptoAESHandler(master ?: return, key.toByteArray(), false)
?.replace("\", "")
?: throw ErrorLoadingException("failed to decrypt")

private suspend fun fetchKey(): String? {
return app.get("https://raw.githubusercontent.com/rushi-chavan/multi-keys/keys/keys.json")
.parsedSafe()?.key?.get(0)?.also { key = it }
}

@phisher98 try this

@phisher98
Copy link
Contributor Author

@b4byhuey Yeah That what i was saying but Thanks for the help

@fire-light42
Copy link
Collaborator

The key is still not cached

@fire-light42 fire-light42 merged commit 0a5399d into recloudstream:master May 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants