Skip to content

Commit 2ee18c1

Browse files
committed
Merge branch 'release/2.14.0'
2 parents d6f4b0e + 9699eda commit 2ee18c1

File tree

15 files changed

+264
-17
lines changed

15 files changed

+264
-17
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.13.0
7+
module_version: 2.14.0
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.13.0/XCDYouTubeKit
14+
github_file_prefix: https://github.com/0xced/XCDYouTubeKit/tree/2.14.0/XCDYouTubeKit

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### Version 2.14.0
2+
3+
* Add new `XCDYouTubeErrorEmptyResponse` error (#479)
4+
* Adaptation to YouTube API change. (a048776eb0d87de869c1636e244d78ffb311adc6)
5+
16
#### Version 2.13.0
27

38
* Deprecated `-[XCDYouTubeVideo thumbnailURL]` use `-[XCDYouTubeVideo thumbnailURLs]` (#477)

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let package = Package(
99
.macOS(.v10_10)
1010
],
1111
products: [
12-
.library(name: "XCDYouTubeKit" , targets: ["XCDYouTubeKit"])
12+
.library(name: "XCDYouTubeKit", targets: ["XCDYouTubeKit"])
1313
],
1414
targets: [
1515
.target(

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ XCDYouTubeKit is available through [CocoaPods](https://cocoapods.org/), [Carthag
3333
CocoaPods:
3434

3535
```ruby
36-
pod "XCDYouTubeKit", "~> 2.13"
36+
pod "XCDYouTubeKit", "~> 2.14"
3737
```
3838

3939
Carthage:
4040

4141
```objc
42-
github "0xced/XCDYouTubeKit" ~> 2.13
42+
github "0xced/XCDYouTubeKit" ~> 2.14
4343
```
4444

4545
Swift Package Manager:
@@ -48,7 +48,7 @@ Add `XCDYouTubeKit` to the dependencies value of your `Package.swift`
4848

4949
```swift
5050
dependencies: [
51-
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.13.0")
51+
.package(url: "https://github.com/0xced/XCDYouTubeKit.git", from: "2.14.0")
5252
]
5353
```
5454

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.13.0;
763+
CURRENT_PROJECT_VERSION = 2.14.0;
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.13.0;
807+
CURRENT_PROJECT_VERSION = 2.14.0;
808808
ENABLE_STRICT_OBJC_MSGSEND = YES;
809809
GCC_C_LANGUAGE_STANDARD = gnu99;
810810
GCC_NO_COMMON_BLOCKS = YES;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[
2+
{
3+
"body" : "",
4+
"headers" : {
5+
"Content-Type" : "text\/javascript",
6+
"Alt-Svc" : "h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
7+
"Age" : "13776",
8+
"Content-Encoding" : "gzip",
9+
"Server" : "sffe",
10+
"X-XSS-Protection" : "0",
11+
"Expires" : "Tue, 11 May 2021 22:13:55 GMT",
12+
"Cache-Control" : "public, max-age=31536000",
13+
"Date" : "Mon, 11 May 2020 22:13:55 GMT",
14+
"Content-Length" : "431582",
15+
"X-Content-Type-Options" : "nosniff",
16+
"Accept-Ranges" : "bytes",
17+
"Vary" : "Accept-Encoding, Origin",
18+
"Last-Modified" : "Thu, 07 May 2020 00:28:50 GMT"
19+
},
20+
"method" : "GET",
21+
"status" : 200,
22+
"uri" : "https:\/\/www.youtube.com\/s\/player\/0acb4375\/player_ias.vflset\/en_US\/base.js"
23+
},
24+
{
25+
"body" : "",
26+
"headers" : {
27+
"Content-Type" : "application\/x-www-form-urlencoded",
28+
"P3P" : "CP=\"This is not a P3P policy! See http:\/\/support.google.com\/accounts\/answer\/151657?hl=en for more info.\"",
29+
"Alt-Svc" : "h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
30+
"Content-Encoding" : "br",
31+
"Server" : "YouTube Frontend Proxy",
32+
"X-XSS-Protection" : "0",
33+
"Transfer-Encoding" : "Identity",
34+
"Expires" : "Tue, 27 Apr 1971 19:44:06 GMT",
35+
"Cache-Control" : "no-store",
36+
"Date" : "Tue, 12 May 2020 02:03:26 GMT",
37+
"Strict-Transport-Security" : "max-age=31536000",
38+
"X-Content-Type-Options" : "nosniff",
39+
"X-Frame-Options" : "SAMEORIGIN"
40+
},
41+
"method" : "GET",
42+
"status" : 200,
43+
"uri" : "https:\/\/www.youtube.com\/get_video_info?el=embedded&hl=en&ps=default&video_id=HxaM6UJpAyg"
44+
},
45+
{
46+
"body" : "",
47+
"headers" : {
48+
"Content-Type" : "text\/html; charset=utf-8",
49+
"P3P" : "CP=\"This is not a P3P policy! See http:\/\/support.google.com\/accounts\/answer\/151657?hl=en for more info.\"",
50+
"Alt-Svc" : "h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
51+
"Content-Encoding" : "br",
52+
"Server" : "YouTube Frontend Proxy",
53+
"X-XSS-Protection" : "0",
54+
"Transfer-Encoding" : "Identity",
55+
"Expires" : "Tue, 27 Apr 1971 19:44:06 GMT",
56+
"Set-Cookie" : "VISITOR_INFO1_LIVE=ci6MCaynJqU; path=\/; domain=.youtube.com; secure; expires=Sun, 08-Nov-2020 02:03:31 GMT; httponly; samesite=None, GPS=1; path=\/; domain=.youtube.com; expires=Tue, 12-May-2020 02:33:31 GMT, YSC=GwFOF9Lp9CY; path=\/; domain=.youtube.com; secure; httponly; samesite=None",
57+
"Cache-Control" : "no-cache",
58+
"Date" : "Tue, 12 May 2020 02:03:31 GMT",
59+
"Strict-Transport-Security" : "max-age=31536000",
60+
"X-Content-Type-Options" : "nosniff",
61+
"X-Frame-Options" : "SAMEORIGIN"
62+
},
63+
"method" : "GET",
64+
"status" : 200,
65+
"uri" : "https:\/\/www.youtube.com\/watch?bpctr=9999999999&has_verified=1&hl=en&v=HxaM6UJpAyg"
66+
}
67+
]

XCDYouTubeKit Tests/Cassettes/XCDYouTubeProtectedVideosTestCase/testAlternativeSignatureValue.json

Lines changed: 88 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version='1.0' encoding='UTF-8' ?>
2+
<?charles serialisation-version='2.0' ?>
3+
<rewriteSet-array>
4+
<rewriteSet>
5+
<active>true</active>
6+
<name>testAlternativeSignatureValue</name>
7+
<hosts>
8+
<locationPatterns>
9+
<locationMatch>
10+
<location>
11+
<protocol>https</protocol>
12+
<host>www.youtube.com</host>
13+
<port>443</port>
14+
</location>
15+
<enabled>true</enabled>
16+
</locationMatch>
17+
</locationPatterns>
18+
</hosts>
19+
<rules>
20+
<rewriteRule>
21+
<active>true</active>
22+
<ruleType>7</ruleType>
23+
<matchValue>cipher</matchValue>
24+
<matchHeaderRegex>false</matchHeaderRegex>
25+
<matchValueRegex>true</matchValueRegex>
26+
<matchRequest>false</matchRequest>
27+
<matchResponse>true</matchResponse>
28+
<newValue>signatureCipher</newValue>
29+
<newHeaderRegex>false</newHeaderRegex>
30+
<newValueRegex>false</newValueRegex>
31+
<matchWholeValue>false</matchWholeValue>
32+
<caseSensitive>false</caseSensitive>
33+
<replaceType>2</replaceType>
34+
</rewriteRule>
35+
</rules>
36+
</rewriteSet>
37+
</rewriteSet-array>

XCDYouTubeKit Tests/XCDYouTubeClientTestCase.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,19 @@ - (void) testInvalidVideoIdentifier
686686
[self waitForExpectationsWithTimeout:5 handler:nil];
687687
}
688688

689+
- (void) testEmptyResponse_offline
690+
{
691+
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];
692+
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:@"HxaM6UJpAyg" completionHandler:^(XCDYouTubeVideo *video, NSError *error)
693+
{
694+
XCTAssertNil(video);
695+
XCTAssertEqualObjects(error.domain, XCDYouTubeVideoErrorDomain);
696+
XCTAssertEqual(error.code, XCDYouTubeErrorEmptyResponse);
697+
[expectation fulfill];
698+
}];
699+
[self waitForExpectationsWithTimeout:5 handler:nil];
700+
}
701+
689702
- (void) testNonExistentVideoIdentifier
690703
{
691704
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];

XCDYouTubeKit Tests/XCDYouTubeProtectedVideosTestCase.m

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,29 @@ - (void) testProtectedVEVOVideo3
326326
[self waitForExpectationsWithTimeout:5 handler:nil];
327327
}
328328

329+
// See testAlternativeSignatureValue.xml for Charles Proxy Setting
330+
// Import: Charles Proxy > Tools > Rewrite
331+
- (void) testAlternativeSignatureValue_offline
332+
{
333+
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];
334+
[[XCDYouTubeClient defaultClient] getVideoWithIdentifier:@"rId6PKlDXeU" completionHandler:^(XCDYouTubeVideo *video, NSError *error)
335+
{
336+
XCTAssertNil(error);
337+
XCTAssertNotNil(video.title);
338+
XCTAssertTrue(video.viewCount > 0);
339+
XCTAssertNotNil(video.expirationDate);
340+
XCTAssertNotNil(video.thumbnailURLs.firstObject);
341+
XCTAssertTrue(video.streamURLs.count > 0);
342+
XCTAssertTrue(video.duration > 0);
343+
[video.streamURLs enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSURL *streamURL, BOOL *stop)
344+
{
345+
XCTAssertTrue([streamURL.query rangeOfString:@"signature="].location != NSNotFound || [streamURL.query rangeOfString:@"sig="].location != NSNotFound);
346+
}];
347+
[expectation fulfill];
348+
}];
349+
[self waitForExpectationsWithTimeout:5 handler:nil];
350+
}
351+
329352
- (void) testProtectedVEVOIsPlayable
330353
{
331354
__weak XCTestExpectation *expectation = [self expectationWithDescription:@""];

0 commit comments

Comments
 (0)