mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 00:22:12 +00:00
Hmm
This commit is contained in:
parent
6b4fe44fb3
commit
2effc7bf0b
3 changed files with 28 additions and 8 deletions
|
|
@ -102,11 +102,19 @@ extension JSController {
|
||||||
|
|
||||||
if let qualityURL = URL(string: selectedQuality.url) {
|
if let qualityURL = URL(string: selectedQuality.url) {
|
||||||
let qualityRequest = DownloadRequest(
|
let qualityRequest = DownloadRequest(
|
||||||
url: qualityURL, headers: request.headers, title: request.title,
|
url: qualityURL,
|
||||||
imageURL: request.imageURL, isEpisode: request.isEpisode,
|
headers: request.headers,
|
||||||
showTitle: request.showTitle, season: request.season,
|
title: request.title,
|
||||||
episode: request.episode, subtitleURL: request.subtitleURL,
|
imageURL: request.imageURL,
|
||||||
showPosterURL: request.showPosterURL
|
isEpisode: request.isEpisode,
|
||||||
|
showTitle: request.showTitle,
|
||||||
|
season: request.season,
|
||||||
|
episode: request.episode,
|
||||||
|
subtitleURL: request.subtitleURL,
|
||||||
|
showPosterURL: request.showPosterURL,
|
||||||
|
aniListID: request.aniListID,
|
||||||
|
malID: request.malID,
|
||||||
|
isFiller: request.isFiller
|
||||||
)
|
)
|
||||||
self.downloadWithOriginalMethod(request: qualityRequest, completionHandler: completionHandler)
|
self.downloadWithOriginalMethod(request: qualityRequest, completionHandler: completionHandler)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -422,6 +430,9 @@ extension JSController {
|
||||||
episode: request.episode,
|
episode: request.episode,
|
||||||
subtitleURL: request.subtitleURL,
|
subtitleURL: request.subtitleURL,
|
||||||
showPosterURL: request.showPosterURL,
|
showPosterURL: request.showPosterURL,
|
||||||
|
aniListID: request.aniListID,
|
||||||
|
malID: request.malID,
|
||||||
|
isFiller: request.isFiller,
|
||||||
completionHandler: completionHandler
|
completionHandler: completionHandler
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,9 @@ extension JSController {
|
||||||
subtitleURL: URL? = nil,
|
subtitleURL: URL? = nil,
|
||||||
showPosterURL: URL? = nil,
|
showPosterURL: URL? = nil,
|
||||||
module: ScrapingModule? = nil,
|
module: ScrapingModule? = nil,
|
||||||
|
aniListID: Int? = nil,
|
||||||
|
malID: Int? = nil,
|
||||||
|
isFiller: Bool? = nil,
|
||||||
completionHandler: ((Bool, String) -> Void)? = nil
|
completionHandler: ((Bool, String) -> Void)? = nil
|
||||||
) {
|
) {
|
||||||
// If a module is provided, use the stream type aware download
|
// If a module is provided, use the stream type aware download
|
||||||
|
|
@ -131,6 +134,9 @@ extension JSController {
|
||||||
episode: episode,
|
episode: episode,
|
||||||
subtitleURL: subtitleURL,
|
subtitleURL: subtitleURL,
|
||||||
showPosterURL: showPosterURL,
|
showPosterURL: showPosterURL,
|
||||||
|
aniListID: aniListID,
|
||||||
|
malID: malID,
|
||||||
|
isFiller: isFiller,
|
||||||
completionHandler: completionHandler
|
completionHandler: completionHandler
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
@ -177,7 +183,10 @@ extension JSController {
|
||||||
subtitleURL: subtitleURL,
|
subtitleURL: subtitleURL,
|
||||||
asset: asset,
|
asset: asset,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
module: module
|
module: module,
|
||||||
|
aniListID: aniListID,
|
||||||
|
malID: malID,
|
||||||
|
isFiller: isFiller
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add to the download queue
|
// Add to the download queue
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ extension JSController {
|
||||||
let streamType = module.metadata.streamType.lowercased()
|
let streamType = module.metadata.streamType.lowercased()
|
||||||
|
|
||||||
if streamType == "hls" || streamType == "m3u8" || url.absoluteString.contains(".m3u8") {
|
if streamType == "hls" || streamType == "m3u8" || url.absoluteString.contains(".m3u8") {
|
||||||
Logger.shared.log("Using HLS download method")
|
Logger.shared.log("Using HLS download method", type: "Download")
|
||||||
downloadWithM3U8Support(
|
downloadWithM3U8Support(
|
||||||
url: url,
|
url: url,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
|
|
@ -62,7 +62,7 @@ extension JSController {
|
||||||
completionHandler: completionHandler
|
completionHandler: completionHandler
|
||||||
)
|
)
|
||||||
}else {
|
}else {
|
||||||
Logger.shared.log("Using MP4 download method")
|
Logger.shared.log("Using MP4 download method", type: "Download")
|
||||||
downloadMP4(
|
downloadMP4(
|
||||||
url: url,
|
url: url,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue