Code Monkey home page Code Monkey logo

cloudstreamapi's Introduction

CloudstreamApi

A minimal subset of the Cloudstream Provider API used to allow local compilation and testing. Currently work in progress and may not work with all providers. Please make an issue if there are any useful missing methods from the main app.

Getting started

Setup

In your build.gradle.kts:

    dependencies {
        val apkTasks = listOf("deployWithAdb", "build")
        val useApk = gradle.startParameter.taskNames.any { taskName ->
            apkTasks.any { apkTask ->
                taskName.contains(apkTask, ignoreCase = true)
            }
        }

        val implementation by configurations
        val apk by configurations

        // If the task is specifically to compile the app then use the stubs, otherwise us the library.
        if (useApk) {
            // Stubs for all Cloudstream classes
            apk("com.lagradost:cloudstream3:pre-release")
        } else {
            // For running locally
            implementation("com.github.Blatzar:CloudstreamApi:0.1.6")
        }

        // Rest of your code here...
   }

Testing locally

Running it is as simple as defining a main method and running it by clicking the green arrow in Android Studio. image

suspend fun main() {
    val providerTester = com.lagradost.cloudstreamtest.ProviderTester(YourProvider())
    providerTester.testAll()
}

Using the ProviderTester it becomes easy to test all methods at once, or just test individual methods with printing. It is mainly to prevent a lot of boilerplate code in every provider.

Note that you can run the providers locally too, without using ProviderTester:

suspend fun main() {
    val responses = YourProvider().search("Query")
    println(responses)
}

An automated testing system, or testing all providers does not exist currently, but is likely to come in the future.

cloudstreamapi's People

Contributors

blatzar avatar

Stargazers

Saurabh Kaperwan avatar  avatar  avatar  avatar vdbhb59 avatar  avatar Azamov X avatar  avatar  avatar Poseidon444 avatar  avatar Sarang S avatar Bharathi avatar chokerman avatar Angelos Bouklis avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.