1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 22:30:32 +05:30

Fix parsing timestamps with Piped

This commit is contained in:
Arkadiusz Fal 2022-08-23 19:46:36 +02:00
parent 98aa1b140b
commit 4dbdd00829
2 changed files with 13 additions and 4 deletions

View File

@ -515,6 +515,8 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
return matchingGroup return matchingGroup
} }
description = description.replacingOccurrences(of: "&", with: "&")
description = description.replacingOccurrences( description = description.replacingOccurrences(
of: "<[^>]+>", of: "<[^>]+>",
with: "", with: "",

View File

@ -122,12 +122,19 @@ struct VideoDescription: View {
if var components = URLComponents(url: url, resolvingAgainstBaseURL: false) { if var components = URLComponents(url: url, resolvingAgainstBaseURL: false) {
components.scheme = "yattee" components.scheme = "yattee"
if let yatteeURL = components.url, if let yatteeURL = components.url {
URLParser(url: urlToOpen).destination != nil let parser = URLParser(url: urlToOpen)
if parser.destination == .video,
parser.videoID == player.currentVideo?.videoID,
let time = parser.time
{ {
player.backend.seek(to: Double(time))
return
} else {
urlToOpen = yatteeURL urlToOpen = yatteeURL
} }
} }
}
openURL(urlToOpen) openURL(urlToOpen)
} }