Skip to content

Commit 18537a0

Browse files
committed
Merge branch 'release/2.15.1'
2 parents b35528d + bed8b2c commit 18537a0

File tree

10 files changed

+41
-32
lines changed

10 files changed

+41
-32
lines changed

.jazzy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ source_directory: XCDYouTubeKit
44
framework_root: .
55
umbrella_header: XCDYouTubeKit/XCDYouTubeKit.h
66
module: XCDYouTubeKit
7-
module_version: 2.15.0
7+
module_version: 2.15.1
88

99
author: Cédric Luthi
1010
author_url: https://twitter.com/0xced
1111

1212
readme: README.md
1313
github_url: https://github.com/0xced/XCDYouTubeKit
14-
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.15.0/XCDYouTubeKit
14+
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.15.1/XCDYouTubeKit

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#### Version 2.15.1
2+
3+
* Adaptation to YouTube API change (#507, #504)
4+
15
#### Version 2.15.0
26

37
* Adaptation to YouTube API change (#501)

XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@
760760
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
761761
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
762762
COPY_PHASE_STRIP = NO;
763-
CURRENT_PROJECT_VERSION = 2.15.0;
763+
CURRENT_PROJECT_VERSION = 2.15.1;
764764
ENABLE_STRICT_OBJC_MSGSEND = YES;
765765
ENABLE_TESTABILITY = YES;
766766
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -804,7 +804,7 @@
804804
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
805805
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
806806
COPY_PHASE_STRIP = YES;
807-
CURRENT_PROJECT_VERSION = 2.15.0;
807+
CURRENT_PROJECT_VERSION = 2.15.1;
808808
ENABLE_STRICT_OBJC_MSGSEND = YES;
809809
GCC_C_LANGUAGE_STANDARD = gnu99;
810810
GCC_NO_COMMON_BLOCKS = YES;

XCDYouTubeKit Tests/Cassettes/XCDYouTubeProtectedVideosTestCase/testProtectedVideoWithoutSignatureFunction.json

Lines changed: 19 additions & 18 deletions
Large diffs are not rendered by default.

XCDYouTubeKit Tests/XCDYouTubeProtectedVideosTestCase.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,7 @@ - (void) testProtectedVideoWithPlayerScriptConnectionError_offline
473473
[self waitForExpectationsWithTimeout:5 handler:nil];
474474
}
475475

476-
// Edit testProtectedVideoWithoutSignatureFunction.json by replacing `Xu=function` with `Xu=funXtion` and
477-
//`decodeURIComponent` with `deXodeURIComponent`
476+
// Edit testProtectedVideoWithoutSignatureFunction.json by removing entire body for javascript URL and adding "XXXX"
478477
- (void) testProtectedVideoWithoutSignatureFunction_offline
479478
{
480479
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];

XCDYouTubeKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "XCDYouTubeKit"
3-
s.version = "2.15.0"
3+
s.version = "2.15.1"
44
s.summary = "YouTube video player for iOS and OS X."
55
s.homepage = "https://github.com/0xced/XCDYouTubeKit"
66
s.screenshot = "https://raw.github.com/0xced/XCDYouTubeKit/#{s.version}/Screenshots/XCDYouTubeVideoPlayerViewController.png"

XCDYouTubeKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,10 @@
663663
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
664664
COMBINE_HIDPI_IMAGES = YES;
665665
COPY_PHASE_STRIP = NO;
666-
CURRENT_PROJECT_VERSION = 50;
666+
CURRENT_PROJECT_VERSION = 51;
667667
DEFINES_MODULE = YES;
668668
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
669-
DYLIB_CURRENT_VERSION = 2.15.0;
669+
DYLIB_CURRENT_VERSION = 2.15.1;
670670
DYLIB_INSTALL_NAME_BASE = "@rpath";
671671
ENABLE_STRICT_OBJC_MSGSEND = YES;
672672
ENABLE_TESTABILITY = YES;
@@ -741,10 +741,10 @@
741741
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
742742
COMBINE_HIDPI_IMAGES = YES;
743743
COPY_PHASE_STRIP = YES;
744-
CURRENT_PROJECT_VERSION = 50;
744+
CURRENT_PROJECT_VERSION = 51;
745745
DEFINES_MODULE = YES;
746746
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
747-
DYLIB_CURRENT_VERSION = 2.15.0;
747+
DYLIB_CURRENT_VERSION = 2.15.1;
748748
DYLIB_INSTALL_NAME_BASE = "@rpath";
749749
ENABLE_NS_ASSERTIONS = NO;
750750
ENABLE_STRICT_OBJC_MSGSEND = YES;

XCDYouTubeKit/XCDYouTubeVideo.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ - (instancetype) initWithIdentifier:(NSString *)identifier info:(NSDictionary *)
169169

170170
NSString *playerResponse = info[@"player_response"];
171171
NSString *streamMap = info[@"url_encoded_fmt_stream_map"];
172-
NSArray *alternativeStreamMap = XCDStreamingDataWithString(playerResponse)[@"formats"];
172+
NSArray *alternativeStreamMap = XCDStreamingDataWithString(playerResponse)[@"formats"] == nil ? info[@"streamingData"][@"formats"] : XCDStreamingDataWithString(playerResponse)[@"formats"];
173173
NSString *httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse);
174174
NSString *adaptiveFormats = info[@"adaptive_fmts"];
175-
NSArray *alternativeAdaptiveFormats = XCDStreamingDataWithString(playerResponse)[@"adaptiveFormats"];
176-
NSDictionary *videoDetails = XCDDictionaryWithString(playerResponse)[@"videoDetails"];
175+
NSArray *alternativeAdaptiveFormats = XCDStreamingDataWithString(playerResponse)[@"adaptiveFormats"] == nil ? info[@"streamingData"][@"adaptiveFormats"] : XCDStreamingDataWithString(playerResponse)[@"adaptiveFormats"];
176+
NSDictionary *videoDetails = XCDDictionaryWithString(playerResponse)[@"videoDetails"] == nil ? info[@"videoDetails"] : XCDDictionaryWithString(playerResponse)[@"videoDetails"];
177177
NSString *multiCameraMetadataMap = XCDDictionaryWithString(playerResponse)[@"multicamera"][@"playerLegacyMulticameraRenderer"][@"metadataList"];
178178

179179
NSMutableDictionary *userInfo = response.URL ? [@{ NSURLErrorKey: (id)response.URL } mutableCopy] : [NSMutableDictionary new];

XCDYouTubeKit/XCDYouTubeVideoOperation.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ - (void) handleConnectionSuccessWithData:(NSData *)data response:(NSURLResponse
199199
CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)response.textEncodingName ?: CFSTR(""));
200200
// Use kCFStringEncodingMacRoman as fallback because it defines characters for every byte value and is ASCII compatible. See https://mikeash.com/pyblog/friday-qa-2010-02-19-character-encodings.html
201201
NSString *responseString = CFBridgingRelease(CFStringCreateWithBytes(kCFAllocatorDefault, data.bytes, (CFIndex)data.length, encoding != kCFStringEncodingInvalidId ? encoding : kCFStringEncodingMacRoman, false)) ?: @"";
202+
202203
XCDYouTubeLogVerbose(@"Response: %@\n%@", response, responseString);
203204
if ([(NSHTTPURLResponse *)response statusCode] == 429)
204205
{

XCDYouTubeKit/XCDYouTubeVideoWebpage.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ - (NSDictionary *) videoInfo
7878
if (!_videoInfo)
7979
{
8080
NSDictionary *args = self.playerConfiguration[@"args"];
81+
if (args == nil)
82+
{
83+
return XCDPlayerConfigurationWithString(self.html, @"ytInitialPlayerResponse\\s*=\\s*(\\{.+?\\})\\s*;");
84+
}
8185
if ([args isKindOfClass:[NSDictionary class]])
8286
{
8387
NSMutableDictionary *info = [NSMutableDictionary new];

0 commit comments

Comments
 (0)