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

49 lines
1.6 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-06 18:40:27 +05:30
import com.github.libretube.obj.*
2022-02-06 21:25:40 +05:30
import retrofit2.http.*
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
2022-02-06 18:40:27 +05:30
@GET("playlists/{playlistId}")
suspend fun getPlaylist(@Path("playlistId") playlistId: String): Playlist
@GET("nextpage/playlists/{playlistId}")
suspend fun getPlaylistNextPage(@Path("playlistId") playlistId: String, @Query("nextpage") nextPage: String): Playlist
2022-02-06 21:25:40 +05:30
@POST("login")
suspend fun login(@Body login: Login): Token
@POST("register")
suspend fun register(@Body login: Login): Token
@GET("feed")
suspend fun getFeed(@Query("authToken") token: String?): List<StreamItem>
@GET("subscribed")
suspend fun isSubscribed(@Query("channelId") channelId: String, @Header("Authorization") token: String): Subscribed
@GET("subscriptions")
suspend fun subscriptions(@Header("Authorization") token: String): List<Subscription>
2021-12-18 16:34:14 +05:30
}