diff --git a/Sources/YouTubeKit/Extensions/URLSessionDelegates.swift b/Sources/YouTubeKit/Extensions/URLSessionDelegates.swift index 2cc1fcf..9e7183e 100644 --- a/Sources/YouTubeKit/Extensions/URLSessionDelegates.swift +++ b/Sources/YouTubeKit/Extensions/URLSessionDelegates.swift @@ -13,7 +13,11 @@ final class ConfigurableURLSessionDelegate: NSObject, URLSessionTaskDelegate { let applyCookiesOnRedirect: Bool let saveIntermediateResponses: Bool +#if swift(>=5.10) nonisolated(unsafe) var intermediateResponses = [HTTPURLResponse]() +#else + var intermediateResponses = [HTTPURLResponse]() +#endif init(allowsRedirect: Bool, applyCookiesOnRedirect: Bool, saveIntermediateResponses: Bool) { self.allowsRedirects = allowsRedirect diff --git a/Sources/YouTubeKit/YouTube.swift b/Sources/YouTubeKit/YouTube.swift index 6f65de6..9f8e020 100644 --- a/Sources/YouTubeKit/YouTube.swift +++ b/Sources/YouTubeKit/YouTube.swift @@ -14,8 +14,13 @@ public class YouTube { private var _js: String? private var _jsURL: URL? +#if swift(>=5.10) nonisolated(unsafe) private static var __js: String? // caches js between calls nonisolated(unsafe) private static var __jsURL: URL? +#else + private static var __js: String? // caches js between calls + private static var __jsURL: URL? +#endif private var _videoInfos: [InnerTube.VideoInfo]?