2013-03-01 41 views

回答

3

iTunes不支持HTTPS(尚未)的專輯封面或歌曲預覽。

過的工具,並鏈接到HTTPS的變化是最近(僅在四個月前): http://www.apple.com/itunes/affiliates/resources/blog/secure-links-to-itunes---content-and-tools.html

+1

它已經好幾年,因爲這個答案被接受 - 有什麼變化嗎? – 2016-10-27 00:31:36

+0

它看起來不像。我來這裏試圖找到使用ATP的應用程序中使用的https鏈接。 – Darren 2017-03-07 14:17:37

0

SO和Swift的新功能 - 無法解決這個問題,直到找到這個Q和上面的答案。以下爲我工作:

func withHTTPS() -> URL? { 
    var components = URLComponents(url: self, resolvingAgainstBaseURL: true) 
    components?.scheme = "https" 
    let host = (components?.host)! 
    components?.host = host.replacingOccurrences(of: ".", with: "-ssl.", options: .caseInsensitive, range: host.range(of: ".")) 
    return components?.url 
} 

使用稱爲:

guard let url = item.artworkURL.withHTTPS() else { return }