Comments (9)
You may try a workaround like this:
--- a/src/inject/main-player-page-hls.js
+++ b/src/inject/main-player-page-hls.js
@@ -33,9 +33,8 @@ function main(utils, parameters = {}) {
const arr = [];
try {
const segments = player.tech_.hls.playlists.media_.segments;
- segments.forEach(x => arr.push({ uri: x.resolvedUri }));
- arr.forEach(videojs.Hls.xhr.beforeRequest);
- arr.forEach(x => typeof x.decryptURI === 'function' && x.decryptURI());
+ segments.forEach(x => arr.push({ uri: x.resolvedUri, method: "HEAD", timeout: 50 }));
+ arr.forEach(x => x.uri = videojs.Hls.xhr(x, function(){}).uri);
} catch (error) {
return logError(error);
}
It works, though hundreds of requests will be sent (querying for response headers only, no data)...
from chrome-avgle-helper.
tried the workaround but still getting the same error.
function main(utils, parameters = {}) {
// #21
waitForVideoJS(100, () => {
const player = videojs('video-player');
player.on('loadedmetadata', () => {
logInfo(Detected the hls.js loadedmetadata event!
);const arr = []; try { const segments = player.tech_.hls.playlists.media_.segments; //segments.forEach(x => arr.push({ uri: x.resolvedUri })); //arr.forEach(videojs.Hls.xhr.beforeRequest); //arr.forEach(x => typeof x.decryptURI === 'function' && x.decryptURI()); segments.forEach(x => arr.push({ uri: x.resolvedUri, method: "HEAD", timeout: 50 })); arr.forEach(x => x.uri = videojs.Hls.xhr(x, function(){}).uri); } catch (error) { return logError(error); }
Note that you will need to rebuild the chrome extension after src code updated.
(And may need to restart chrome to load the updated extension)
# Install Node.js and yarn
# Visit: https://nodejs.org/en/
# And https://yarnpkg.com/getting-started/install
# Install dependencies
yarn install
# Launch builder script
yarn run build
from chrome-avgle-helper.
I'm encountering the below warning and causing the script to retry wget again without Referer header, it can be fixed by updating the download.sh and downloader-hls.sh in your extension/dist folder (re-import after updating the sh).
Replace
"$WGET_BIN" "$ref1" "$ref2" --header "User-Agent: $CFG_USER_AGENT" "$out1" "$out2" $2;
With
if [[ -n "$3" ]]; then "$WGET_BIN" "$ref1" "$ref2" --header "User-Agent: $CFG_USER_AGENT" "$out1" "$out2" $2; else "$WGET_BIN" "$ref1" "$ref2" --header "User-Agent: $CFG_USER_AGENT" $2; fi
from chrome-avgle-helper.
After modified still getting error.
download-FC2-PPV-1648397.sh: line 886: ((: i<=!WU1HRUQLSxgLQgNQBAVTWgVUBRlXAAhIEF5eRg9SRF1VXFwbVF4JGAlXSF9LXwk1USdcU3IxMTERWRxQLX9qTkZeH0YKHQFZBg8AVAMEU1AEWwUCGAgPCwhFDAVMU1NAUAQCAwYAVQRRCwFXHUYWAkMHCG51AgI8TEt6GBFSVFFDXEEIUV4WVAceHwNEUg4GGQFaWhsWAwAVUFYKVgEDBAgPBwEYXAFTC1MMCl5GI0xEEVEDG1VRUU4IHgVQAAsBAQ4GDBlcFANNQVQFHwZbVBoUBBpVVUgSEg== : syntax error: operand expected (error token is "== ")
from chrome-avgle-helper.
Seems the dectyptURI function call will check whether its called by functions in "avgle.com/templates/frontend/videojs-contrib-hls.js" (which's used to generate md5 hash for decrypting the video segment uri).
It might cause current script not work any more.
from chrome-avgle-helper.
tried the workaround but still getting the same error.
function main(utils, parameters = {}) {
// #21
waitForVideoJS(100, () => {
const player = videojs('video-player');
player.on('loadedmetadata', () => {
logInfo(Detected the hls.js loadedmetadata event!
);
const arr = [];
try {
const segments = player.tech_.hls.playlists.media_.segments;
//segments.forEach(x => arr.push({ uri: x.resolvedUri }));
//arr.forEach(videojs.Hls.xhr.beforeRequest);
//arr.forEach(x => typeof x.decryptURI === 'function' && x.decryptURI());
segments.forEach(x => arr.push({ uri: x.resolvedUri, method: "HEAD", timeout: 50 }));
arr.forEach(x => x.uri = videojs.Hls.xhr(x, function(){}).uri);
} catch (error) {
return logError(error);
}
from chrome-avgle-helper.
就2点:
- 必须在进入创建xhr这个时间点调用。你可以在相应位置设置断点,然后控制台执行代码能解密成功。但是如果过了这个代码段,执行同样的代码,就解密失败了。
- beforeRequest和decryptURI必须按顺序调用。
var backupBeforeRequest = videojs.Hls.xhr.beforeRequest;
var done = false;
let v = videojs('video-player');
v.on('loadedmetadata', function () {
console.log('test:', 'loadedmetadata')
videojs.Hls.xhr.beforeRequest = function () {
backupBeforeRequest.apply(videojs.Hls.xhr, arguments);
if (!done) {
console.log('start decrypt video uri')
done = true;
try {
v = videojs('video-player');
arr = v.tech_.hls.playlists.media_.segments.map(x => {
return {
uri: x.resolvedUri,
"timeout": 0,
"withCredentials": false,
"responseType": "arraybuffer",
"headers": {}
}
});
for(let item of arr)
{
videojs.Hls.xhr.beforeRequest(item)
item.decryptURI();
}
console.log(arr[0]);
}
catch (e) {
console.error('some error', e);
}
}
}
})
from chrome-avgle-helper.
就2点:
- 必须在进入创建xhr这个时间点调用。你可以在相应位置设置断点,然后控制台执行代码能解密成功。但是如果过了这个代码段,执行同样的代码,就解密失败了。
- beforeRequest和decryptURI必须按顺序调用。
var backupBeforeRequest = videojs.Hls.xhr.beforeRequest; var done = false; let v = videojs('video-player'); v.on('loadedmetadata', function () { console.log('test:', 'loadedmetadata') videojs.Hls.xhr.beforeRequest = function () { backupBeforeRequest.apply(videojs.Hls.xhr, arguments); if (!done) { console.log('start decrypt video uri') done = true; try { v = videojs('video-player'); arr = v.tech_.hls.playlists.media_.segments.map(x => { return { uri: x.resolvedUri, "timeout": 0, "withCredentials": false, "responseType": "arraybuffer", "headers": {} } }); for(let item of arr) { videojs.Hls.xhr.beforeRequest(item) item.decryptURI(); } console.log(arr[0]); } catch (e) { console.error('some error', e); } } } })
so how to use it, thx
from chrome-avgle-helper.
arr.forEach(x => x.uri = videojs.Hls.xhr(x, function(){}).uri);
this actually works, thanks a lot !!!
from chrome-avgle-helper.
Related Issues (20)
- 提示成功,但是中间代码报错无文件
- 又无法下载了,有人遇到这种情况吗? HOT 10
- 怎么解码m3u8 我只要m3u8 list 不是url
- 失效了
- Download movie using downloader-hls.sh
- install.sh doesn't work HOT 3
- Can't download
- ”清单文件缺失或不可读取 无法加载清单。“ HOT 1
- There is wrong with install.sh
- Not working anymore (doesn't download) HOT 4
- 打开扩展,只显示一个控制台 HOT 1
- concat.list: No such file or directory HOT 2
- ffmpeg is missing in directory windows libs
- When I click on the [Download Video], the download does not run.
- avgle程序员恨勤奋 HOT 7
- hi, I am having this issue when trying to use the script generated by the download recently HOT 1
- There are no changes at all
- xvideo
- No video detected on this page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-avgle-helper.