This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f7a957
commit bdac093
Showing
13 changed files
with
165 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/api/TwitchGraphQLService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.api | ||
|
||
import androidx.lifecycle.LiveData | ||
import de.markhaehnel.rbtv.rocketbeanstv.util.Constants | ||
import de.markhaehnel.rbtv.rocketbeanstv.vo.TwitchAccesToken | ||
import de.markhaehnel.rbtv.rocketbeanstv.vo.TwitchGraphQLAccessTokenBody | ||
import okhttp3.ResponseBody | ||
import retrofit2.Call | ||
import retrofit2.http.* | ||
|
||
interface TwitchGraphQLService { | ||
@POST("gql") | ||
@Headers("Client-ID: ${Constants.TWITCH_CLIENT_ID}") | ||
fun getAccessToken( | ||
@Body body: TwitchGraphQLAccessTokenBody = TwitchGraphQLAccessTokenBody() | ||
): LiveData<ApiResponse<TwitchAccesToken>> | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/api/TwitchUsherService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.api | ||
|
||
import androidx.lifecycle.LiveData | ||
import de.markhaehnel.rbtv.rocketbeanstv.util.Constants | ||
import de.markhaehnel.rbtv.rocketbeanstv.vo.TwitchAccesToken | ||
import okhttp3.ResponseBody | ||
import retrofit2.Call | ||
import retrofit2.http.* | ||
|
||
interface TwitchUsherService { | ||
@GET("api/channel/hls/${Constants.TWITCH_CHANNEL}.m3u8?allow_source=true&allow_audio_only=false&client_id=${Constants.TWITCH_CLIENT_ID}") | ||
fun getPlaylist( | ||
@Query("token") token: String, | ||
@Query("sig") signature: String | ||
): Call<ResponseBody> | ||
} |
15 changes: 0 additions & 15 deletions
15
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/api/YouTubeService.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/vo/StreamManifest.kt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/vo/TwitchAccesToken.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.vo | ||
|
||
/*{ | ||
"data": { | ||
"streamPlaybackAccessToken": { | ||
"value": "{\"adblock\":false,\"authorization\":{\"forbidden\":false,\"reason\":\"\"},\"blackout_enabled\":false,\"channel\":\"rocketbeanstv\",\"channel_id\":47627824,\"chansub\":{\"restricted_bitrates\":[],\"view_until\":1924905600},\"ci_gb\":false,\"geoblock_reason\":\"\",\"device_id\":null,\"expires\":1624101638,\"extended_history_allowed\":false,\"game\":\"\",\"hide_ads\":false,\"https_required\":true,\"mature\":false,\"partner\":false,\"platform\":\"web\",\"player_type\":\"embed\",\"private\":{\"allowed_to_view\":true},\"privileged\":false,\"role\":\"\",\"server_ads\":true,\"show_ads\":true,\"subscriber\":false,\"turbo\":false,\"user_id\":null,\"user_ip\":\"84.119.130.17\",\"version\":2}", | ||
"signature": "34fb8614e66d04a68dc716915740b0f2c3d676cc", | ||
"__typename": "PlaybackAccessToken" | ||
} | ||
}, | ||
"extensions": { | ||
"durationMilliseconds": 55, | ||
"operationName": "PlaybackAccessToken", | ||
"requestID": "01F8HYW0EWR1PYQN3WVSAZWMJD" | ||
} | ||
}*/ | ||
|
||
|
||
data class TwitchAccesToken( | ||
val data: TwitchAccesTokenData | ||
) | ||
|
||
data class TwitchAccesTokenData( | ||
val streamPlaybackAccessToken: TwitchStreamPlaybackAccessToken | ||
) | ||
|
||
data class TwitchStreamPlaybackAccessToken( | ||
val value: String, | ||
val signature: String | ||
) |
43 changes: 43 additions & 0 deletions
43
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/vo/TwitchGraphQLAccessTokenBody.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.vo | ||
|
||
/*{ | ||
"operationName": "PlaybackAccessToken", | ||
"extensions": { | ||
"persistedQuery": { | ||
"version": 1, | ||
"sha256Hash": "0828119ded1c13477966434e15800ff57ddacf13ba1911c129dc2200705b0712" | ||
} | ||
}, | ||
"variables": { | ||
"isLive": true, | ||
"login": "rocketbeanstv", | ||
"isVod": false, | ||
"vodID": "", | ||
"playerType": "embed" | ||
} | ||
} | ||
*/ | ||
|
||
|
||
data class TwitchGraphQLAccessTokenBody( | ||
val operationName: String = "PlaybackAccessToken", | ||
val extensions: TwitchGraphQLAccessTokenBodyExtensions = TwitchGraphQLAccessTokenBodyExtensions(TwitchGraphQLAccessTokenBodyExtensionsPersistedQuery()), | ||
val variables: TwitchGraphQLAccessTokenBodyVariables = TwitchGraphQLAccessTokenBodyVariables() | ||
) | ||
|
||
data class TwitchGraphQLAccessTokenBodyExtensions( | ||
val persistedQuery: TwitchGraphQLAccessTokenBodyExtensionsPersistedQuery | ||
) | ||
|
||
data class TwitchGraphQLAccessTokenBodyExtensionsPersistedQuery( | ||
val version: Int = 1, | ||
val sha256Hash: String = "0828119ded1c13477966434e15800ff57ddacf13ba1911c129dc2200705b0712" | ||
) | ||
|
||
data class TwitchGraphQLAccessTokenBodyVariables( | ||
val isLive: Boolean = true, | ||
val login: String = "rocketbeanstv", | ||
val isVod: Boolean = false, | ||
val vodID: String = "", | ||
val playerType: String = "embed" | ||
) |
Oops, something went wrong.