mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
changed the header
This commit is contained in:
parent
f3a7868784
commit
613c26ec63
2 changed files with 13 additions and 10 deletions
|
@ -1656,12 +1656,13 @@ class PlayerFragment : Fragment() {
|
|||
setUserAgent(USER_AGENT)
|
||||
if (currentUrl != null) {
|
||||
val headers = mapOf(
|
||||
"Referer" to currentUrl.referer,
|
||||
"referer" to currentUrl.referer,
|
||||
"accept" to "*/*",
|
||||
"sec-ch-ua" to "\"Chromium\";v=\"91\", \" Not;A Brand\";v=\"99\"",
|
||||
"sec-ch-ua-mobile" to "?0",
|
||||
"Sec-Fetch-User" to "?1",
|
||||
"Sec-Fetch-Mode" to "navigate",
|
||||
"Sec-Fetch-Dest" to "document"
|
||||
"sec-fetch-user" to "?1",
|
||||
"sec-fetch-mode" to "navigate",
|
||||
"sec-fetch-dest" to "video"
|
||||
)
|
||||
setDefaultRequestProperties(headers)
|
||||
}
|
||||
|
|
|
@ -596,19 +596,21 @@ object VideoDownloadManager {
|
|||
// SET CONNECTION SETTINGS
|
||||
connection.connectTimeout = 10000
|
||||
connection.setRequestProperty("Accept-Encoding", "identity")
|
||||
connection.setRequestProperty("User-Agent", USER_AGENT)
|
||||
if (link.referer.isNotEmpty()) connection.setRequestProperty("Referer", link.referer)
|
||||
connection.setRequestProperty("user-agent", USER_AGENT)
|
||||
if (link.referer.isNotEmpty()) connection.setRequestProperty("referer", link.referer)
|
||||
|
||||
// extra stuff
|
||||
connection.setRequestProperty(
|
||||
"sec-ch-ua",
|
||||
"\"Chromium\";v=\"91\", \" Not;A Brand\";v=\"99\""
|
||||
)
|
||||
|
||||
connection.setRequestProperty("sec-ch-ua-mobile", "?0")
|
||||
connection.setRequestProperty("accept", "*/*")
|
||||
// dataSource.setRequestProperty("Sec-Fetch-Site", "none") //same-site
|
||||
connection.setRequestProperty("Sec-Fetch-User", "?1")
|
||||
connection.setRequestProperty("Sec-Fetch-Mode", "navigate")
|
||||
connection.setRequestProperty("Sec-Fetch-Dest", "document")
|
||||
connection.setRequestProperty("sec-fetch-user", "?1")
|
||||
connection.setRequestProperty("sec-fetch-mode", "navigate")
|
||||
connection.setRequestProperty("sec-fetch-dest", "video")
|
||||
|
||||
if (resume)
|
||||
connection.setRequestProperty("Range", "bytes=${fileLength}-")
|
||||
|
@ -948,7 +950,7 @@ object VideoDownloadManager {
|
|||
ep: DownloadEpisodeMetadata,
|
||||
links: List<ExtractorLink>
|
||||
) {
|
||||
if(context == null) return
|
||||
if (context == null) return
|
||||
val validLinks = links.filter { !it.isM3u8 }
|
||||
if (validLinks.isNotEmpty()) {
|
||||
downloadFromResume(context, DownloadResumePackage(DownloadItem(source, folder, ep, validLinks), null))
|
||||
|
|
Loading…
Reference in a new issue