Skip to content

Commit 526a7c5

Browse files
committed
fix ysp
1 parent 960f890 commit 526a7c5

File tree

5 files changed

+106
-50
lines changed

5 files changed

+106
-50
lines changed

app/src/main/java/com/lizongying/mytv/Request.kt

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Request {
4141

4242
private val regex = Regex("""des_key = "([^"]+).+var des_iv = "([^"]+)""")
4343
private val input =
44-
"""{"mver":"1","subver":"1.2","host":"www.yangshipin.cn/#/tv/home?pid=","referer":"","canvas":"YSPANGLE(Apple,AppleM1Pro,OpenGL4.1)"}""".toByteArray()
44+
"""{"mver":"1","subver":"1.2","host":"www.yangshipin.cn/#/tv/home?pid=","referer":"","canvas":"YSPANGLE(Apple,ANGLEMetalRenderer:AppleM1Pro,UnspecifiedVersion)"}""".toByteArray()
4545

4646
private var mapping = mapOf(
4747
"CCTV4K" to "CCTV4K 超高清",
@@ -118,6 +118,7 @@ class Request {
118118
override fun onResponse(call: Call<LiveInfo>, response: Response<LiveInfo>) {
119119
if (response.isSuccessful) {
120120
val liveInfo = response.body()
121+
121122
if (liveInfo?.data?.playurl != null) {
122123
val chanll = liveInfo.data.chanll
123124
val decodedBytes = Base64.decode(
@@ -133,8 +134,8 @@ class Request {
133134
val url = liveInfo.data.playurl + "&revoi=" + encryptTripleDES(
134135
keyBytes + byteArrayOf(0, 0, 0, 0, 0, 0, 0, 0),
135136
ivBytes
136-
).uppercase()
137-
// Log.d(TAG, "$title url $url")
137+
).uppercase() + liveInfo.data.extended_param
138+
Log.d(TAG, "$title url $url")
138139
tvModel.addVideoUrl(url)
139140
tvModel.allReady()
140141
tvModel.retryTimes = 0
@@ -354,29 +355,21 @@ class Request {
354355
) {
355356
if (response.isSuccessful) {
356357
val body = response.body()
357-
358358
if (body?.data?.feedModuleListCount == 1) {
359359
for (item in body.data?.feedModuleListList!![0]?.dataTvChannelListList!!) {
360-
if (item.isVip && !item.isLimitedFree) {
361-
continue
362-
}
363-
Log.i(
360+
Log.d(
364361
TAG,
365362
"${item.channelName},${item.pid},${item.streamId}"
366363
)
367-
var channelType = "央视频道"
368-
if (item?.channelType === "weishi") {
369-
channelType = "地方频道"
370-
}
371-
if (!mapping.containsKey(item.channelName)) {
372-
continue
373-
}
374-
val tv =
375-
TVList.list?.get(channelType)?.find { it.title == mapping[item.channelName] }
376-
if (tv != null) {
377-
tv.logo = item.tvLogo
378-
tv.pid = item.pid
379-
tv.sid = item.streamId
364+
365+
for ((_, v) in TVList.list) {
366+
for (v2 in v) {
367+
Log.i(TAG, "$v2")
368+
if (v2.title == item.channelName || v2.alias == item.channelName) {
369+
v2.pid = item.pid
370+
v2.sid = item.streamId
371+
}
372+
}
380373
}
381374
}
382375
}

app/src/main/java/com/lizongying/mytv/TV.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ import java.io.Serializable
55
data class TV(
66
var id: Int = 0,
77
var title: String,
8+
var alias: String = "",
89
var videoUrl: List<String>,
910
var videoIndex: Int = 0,
1011
var channel: String = "",
1112
var logo: String = "",
1213
var pid: String = "",
1314
var sid: String = "",
1415
var programId: String = "",
15-
var needToken:Boolean=false,
16-
var mustToken:Boolean=false,
16+
var needToken: Boolean = false,
17+
var mustToken: Boolean = false,
1718

18-
) : Serializable {
19+
) : Serializable {
1920

2021
override fun toString(): String {
2122
return "TV{" +

0 commit comments

Comments
 (0)