Skip to content

Commit

Permalink
Update YouTube web client version and mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
AudricV committed Apr 11, 2021
1 parent 89f7d01 commit 1563468
Show file tree
Hide file tree
Showing 175 changed files with 3,837 additions and 3,636 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class YoutubeParsingHelper {
private YoutubeParsingHelper() {
}

private static final String HARDCODED_CLIENT_VERSION = "2.20200214.04.00";
private static final String HARDCODED_CLIENT_VERSION = "2.20210408.08.00";
private static String clientVersion;

private static String key;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,4 +582,3 @@ public void testVerified() throws Exception {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ public void clarificationTest() throws Exception {
@Override public String expectedId() { return QUERY; }
@Override public String expectedUrlContains() { return "youtube.com/results?search_query=" + QUERY; }
@Override public String expectedOriginalUrlContains() throws Exception { return "youtube.com/results?search_query=" + QUERY; }

}

public static class ChannelVerified extends DefaultSearchExtractorTest {
Expand Down Expand Up @@ -320,5 +319,4 @@ public void testAtLeastOneVerified() throws IOException, ExtractionException {
assertTrue(verified);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/**
* Test for {@link YoutubeStreamLinkHandlerFactory}
*/

@Ignore("Video is not available in specific countries. Someone else has to generate mocks")
public class YoutubeStreamExtractorControversialTest extends DefaultStreamExtractorTest {
private static final String RESOURCE_PATH = DownloaderFactory.RESOURCE_PATH + "services/youtube/extractor/stream/";
Expand Down Expand Up @@ -59,5 +60,4 @@ public static void setUp() throws Exception {
@Override public List<String> expectedTags() { return Arrays.asList("Books", "Burning", "Jones", "Koran", "Qur'an", "Terry", "the amazing atheist"); }
@Override public String expectedCategory() { return "Entertainment"; }
@Override public String expectedLicence() { return "YouTube licence"; }

}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
50,
48,
50,
48,
48,
50,
49,
48,
52,
48,
56,
46,
48,
52,
56,
46,
48,
48,
Expand Down Expand Up @@ -148,10 +148,10 @@
"application/json; charset\u003dUTF-8"
],
"date": [
"Sat, 10 Apr 2021 12:40:30 GMT"
"Sun, 11 Apr 2021 15:53:22 GMT"
],
"expires": [
"Sat, 10 Apr 2021 12:40:30 GMT"
"Sun, 11 Apr 2021 15:53:22 GMT"
],
"p3p": [
"CP\u003d\"This is not a P3P policy! See g.co/p3phelp for more info.\""
Expand All @@ -160,7 +160,7 @@
"ESF"
],
"set-cookie": [
"CONSENT\u003dPENDING+823; expires\u003dFri, 01-Jan-2038 00:00:00 GMT; path\u003d/; domain\u003d.googleapis.com"
"CONSENT\u003dPENDING+843; expires\u003dFri, 01-Jan-2038 00:00:00 GMT; path\u003d/; domain\u003d.googleapis.com"
],
"transfer-encoding": [
"chunked"
Expand All @@ -180,7 +180,7 @@
"0"
]
},
"responseBody": "{\n \"responseContext\": {\n \"visitorData\": \"CgtFdjdhemUyelVtYyi-ucaDBg%3D%3D\",\n \"serviceTrackingParams\": [\n {\n \"service\": \"CSI\",\n \"params\": [\n {\n \"key\": \"c\",\n \"value\": \"WEB\"\n },\n {\n \"key\": \"cver\",\n \"value\": \"2.20200214.04.00\"\n },\n {\n \"key\": \"yt_li\",\n \"value\": \"0\"\n },\n {\n \"key\": \"ResolveUrl_rid\",\n \"value\": \"0x17e347e8c288fcf7\"\n }\n ]\n },\n {\n \"service\": \"GFEEDBACK\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n },\n {\n \"key\": \"e\",\n \"value\": \"24006795,23970529,23735348,23975059,24021967,23986029,23891344,24007246,24016478,23946420,24001373,23974595,23748146,24022308,23987676,23944779,23890959,24014268,23744176,24008565,24012117,24022914,1714258,24022145,23976696,23968386,24022876,23857948,23966208,23882502,23891346,23884386,24011119,23934970,23804281,24005646,23983296,23969934,24022616,24010859,23918597\"\n }\n ]\n },\n {\n \"service\": \"GUIDED_HELP\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n }\n ]\n },\n {\n \"service\": \"ECATCHER\",\n \"params\": [\n {\n \"key\": \"client.version\",\n \"value\": \"2.20210114\"\n },\n {\n \"key\": \"client.name\",\n \"value\": \"WEB\"\n }\n ]\n }\n ],\n \"mainAppWebResponseContext\": {\n \"loggedOut\": true\n },\n \"webResponseContextExtensionData\": {\n \"hasDecorated\": true\n }\n },\n \"endpoint\": {\n \"clickTrackingParams\": \"IhMIxZXlr9nz7wIVIzNMCh1i0QKKMghleHRlcm5hbA\u003d\u003d\",\n \"commandMetadata\": {\n \"webCommandMetadata\": {\n \"url\": \"/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA\",\n \"webPageType\": \"WEB_PAGE_TYPE_CHANNEL\",\n \"rootVe\": 3611,\n \"apiUrl\": \"/youtubei/v1/browse\"\n },\n \"resolveUrlCommandMetadata\": {\n \"isVanityUrl\": true\n }\n },\n \"browseEndpoint\": {\n \"browseId\": \"UC6nSFpj9HTCZ5t-N3Rm3-HA\",\n \"params\": \"EgC4AQA%3D\"\n }\n }\n}\n",
"responseBody": "{\n \"responseContext\": {\n \"visitorData\": \"Cgt0bmVTUzJiQ0FHdyjytsyDBg%3D%3D\",\n \"serviceTrackingParams\": [\n {\n \"service\": \"CSI\",\n \"params\": [\n {\n \"key\": \"c\",\n \"value\": \"WEB\"\n },\n {\n \"key\": \"cver\",\n \"value\": \"2.20210408.08.00\"\n },\n {\n \"key\": \"yt_li\",\n \"value\": \"0\"\n },\n {\n \"key\": \"ResolveUrl_rid\",\n \"value\": \"0x3304c5e310bd305b\"\n }\n ]\n },\n {\n \"service\": \"GFEEDBACK\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n },\n {\n \"key\": \"e\",\n \"value\": \"23918597,23976696,23882503,23956308,23744176,24015457,24022914,23890959,24022633,23995938,24024510,23971644,24022616,23891344,23986033,24005646,23969934,23815353,24021968,1714256,24022683,23983296,23934970,24011119,24026374,23946420,24007246,24016478,24015560,23804281,23857949,23987676,24014935,23891346,23884386,23940238,23966208,23999152,23975059,23970529,24006795,23968386,24012117,24001373,24022875,24014268,23944779,23987363,24022308,23748146,23974595,24014442\"\n }\n ]\n },\n {\n \"service\": \"GUIDED_HELP\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n }\n ]\n },\n {\n \"service\": \"ECATCHER\",\n \"params\": [\n {\n \"key\": \"client.version\",\n \"value\": \"2.20210408\"\n },\n {\n \"key\": \"client.name\",\n \"value\": \"WEB\"\n }\n ]\n }\n ],\n \"mainAppWebResponseContext\": {\n \"loggedOut\": true\n },\n \"webResponseContextExtensionData\": {\n \"hasDecorated\": true\n }\n },\n \"endpoint\": {\n \"clickTrackingParams\": \"IhMI_vq-rMb27wIVZDpMCh2o1wCcMghleHRlcm5hbA\u003d\u003d\",\n \"commandMetadata\": {\n \"webCommandMetadata\": {\n \"url\": \"/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA\",\n \"webPageType\": \"WEB_PAGE_TYPE_CHANNEL\",\n \"rootVe\": 3611,\n \"apiUrl\": \"/youtubei/v1/browse\"\n },\n \"resolveUrlCommandMetadata\": {\n \"isVanityUrl\": true\n }\n },\n \"browseEndpoint\": {\n \"browseId\": \"UC6nSFpj9HTCZ5t-N3Rm3-HA\",\n \"params\": \"EgC4AQA%3D\"\n }\n }\n}\n",
"latestUrl": "https://youtubei.googleapis.com/youtubei/v1/navigation/resolve_url?key\u003dAIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
50,
48,
50,
48,
48,
50,
49,
48,
52,
48,
56,
46,
48,
52,
56,
46,
48,
48,
Expand Down Expand Up @@ -160,10 +160,10 @@
"application/json; charset\u003dUTF-8"
],
"date": [
"Sat, 10 Apr 2021 12:42:11 GMT"
"Sun, 11 Apr 2021 15:54:16 GMT"
],
"expires": [
"Sat, 10 Apr 2021 12:42:11 GMT"
"Sun, 11 Apr 2021 15:54:16 GMT"
],
"p3p": [
"CP\u003d\"This is not a P3P policy! See g.co/p3phelp for more info.\""
Expand All @@ -172,7 +172,7 @@
"ESF"
],
"set-cookie": [
"CONSENT\u003dPENDING+575; expires\u003dFri, 01-Jan-2038 00:00:00 GMT; path\u003d/; domain\u003d.googleapis.com"
"CONSENT\u003dPENDING+817; expires\u003dFri, 01-Jan-2038 00:00:00 GMT; path\u003d/; domain\u003d.googleapis.com"
],
"transfer-encoding": [
"chunked"
Expand All @@ -192,7 +192,7 @@
"0"
]
},
"responseBody": "{\n \"responseContext\": {\n \"visitorData\": \"Cgt5cW94VEUzeExlYyijusaDBg%3D%3D\",\n \"serviceTrackingParams\": [\n {\n \"service\": \"CSI\",\n \"params\": [\n {\n \"key\": \"c\",\n \"value\": \"WEB\"\n },\n {\n \"key\": \"cver\",\n \"value\": \"2.20200214.04.00\"\n },\n {\n \"key\": \"yt_li\",\n \"value\": \"0\"\n },\n {\n \"key\": \"ResolveUrl_rid\",\n \"value\": \"0x9f7c996adccb5f8a\"\n }\n ]\n },\n {\n \"service\": \"GFEEDBACK\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n },\n {\n \"key\": \"e\",\n \"value\": \"23804281,24005646,23934970,24013981,23983296,24011119,24010466,23884386,23891346,23966208,23918597,24022616,9405988,23969934,24002838,24011361,23882685,23968386,23986023,24022800,23976696,24022914,23857949,23944779,23974595,24012558,23999152,24022308,23744176,24022875,24012117,24019883,24014268,23890959,24021967,23970529,24002010,24006795,23940238,1714250,23946420,24001373,24024425,23848211,23987676,24007246,24016478,23891344\"\n }\n ]\n },\n {\n \"service\": \"GUIDED_HELP\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n }\n ]\n },\n {\n \"service\": \"ECATCHER\",\n \"params\": [\n {\n \"key\": \"client.version\",\n \"value\": \"2.20210114\"\n },\n {\n \"key\": \"client.name\",\n \"value\": \"WEB\"\n }\n ]\n }\n ],\n \"mainAppWebResponseContext\": {\n \"loggedOut\": true\n },\n \"webResponseContextExtensionData\": {\n \"hasDecorated\": true\n }\n },\n \"endpoint\": {\n \"clickTrackingParams\": \"IhMI0dHy39nz7wIVhizxBR3dJQT1MghleHRlcm5hbA\u003d\u003d\",\n \"commandMetadata\": {\n \"webCommandMetadata\": {\n \"url\": \"/channel/UCEOXxzW2vU0P-0THehuIIeg\",\n \"webPageType\": \"WEB_PAGE_TYPE_CHANNEL\",\n \"rootVe\": 3611,\n \"apiUrl\": \"/youtubei/v1/browse\"\n },\n \"resolveUrlCommandMetadata\": {\n \"isVanityUrl\": true\n }\n },\n \"browseEndpoint\": {\n \"browseId\": \"UCEOXxzW2vU0P-0THehuIIeg\",\n \"params\": \"EgC4AQA%3D\"\n }\n }\n}\n",
"responseBody": "{\n \"responseContext\": {\n \"visitorData\": \"CgtxeENkMVlBSmZXVSiot8yDBg%3D%3D\",\n \"serviceTrackingParams\": [\n {\n \"service\": \"CSI\",\n \"params\": [\n {\n \"key\": \"c\",\n \"value\": \"WEB\"\n },\n {\n \"key\": \"cver\",\n \"value\": \"2.20210408.08.00\"\n },\n {\n \"key\": \"yt_li\",\n \"value\": \"0\"\n },\n {\n \"key\": \"ResolveUrl_rid\",\n \"value\": \"0x2979b4e86e18f0fb\"\n }\n ]\n },\n {\n \"service\": \"GFEEDBACK\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n },\n {\n \"key\": \"e\",\n \"value\": \"23987676,24022914,1714245,23891344,23970529,24026856,24002011,24019896,23868989,23890959,23974595,23934970,23744176,24022616,24011119,23986034,23991737,23858057,24005646,23940238,24006679,23804281,23884386,24024093,24001373,23946420,24006795,23968386,23723207,24022729,24021967,23885487,23918597,23976696,24016478,24007246,23882685,24024427,24022875,24022466,24008565,24014268,24024343,24022308,23891346,23966208,23999151,23969934,23983296,24012117,23944779,23857949\"\n }\n ]\n },\n {\n \"service\": \"GUIDED_HELP\",\n \"params\": [\n {\n \"key\": \"logged_in\",\n \"value\": \"0\"\n }\n ]\n },\n {\n \"service\": \"ECATCHER\",\n \"params\": [\n {\n \"key\": \"client.version\",\n \"value\": \"2.20210408\"\n },\n {\n \"key\": \"client.name\",\n \"value\": \"WEB\"\n }\n ]\n }\n ],\n \"mainAppWebResponseContext\": {\n \"loggedOut\": true\n },\n \"webResponseContextExtensionData\": {\n \"hasDecorated\": true\n }\n },\n \"endpoint\": {\n \"clickTrackingParams\": \"IhMIxrWCxsb27wIVMhDxBR31BwBLMghleHRlcm5hbA\u003d\u003d\",\n \"commandMetadata\": {\n \"webCommandMetadata\": {\n \"url\": \"/channel/UCEOXxzW2vU0P-0THehuIIeg\",\n \"webPageType\": \"WEB_PAGE_TYPE_CHANNEL\",\n \"rootVe\": 3611,\n \"apiUrl\": \"/youtubei/v1/browse\"\n },\n \"resolveUrlCommandMetadata\": {\n \"isVanityUrl\": true\n }\n },\n \"browseEndpoint\": {\n \"browseId\": \"UCEOXxzW2vU0P-0THehuIIeg\",\n \"params\": \"EgC4AQA%3D\"\n }\n }\n}\n",
"latestUrl": "https://youtubei.googleapis.com/youtubei/v1/navigation/resolve_url?key\u003dAIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 1563468

Please sign in to comment.