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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SuperMarcus/NineAnimator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ExuApplePie/NineAnimator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 21, 2022

  1. Copy the full SHA
    104be62 View commit details

Commits on Jan 22, 2022

  1. Copy the full SHA
    8ceb109 View commit details

Commits on Jan 28, 2022

  1. Copy the full SHA
    640341d View commit details
  2. Copy the full SHA
    6dc7924 View commit details
  3. Fix MonosChinos+Featured

    ExuApplePie committed Jan 28, 2022
    Copy the full SHA
    bdb44bf View commit details
  4. Copy the full SHA
    9e753fc View commit details
  5. Copy the full SHA
    2aab5fc View commit details
  6. Fix MonosChinos+Featured

    ExuApplePie committed Jan 28, 2022
    Copy the full SHA
    602423f View commit details

Commits on Feb 1, 2022

  1. Copy the full SHA
    275ea48 View commit details
  2. Revert project.pbxproj

    ExuApplePie committed Feb 1, 2022
    Copy the full SHA
    b047621 View commit details
  3. Removed print statements

    ExuApplePie committed Feb 1, 2022
    Copy the full SHA
    9db1c19 View commit details
  4. Copy the full SHA
    9e5bbe2 View commit details

Commits on May 4, 2022

  1. Copy the full SHA
    61e91ea View commit details
  2. Copy the full SHA
    6c96e65 View commit details
  3. Copy the full SHA
    4a22a9a View commit details
Original file line number Diff line number Diff line change
@@ -29,10 +29,10 @@ extension NASourceMonosChinos {
) .responseString.then {
responseContent -> Anime in
let bowl = try SwiftSoup.parse(responseContent)
let animeTitle = try bowl.select("header > .row > div > h1.Title").text()
let animeTitle = try bowl.select(".chapterdetails > h1").text()

let animeArtworkUrl = URL(
string: try bowl.select("header > .row > div:first-child > .Image > figure > img").attr("src")
string: try bowl.select(".chapterpic > img").attr("src")
) ?? link.image
let reconstructedAnimeLink = AnimeLink(
title: animeTitle,
@@ -42,9 +42,9 @@ extension NASourceMonosChinos {
)

// Obtain the list of episodes
let episodeList = try bowl.select(".SerieCaps > a").compactMap {
let episodeList = try bowl.select(".allanimes > .row > .col-item").compactMap {
episodeElement -> (identifier: String, episodeName: String) in
let episodeIdentifier = try episodeElement.attr("href")
let episodeIdentifier = try episodeElement.select("a").attr("href")
let episodeName = try episodeElement.text()
.trimmingCharacters(in: .whitespacesAndNewlines)
return (episodeIdentifier, episodeName)
@@ -57,24 +57,23 @@ extension NASourceMonosChinos {
// Collection of episodes
var episodeCollection = Anime.EpisodesCollection()
var episodeAttributes = [EpisodeLink: Anime.AdditionalEpisodeLinkInformation]()

for (serverIdentifier, _) in NASourceMonosChinos.knownServers {
var currentCollection = [EpisodeLink]()

for (episodeIdentifier, episodeName) in episodeList {
var conventionalEpisodeName = episodeName

let matchingRegex = try NSRegularExpression(
pattern: "(\\d+)\\sSub|Latino\\s(\\d+)",
pattern: "(\\d+)",
options: [.caseInsensitive]
)
// error in tryUnwrap()
let episodeNumberMatch = try matchingRegex
.firstMatch(in: episodeName)
.tryUnwrap()
.firstMatchingGroup
.tryUnwrap()
let inferredEpisodeNumber = Int(episodeNumberMatch)

if let eNumber = inferredEpisodeNumber {
conventionalEpisodeName = "\(eNumber) - \(episodeName)"
}
@@ -100,22 +99,22 @@ extension NASourceMonosChinos {

episodeCollection[serverIdentifier] = currentCollection.reversed()
}

// Information
let animeSynopsis = try bowl
.select("header > .row > div > .Description > p")
.text()
.trimmingCharacters(in: .whitespacesAndNewlines)

// Attributes
var additionalAnimeAttributes = [Anime.AttributeKey: Any]()
let date = try bowl
let additionalAnimeAttributes = [Anime.AttributeKey: Any]() /*
// let date = try bowl
.select("header > .row > div > .after-title")
.text()
.trimmingCharacters(in: .whitespacesAndNewlines)
.components(separatedBy: " ")
.components(separatedBy: " ") */

additionalAnimeAttributes[.airDate] = date[1]
// additionalAnimeAttributes[.airDate] = date[0]

return Anime(
reconstructedAnimeLink,
Original file line number Diff line number Diff line change
@@ -21,6 +21,15 @@ import Foundation
import NineAnimatorCommon
import SwiftSoup

// server constants, probably a much better way to do this
let FEMBED = "Fembed"
let UQLOAD = "uqload"
let PLAYERSB = "playersb"
let STREAMTAPE = "streamtape"
let VIDEOBIN = "videobin"
let MP4UPLOAD = "mp4upload"
let serverList = [FEMBED, UQLOAD, PLAYERSB, STREAMTAPE, VIDEOBIN, MP4UPLOAD]

extension NASourceMonosChinos {
static let knownServers = [
"Cloud": "MonosChinos",
@@ -29,11 +38,11 @@ extension NASourceMonosChinos {
"Clipwatching": "ClipWatching",
"Uqload": "Uqload",
"Mp4upload": "Mp4Upload",
// "Ok": "Ok", Note: Commenting for now
// "Ok": "Ok", Note: Commenting for now
"Videobin": "Videobin",
"Senvid2": "SendVid"
]

func episode(from link: EpisodeLink, with anime: Anime) -> NineAnimatorPromise<Episode> {
NineAnimatorPromise.firstly {
URL(string: link.identifier)
@@ -47,22 +56,40 @@ extension NASourceMonosChinos {
episodeUrl, responseContent in

let bowl = try SwiftSoup.parse(responseContent)
let playerId = try bowl.select("li[title=\(link.server)]").attr("data-tplayernv")

var encodedPlayerId = ""; // because variable can't be guaranteed to have a value, needs further fixing from the loop below

let episodeList = try bowl.select("#play-video > a").compactMap {
episodeElement -> (serverId: String, sourceId: String) in
let serverName = try episodeElement.text()
let dataPlayerId = try episodeElement.attr("data-player")

return (serverName, dataPlayerId )
}

for (serverName, dataPlayerId) in episodeList {
for server in serverList {
// link.server is the server the NineAnimator user selected
if serverName.caseInsensitiveCompare(server) == .orderedSame && link.server.caseInsensitiveCompare(server) == .orderedSame {
encodedPlayerId = dataPlayerId
}
}
}

let decodedData = Data(base64Encoded: encodedPlayerId)!
let decodedString = String(data: decodedData, encoding: .utf8)!

// Check if server is available for this episode
guard !playerId.isEmpty else {
guard !encodedPlayerId.isEmpty else {
throw NineAnimatorError.responseError("This episode is not available on the selected server")
}

let playerElement = try bowl.select("#\(playerId)").html()

let urlMatchingRegex = try NSRegularExpression(
pattern: "\\?url=(.*)(?:&amp;|&)id",
pattern: "\\?url=(.*)",
options: []
)

let urlParamMatch = try urlMatchingRegex
.firstMatch(in: playerElement)
.firstMatch(in: decodedString)
.tryUnwrap(.responseError("Cannot find a valid URL to the resource"))
.firstMatchingGroup
.tryUnwrap()
Original file line number Diff line number Diff line change
@@ -26,18 +26,18 @@ extension NASourceMonosChinos {
self.requestManager.request("/emision", handling: .browsing).responseString.then {
responseContent in
let bowl = try SwiftSoup.parse(responseContent)
let seasonAnime = try bowl.select(".container > .row > article > a").map {
let seasonAnime = try bowl.select(".heromain > .row > div > a").map {
animeContainer -> AnimeLink in
let artworkUrl = URL(
string: try animeContainer.select(".Image > figure > img").attr("src")
string: try animeContainer.select(".series > .seriesimg > img").attr("src")
) ?? NineAnimator.placeholderArtworkUrl

let animeLink = try URL(
string: try animeContainer.select("a").attr("href")
).tryUnwrap()

let animeTitle = try animeContainer
.select("h3.Title")
.select("h5.seristitles")
.text()
.trimmingCharacters(in: .whitespacesAndNewlines)

Original file line number Diff line number Diff line change
@@ -41,17 +41,17 @@ extension NASourceMonosChinos {
func more() {
if performingTask == nil {
performingTask = parent.requestManager.request(
"/search",
"/buscar",
handling: .browsing,
query: [ "q": title ]
) .responseString.then {
[parent] responseContent -> [AnimeLink]? in
try SwiftSoup.parse(responseContent)
.select(".row > article > a")
.select(".row > div > a")
.compactMap {
container -> AnimeLink? in
if let imageContainer = try container.select(".cover > img").first(),
let titleContainer = try container.select("h3.Title").first() {
if let imageContainer = try container.select(".series > .seriesimg > img").first(),
let titleContainer = try container.select("h5.seristitles").first() {
let animeTitle = titleContainer
.ownText()
.trimmingCharacters(in: .whitespacesAndNewlines)
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ public enum NativeSources {
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)