Skip to content

Commit

Permalink
Merge branch 'release/2.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
SoneeJohn committed Jan 16, 2019
2 parents c038699 + 39f5ad1 commit ceb082d
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ source_directory: XCDYouTubeKit
framework_root: .
umbrella_header: XCDYouTubeKit/XCDYouTubeKit.h
module: XCDYouTubeKit
module_version: 2.7.1
module_version: 2.7.2

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.7.1/XCDYouTubeKit
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.7.2/XCDYouTubeKit
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### Version 2.7.2

* Adaptation to YouTube API change. (#417)

#### Version 2.7.1

* Fixed Xcode project parsing error (#409, #411)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.1;
CURRENT_PROJECT_VERSION = 2.7.2;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -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.7.1;
CURRENT_PROJECT_VERSION = 2.7.2;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file modified XCDYouTubeKit Tests/Cookies/adultUserCookieData
Binary file not shown.
Binary file modified XCDYouTubeKit Tests/Cookies/minorUserCookieData
Binary file not shown.
2 changes: 1 addition & 1 deletion XCDYouTubeKit Tests/XCDYouTubeClientTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ - (void) testMobileRestrictedVideo
- (void) testLiveVideo
{
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:@"wv8NRHysoo0" completionHandler:^(XCDYouTubeVideo *video, NSError *error)
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:@"c6tZznkHX6g" completionHandler:^(XCDYouTubeVideo *video, NSError *error)
{
XCTAssertNil(error);
XCTAssertNotNil(video.title);
Expand Down
2 changes: 1 addition & 1 deletion XCDYouTubeKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "XCDYouTubeKit"
s.version = "2.7.1"
s.version = "2.7.2"
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"
Expand Down
8 changes: 4 additions & 4 deletions XCDYouTubeKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 32;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
DYLIB_CURRENT_VERSION = 2.7.1;
DYLIB_CURRENT_VERSION = 2.7.2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -690,10 +690,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 32;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 2.0.0;
DYLIB_CURRENT_VERSION = 2.7.1;
DYLIB_CURRENT_VERSION = 2.7.2;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
1 change: 1 addition & 0 deletions XCDYouTubeKit/XCDYouTubeVideo+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern NSString *const XCDYouTubeNoStreamVideoUserInfoKey;
extern NSDictionary *XCDDictionaryWithQueryString(NSString *string);
extern NSString *XCDQueryStringWithDictionary(NSDictionary *dictionary);
extern NSArray *XCDCaptionArrayWithString(NSString *string);
extern NSString *XCDHTTPLiveStreamingStringWithString(NSString *string);

@interface XCDYouTubeVideo ()

Expand Down
23 changes: 20 additions & 3 deletions XCDYouTubeKit/XCDYouTubeVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
NSString *const XCDYouTubeNoStreamVideoUserInfoKey = @"NoStreamVideo";
NSString *const XCDYouTubeVideoQualityHTTPLiveStreaming = @"HTTPLiveStreaming";


NSString *XCDHTTPLiveStreamingStringWithString(NSString *string)
{
NSError *error = nil;
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
if (!data) { return nil; }
NSDictionary *JSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];

if (error) { return nil; }

NSDictionary *streamingData = JSON[@"streamingData"];
NSString *manifestURL = streamingData[@"hlsManifestUrl"];
if (manifestURL.length == 0) { return nil; }

return manifestURL;
}

NSArray <NSDictionary *> *XCDCaptionArrayWithString(NSString *string)
{
NSError *error = nil;
Expand Down Expand Up @@ -120,8 +137,8 @@ - (instancetype) initWithIdentifier:(NSString *)identifier info:(NSDictionary *)
_identifier = identifier;

NSString *streamMap = info[@"url_encoded_fmt_stream_map"];
NSString *captionsMap = info[@"player_response"];
NSString *httpLiveStream = info[@"hlsvp"];
NSString *playerResponse = info[@"player_response"];
NSString *httpLiveStream = info[@"hlsvp"] ?: XCDHTTPLiveStreamingStringWithString(playerResponse);
NSString *adaptiveFormats = info[@"adaptive_fmts"];

NSMutableDictionary *userInfo = response.URL ? [@{ NSURLErrorKey: (id)response.URL } mutableCopy] : [NSMutableDictionary new];
Expand All @@ -146,7 +163,7 @@ - (instancetype) initWithIdentifier:(NSString *)identifier info:(NSDictionary *)
NSMutableDictionary *captionURLs = [NSMutableDictionary new];
NSMutableDictionary *autoGeneratedCaptionURLs = [NSMutableDictionary new];

for (NSDictionary *caption in XCDCaptionArrayWithString(captionsMap))
for (NSDictionary *caption in XCDCaptionArrayWithString(playerResponse))
{
NSString *languageCode = caption[@"languageCode"];
NSString *captionVersion = caption[@"vssId"];
Expand Down

0 comments on commit ceb082d

Please sign in to comment.