Skip to content

Commit d5d1ecc

Browse files
committed
c3tv: make video links share-able to browser
1 parent 0502df8 commit d5d1ecc

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

C3TV/src/main/kotlin/com/bnyro/MediaCCC.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ open class MediaCCC : MainAPI() {
4141
private fun Event.toSearchResponse(): SearchResponse {
4242
return newMovieSearchResponse(
4343
name = this.title,
44-
url = Link(this.frontendLink, this.guid).toJson(),
44+
url = this.frontendLink,
4545
type = TvType.Others,
4646
) {
4747
this.posterUrl = this@toSearchResponse.thumbUrl
@@ -58,9 +58,9 @@ open class MediaCCC : MainAPI() {
5858
}
5959

6060
override suspend fun load(url: String): LoadResponse? {
61-
val guid = parseJson<Link>(url).guid
61+
val slug = url.substringAfterLast("/")
6262

63-
val response = app.get("${mainUrl}/public/events/${guid}")
63+
val response = app.get("${mainUrl}/public/events/${slug}")
6464
.parsed<Event>()
6565

6666
return newMovieLoadResponse(
@@ -112,11 +112,6 @@ open class MediaCCC : MainAPI() {
112112
return true
113113
}
114114

115-
data class Link(
116-
val link: String? = null,
117-
val guid: String? = null,
118-
)
119-
120115
data class EventsResponse(
121116
val events: List<Event>,
122117
)

0 commit comments

Comments
 (0)