LibreTube/app/src/main/java/com/github/libretube/PipedApi.kt

32 lines
1.0 KiB
Kotlin
Raw Normal View History

2022-02-01 21:22:06 +05:30
package com.github.libretube
2021-12-18 16:34:14 +05:30
2022-02-05 00:25:05 +05:30
import com.github.libretube.obj.Channel
2021-12-18 16:34:14 +05:30
import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
2022-02-01 21:22:06 +05:30
import com.github.libretube.obj.StreamItem
import com.github.libretube.obj.Streams
import com.github.libretube.obj.SearchResult
2021-12-18 16:34:14 +05:30
interface PipedApi {
@GET("trending")
suspend fun getTrending(@Query("region") region: String): List<StreamItem>
@GET("streams/{videoId}")
suspend fun getStreams(@Path("videoId") videoId: String): Streams
2021-12-28 01:37:07 +05:30
@GET("search")
suspend fun getSearchResults(
@Query("q") searchQuery: String,
2021-12-28 23:41:51 +05:30
@Query("filter") filter: String
): SearchResult
2021-12-28 01:37:07 +05:30
@GET("suggestions")
suspend fun getSuggestions(@Query("query") query: String): List<String>
2022-02-05 00:25:05 +05:30
@GET("channel/{channelId}")
suspend fun getChannel(@Path("channelId") channelId: String): Channel
2022-02-05 19:39:50 +05:30
@GET("nextpage/channel/{channelId}")
suspend fun getChannelNextPage(@Path("channelId") channelId: String, @Query("nextpage") nextPage: String): Channel
2021-12-18 16:34:14 +05:30
}