Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Revert Disable 4Anime and Pantsubase
Browse files Browse the repository at this point in the history
  • Loading branch information
ExuApplePie committed May 4, 2022
1 parent 9db1c19 commit 61e91ea
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import SwiftSoup

extension NASourceFourAnime {
func anime(from link: AnimeLink) -> NineAnimatorPromise<Anime> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))/*
(self.isAnimeLink(url: link.link) ? .success(link) : self.resolveAnimeLink(
from: link.link,
artworkUrl: link.image
Expand Down Expand Up @@ -147,6 +146,6 @@ extension NASourceFourAnime {

/// Checks if the provided link points to an anime page
private func isAnimeLink(url: URL) -> Bool {
url.pathComponents.contains("anime")*/
url.pathComponents.contains("anime")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ import Foundation
import NineAnimatorCommon
import SwiftSoup

extension NASourceFourAnime {/*
extension NASourceFourAnime {
/// 4anime provides multiple links for each episode, however they are not shown to the user
static let knownServers = [
"server1": "Server 1",
"server2": "Server 2",
"server3": "Server 3",
"server4": "Server 4"
]*/
]

func episode(from link: EpisodeLink, with anime: Anime) -> NineAnimatorPromise<Episode> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))/*
NineAnimatorPromise.firstly {
try URL(string: link.identifier).tryUnwrap()
} .thenPromise {
Expand Down Expand Up @@ -145,6 +144,6 @@ extension NASourceFourAnime {/*
]
]
)
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import SwiftSoup

extension NASourceFourAnime {
func featured() -> NineAnimatorPromise<FeaturedContainer> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))
/*
requestManager.request("/", handling: .browsing).responseString.then {
responseContent in
let endpointURL = self.endpointURL
Expand Down Expand Up @@ -84,6 +82,6 @@ extension NASourceFourAnime {
featured: popularAnimeLinks,
latest: recentAnimeLinks
)
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ extension NASourceFourAnime {
)

func link(from url: URL) -> NineAnimatorPromise<AnyLink> {
.fail()/*
NineAnimatorPromise<URL>.firstly {
let urlString = url.absoluteString

Expand Down Expand Up @@ -65,6 +64,6 @@ extension NASourceFourAnime {
image: animeArtworkUrl,
source: self
))
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with NineAnimator. If not, see <http://www.gnu.org/licenses/>.
//
/*

import Foundation
import Kingfisher
import NineAnimatorCommon
Expand All @@ -35,4 +35,3 @@ extension NASourceFourAnime: Kingfisher.ImageDownloadRequestModifier {
return modifiedRequest
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension NASourceFourAnime {
page == 0 ? _results?.map { .anime($0) } ?? [] : []
}

func more() { /*
func more() {
if performingTask == nil {
performingTask = parent.requestManager.request(
url: self.encodedW3CQueryUrl,
Expand Down Expand Up @@ -99,7 +99,7 @@ extension NASourceFourAnime {
self._results = $0
self.delegate?.pageIncoming(0, from: self)
}
}*/
}
}

private var encodedW3CQueryUrl: URL {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import AppKit
class NASourceFourAnime: BaseSource, Source, PromiseSource {
var name: String { "4anime.to" }

// 4anime is no longer available
override var isEnabled: Bool { false }

var aliases: [String] { [] }

#if canImport(UIKit)
Expand All @@ -58,12 +55,13 @@ class NASourceFourAnime: BaseSource, Source, PromiseSource {
super.init(with: parent)

// Setup Kingfisher request modifier
// setupGlobalRequestModifier()
setupGlobalRequestModifier()
}

func suggestProvider(episode: Episode, forServer server: Anime.ServerIdentifier, withServerName name: String) -> VideoProviderParser? {
DummyParser.registeredInstance
}
NASourceFourAnime.knownServers.keys.contains(server)
? DummyParser.registeredInstance : nil
}

override func recommendServer(for anime: Anime) -> Anime.ServerIdentifier? {
recommendServers(for: anime, ofPurpose: .playback).first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import NineAnimatorCommon

extension NASourcePantsubase {
func anime(from link: AnimeLink) -> NineAnimatorPromise<Anime> {
.fail(.contentUnavailableError("Pantsubase is no longer available on NineAnimator"))/*
requestManager.request(url: link.link)
.responseBowl
.then {
Expand Down Expand Up @@ -101,6 +100,6 @@ extension NASourcePantsubase {
on: NASourcePantsubase.knownServers,
episodes: episodeCollection
)
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
import Foundation
import NineAnimatorCommon

extension NASourcePantsubase {/*
extension NASourcePantsubase {
static let knownServers = [
"pantsudrive": "Pantsudrive" // These names lol
]
*/

func episode(from link: EpisodeLink, with anime: Anime) -> NineAnimatorPromise<Episode> {
.fail(.contentUnavailableError("Pantsubase is no longer available on NineAnimator")) /*
requestManager.request(url: link.identifier)
.responseBowl
.then {
Expand All @@ -46,6 +45,6 @@ extension NASourcePantsubase {/*
target: iFrameURL,
parent: anime
)
} */
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import NineAnimatorCommon

extension NASourcePantsubase {
func featured() -> NineAnimatorPromise<FeaturedContainer> {
.fail(.contentUnavailableError("Pantsubase is no longer available on NineAnimator"))/*
self.requestManager.request(endpoint)
.responseBowl
.then { bowl in
Expand Down Expand Up @@ -57,6 +56,6 @@ extension NASourcePantsubase {
)
}
return BasicFeaturedContainer(featured: [], latest: links)
}*/
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension NASourcePantsubase {
page == 0 ? _results?.map { .anime($0) } ?? [] : []
}

func more() {/*
func more() {
if performingTask == nil {
performingTask = parent.requestManager.request(
url: parent.endpointURL.appendingPathComponent("/search"),
Expand Down Expand Up @@ -96,7 +96,7 @@ extension NASourcePantsubase {
self._results = $0
self.delegate?.pageIncoming(0, from: self)
}
}*/
}
}

init(_ query: String, withParent parent: NASourcePantsubase) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import AppKit
class NASourcePantsubase: BaseSource, Source, PromiseSource {
var name: String { "pantsubase.tv" }

// Disable for now
override var isEnabled: Bool { false }

var aliases: [String] { [] }

#if canImport(UIKit)
Expand Down
10 changes: 6 additions & 4 deletions Modules/Sources/NineAnimatorNativeSources/NativeSources.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,31 @@ public enum NativeSources {
let registry = NineAnimator.default

registry.register(sourceType: NASourceAnimePahe.self)
registry.register(sourceType: NASourceFourAnime.self)
registry.register(sourceType: NASourceAnimeTwist.self)
registry.register(sourceType: NASourcePantsubase.self)
registry.register(sourceType: NASourceAnimeUltima.self)
registry.register(sourceType: NASourceAnimeKisa.self)
registry.register(sourceType: NASourceAnimeKisa.ExperimentalSource.self)
registry.register(sourceType: NASourceHAnime.self)
registry.register(sourceType: NASourceGogoAnime.self)
registry.register(sourceType: NASourceAnimeDao.self)
registry.register(sourceType: NASourceAnimeHub.self)
registry.register(sourceType: NASourceArrayanime.self)
registry.register(sourceType: NASourceKissanime.self)
registry.register(sourceType: NASourceAnimeUnity.self)
registry.register(sourceType: NASourceMonosChinos.self)
registry.register(sourceType: NASourceAnimeSaturn.self)
registry.register(sourceType: NASourceAnimeWorld.self)
registry.register(sourceType: NASourceZoroAnime.self)
registry.register(sourceType: NASourceHentaiWorld.self)

// Disabled sources
registry.register(sourceType: NASourceWonderfulSubs.self)
registry.register(sourceType: NASourceMasterAnime.self)
registry.register(sourceType: NASourceNineAnime.self)
registry.register(sourceType: NASourceAniwatch.self)
registry.register(sourceType: NASourcePantsubase.self)
registry.register(sourceType: NASourceFourAnime.self)

registry.register(sourceType: NASourceArrayanime.self)

initialized = true
}
}

0 comments on commit 61e91ea

Please sign in to comment.