mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-03-11 17:45:40 +00:00
Scraping: Remove workaround for last-child
Last-child is not supported on SwiftSoup, but nth-last-child is. Therefore, sources must use nth-child or nth-last-child instead of the first-child and last-child aliases. Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
6cc9221fe4
commit
d3ee5c5bc9
1 changed files with 1 additions and 8 deletions
|
|
@ -106,15 +106,8 @@ class ScrapingViewModel: ObservableObject {
|
|||
let magnetHash = fetchMagnetHash(magnetLink: href)
|
||||
|
||||
var title: String?
|
||||
|
||||
// Some sources may use last-child, but SwiftSoup doesn't support it
|
||||
if let titleQuery = source.titleQuery {
|
||||
if titleQuery.contains("last-child") {
|
||||
let newTitleQuery = titleQuery.replacingOccurrences(of: ":last-child", with: "")
|
||||
title = try row.select(newTitleQuery).last()?.text()
|
||||
} else {
|
||||
title = try row.select(titleQuery).first()?.text()
|
||||
}
|
||||
title = try row.select(titleQuery).first()?.text()
|
||||
}
|
||||
|
||||
let size = try row.select(source.sizeQuery ?? "").first()
|
||||
|
|
|
|||
Loading…
Reference in a new issue