diff --git a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt index 42100b7..a7cfe65 100644 --- a/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt +++ b/src/main/kotlin/com/lagradost/cloudstream3/gradle/CloudstreamExtension.kt @@ -33,6 +33,7 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) { when { type == "github" -> setRepo(user, repo, "https://github.com/${user}/${repo}", "https://raw.githubusercontent.com/${user}/${repo}/%branch%/%filename%") type == "gitlab" -> setRepo(user, repo, "https://gitlab.com/${user}/${repo}", "https://gitlab.com/${user}/${repo}/-/raw/%branch%/%filename%") + type == "codeberg" -> setRepo(user, repo, "https://codeberg.org/${user}/${repo}", "https://codeberg.org/${user}/${repo}/raw/branch/%branch%/%filename%") type.startsWith("gitlab-") -> { val domain = type.removePrefix("gitlab-") setRepo(user, repo, "https://${domain}/${user}/${repo}", "https://${domain}/${user}/${repo}/-/raw/%branch%/%filename%") @@ -60,6 +61,12 @@ abstract class CloudstreamExtension @Inject constructor(project: Project) { .removePrefix("https://") .removePrefix("gitlab.com") } + url.startsWith("https://codeberg.org") -> { + type = "codeberg" + url + .removePrefix("https://") + .removePrefix("codeberg.org") + } !url.startsWith("https://") -> { // assume default as github type = "github" url @@ -106,4 +113,4 @@ fun ExtensionContainer.getCloudstream(): CloudstreamExtension { fun ExtensionContainer.findCloudstream(): CloudstreamExtension? { return findByName("cloudstream") as CloudstreamExtension? -} \ No newline at end of file +}