diff --git a/.jazzy.yaml b/.jazzy.yaml index fc675821..2c74cbaa 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -4,11 +4,11 @@ source_directory: XCDYouTubeKit framework_root: . umbrella_header: XCDYouTubeKit/XCDYouTubeKit.h module: XCDYouTubeKit -module_version: 2.14.0 +module_version: 2.14.1 author: Cédric Luthi author_url: https://twitter.com/0xced readme: README.md github_url: https://github.com/0xced/XCDYouTubeKit -github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.14.0/XCDYouTubeKit +github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.14.1/XCDYouTubeKit diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d95a87..29ba3118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#### Version 2.14.1 + +* Adaptation to YouTube API change. (#487) + #### Version 2.14.0 * Add new `XCDYouTubeErrorEmptyResponse` error (#479) diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj index a8d4469d..5252bcab 100644 --- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj +++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj @@ -760,7 +760,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 2.14.0; + CURRENT_PROJECT_VERSION = 2.14.1; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -804,7 +804,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 2.14.0; + CURRENT_PROJECT_VERSION = 2.14.1; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; diff --git a/XCDYouTubeKit Demo/iOS Demo/AVPlayerViewControllerManager.swift b/XCDYouTubeKit Demo/iOS Demo/AVPlayerViewControllerManager.swift index 041a24a1..53eaeb18 100644 --- a/XCDYouTubeKit Demo/iOS Demo/AVPlayerViewControllerManager.swift +++ b/XCDYouTubeKit Demo/iOS Demo/AVPlayerViewControllerManager.swift @@ -57,7 +57,8 @@ extension UIView { self.controller.player = self.player return } - self.player = AVPlayer(url: video.streamURL) + guard let streamURL = video.streamURL else { fatalError("No stream URL")} + self.player = AVPlayer(url: streamURL) self.controller.player = self.player } } diff --git a/XCDYouTubeKit.podspec b/XCDYouTubeKit.podspec index dbac6b0f..ee8bba4e 100644 --- a/XCDYouTubeKit.podspec +++ b/XCDYouTubeKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "XCDYouTubeKit" - s.version = "2.14.0" + s.version = "2.14.1" s.summary = "YouTube video player for iOS and OS X." s.homepage = "https://github.com/0xced/XCDYouTubeKit" s.screenshot = "https://raw.github.com/0xced/XCDYouTubeKit/#{s.version}/Screenshots/XCDYouTubeVideoPlayerViewController.png" diff --git a/XCDYouTubeKit.xcodeproj/project.pbxproj b/XCDYouTubeKit.xcodeproj/project.pbxproj index 70fb5a6c..012da4cb 100644 --- a/XCDYouTubeKit.xcodeproj/project.pbxproj +++ b/XCDYouTubeKit.xcodeproj/project.pbxproj @@ -663,10 +663,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 2.0.0; - DYLIB_CURRENT_VERSION = 2.14.0; + DYLIB_CURRENT_VERSION = 2.14.1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -741,10 +741,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 48; + CURRENT_PROJECT_VERSION = 49; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 2.0.0; - DYLIB_CURRENT_VERSION = 2.14.0; + DYLIB_CURRENT_VERSION = 2.14.1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/XCDYouTubeKit/XCDYouTubePlayerScript.m b/XCDYouTubeKit/XCDYouTubePlayerScript.m index aee12793..8fd23722 100644 --- a/XCDYouTubeKit/XCDYouTubePlayerScript.m +++ b/XCDYouTubeKit/XCDYouTubePlayerScript.m @@ -77,7 +77,7 @@ - (instancetype) initWithString:(NSString *)string customPatterns:(NSArray*hardCodedPatterns = @[ @"\\b[cs]\\s*&&\\s*[adf]\\.set\\([^,]+\\s*,\\s*encodeURIComponent\\s*\\(\\s*([a-zA-Z0-9$]+)\\(", @"\\b[a-zA-Z0-9]+\\s*&&\\s*[a-zA-Z0-9]+\\.set\\([^,]+\\s*,\\s*encodeURIComponent\\s*\\(\\s*([a-zA-Z0-9$]+)\\(", - @"\\b([a-zA-Z0-9$]{2})\\s*=\\s*function\\(\\s*a\\s*\\)\\s*\\{\\s*a\\s*=\\s*a\\.split\\(\\s*\"\"\\s*\\)", + @"(?:\\b|[^a-zA-Z0-9$])([a-zA-Z0-9$]{2})\\s*=\\s*function\\(\\s*a\\s*\\)\\s*\\{\\s*a\\s*=\\s*a\\.split\\(\\s*\"\"\\s*\\)", @"([a-zA-Z0-9$]+)\\s*=\\s*function\\(\\s*a\\s*\\)\\s*\\{\\s*a\\s*=\\s*a\\.split\\(\\s*\"\"\\s*\\)", /*The rest patterns are supposed to be obsolete but I am keep them here in case some older pattern matches the YouTube API in the future *IMPORTANT: Please note that the patterns above should be placed in the same order as seen in youtube-dl here: https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/youtube.py#L1344 diff --git a/XCDYouTubeKit/XCDYouTubeVideo.h b/XCDYouTubeKit/XCDYouTubeVideo.h index 17c23fca..067d7c12 100644 --- a/XCDYouTubeKit/XCDYouTubeVideo.h +++ b/XCDYouTubeKit/XCDYouTubeVideo.h @@ -129,10 +129,10 @@ extern NSString *const XCDYouTubeVideoQualityHTTPLiveStreaming; /** -* A streamURL that is compatible on Apple devices. +* A streamURL that is compatible on Apple devices (can be `nil`) * The `streamURLs` may contain both video and audio streams, some video streams do not contain any audio. This property will return a video stream that contains both audio and video with a maximum video quality of 720p in the case of videos that aren't live. Also, this properly will return the URL to a live stream in the case of live videos. */ -@property (nonatomic, readonly) NSURL *streamURL; +@property (nonatomic, readonly, nullable) NSURL *streamURL; /**