Skip to content

Commit

Permalink
fixed mobile playing video issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
netptop committed Mar 11, 2020
1 parent a1d9967 commit 7afe6f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<a.C.length': `c<a.C.length&&a.C[c].style`, // fixed the exception.
// ' .......*?"Captions URL".': ' true', // Ms(Os(a, jfa, null), a, b, "Captions URL") // time costy
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<input class="lead-title button1" type="button" onclick="window.location.href='/https/www.bing.com/?mkt=en-us'" value="Bing搜索"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/search.yahoo.com/'" value="Yahoo搜索"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/zh.wikipedia.org'" value="维基百科"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/github.com/https/esu-tg.github.io/tg-poster-online'" value="Telegram指南"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/github.com/https/web.telegram.org'" value="Telegram登录"/>
<input class="lead-title button1" type="button" onclick="window.location.href='https://github.com/esu-tg/tg-app/blob/master/README.md'" value="Telegram下载"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/www.bbc.com/zhongwen/simp'" value="BBC新闻"/>
<input class="lead-title button1" type="button" onclick="window.location.href='/https/cn.reuters.com/'" value="路透社中文"/>
Expand Down
17 changes: 16 additions & 1 deletion test/siteproxylocal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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.

0 comments on commit 7afe6f7

Please sign in to comment.