From 7afe6f7078f61599c54188fc01fa47fa6d46c9f4 Mon Sep 17 00:00:00 2001 From: netptop Date: Wed, 11 Mar 2020 13:44:04 -0400 Subject: [PATCH] fixed mobile playing video issue. --- config.js | 4 ++-- index.html | 2 +- test/siteproxylocal.test.js | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/config.js b/config.js index e3ce11e..5e76af8 100644 --- a/config.js +++ b/config.js @@ -9,7 +9,7 @@ const {CookieAccessInfo, CookieJar, Cookie} = cookiejar let config = { httpprefix: 'https', port: 443, - serverName: 'siteproxy.now.sh', + serverName: 'siteproxylocal.now.sh', } if (process.env.herokuAddr) { config.serverName = process.env.herokuAddr @@ -139,7 +139,7 @@ const siteSpecificReplace = { '"signin/v2': '"https/accounts.google.com/signin/v2', 'quot;https://[:-a-z0-9A-Z.]+?/https/accounts.google.com/ManageAccount': `quot;`, }, - 'www.youtube.com': { + 'youtube.com': { 'b."get_video_info"': `"${httpprefix}://${serverName}:${port}/https/www.youtube.com/get_video_info"`, 'c - + diff --git a/test/siteproxylocal.test.js b/test/siteproxylocal.test.js index 02c8d05..b3a92a9 100644 --- a/test/siteproxylocal.test.js +++ b/test/siteproxylocal.test.js @@ -157,6 +157,21 @@ test('youtube response url encode issue', async () => { }, 30000); +test('youtube mobile url issue', async () => { + const url = `${httpprefix}://${serverName}:${port}/https/m.youtube.com/yts/jsbin/player-plasma-ias-phone-en_US-vflrryPzY/base.js` + const response = await axios({ + method: 'get', + headers: { + 'Accept': `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9`, + }, + url, + }) + // console.log(`${JSON.stringify(response.headers)}`) + console.log(`${response.data}`) + // expect(response.data.indexOf(`"Captions URL"`)).toBe(-1) + expect(response.data.indexOf(`Untrusted URL:`)).toBe(-1) +}, 30000); + test('youtube url check issue', async () => { const url = `${httpprefix}://${serverName}:${port}/https/www.youtube.com/yts/jsbin/player_ias-vflsFV4r3/en_US/base.js` const response = await axios({ @@ -222,6 +237,6 @@ test('youtube homepage issue', async () => { url, }) // console.log(`${JSON.stringify(response.headers)}`) - console.log(`${response.data}`) + // console.log(`${response.data}`) expect(response.data.indexOf(`"\\/service_ajax\\",`)).toBe(-1) }, 3000); // should be done within 3 seconds. \ No newline at end of file