* 加密链接 * @param {string} puDataURL - 加密前链接 * @param {string} programId - 节目ID * @param {string} clientType - 客户端类型 h5 android * @param {string} rateType - 清晰度 2:标清 3:高清 4:蓝光 * @returns {string} - 加密链接
(puDataURL, programId, clientType, rateType, urlUserId)
| 173 | * @returns {string} - 加密链接 |
| 174 | */ |
| 175 | function getddCalcuURL(puDataURL, programId, clientType, rateType, urlUserId) { |
| 176 | |
| 177 | if (puDataURL == null || puDataURL == undefined) { |
| 178 | return "" |
| 179 | } |
| 180 | |
| 181 | if (programId == null || programId == undefined) { |
| 182 | return "" |
| 183 | } |
| 184 | |
| 185 | if (clientType != "android" && clientType != "h5") { |
| 186 | return "" |
| 187 | } |
| 188 | |
| 189 | if (rateType == null || rateType == undefined) { |
| 190 | return "" |
| 191 | } |
| 192 | |
| 193 | const puData = puDataURL.split("&puData=")[1] |
| 194 | const ddCalcu = getddCalcu(puData, programId, clientType, rateType, urlUserId) |
| 195 | const suffix = list[clientType].suffix |
| 196 | |
| 197 | return `${puDataURL}&ddCalcu=${ddCalcu}${suffix}` |
| 198 | } |
| 199 | |
| 200 | |
| 201 | /** |
no test coverage detected