-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix downloader plugin #4069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix downloader plugin #4069
Conversation
* Remove hard-coded player_id * The specific player_id is blocked now * Update youtubei.js dependency to version 16 (fixes download issues) * Specify js interpreter for sig function stuff
| ); | ||
| const ffmpegMutex = new Mutex(); | ||
|
|
||
| Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace data:·Types.BuildScriptResult,·env:·Record<string,·Types.VMPrimative> with ⏎··data:·Types.BuildScriptResult,⏎··env:·Record<string,·Types.VMPrimative>,⏎
| Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => { | |
| Platform.shim.eval = async ( | |
| data: Types.BuildScriptResult, | |
| env: Record<string, Types.VMPrimative>, | |
| ) => { |
| ); | ||
| const ffmpegMutex = new Mutex(); | ||
|
|
||
| Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/require-await> reported by reviewdog 🐶
Async arrow function has no 'await' expression.
| Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => { | ||
| const properties = []; | ||
|
|
||
| if(env.n) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ·
| if(env.n) { | |
| if (env.n) { |
| const properties = []; | ||
|
|
||
| if(env.n) { | ||
| properties.push(`n: exportedVars.nFunction("${env.n}")`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ;
| properties.push(`n: exportedVars.nFunction("${env.n}")`) | |
| properties.push(`n: exportedVars.nFunction("${env.n}")`); |
| const properties = []; | ||
|
|
||
| if(env.n) { | ||
| properties.push(`n: exportedVars.nFunction("${env.n}")`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <stylistic/semi> reported by reviewdog 🐶
Missing semicolon.
| properties.push(`n: exportedVars.nFunction("${env.n}")`) | |
| properties.push(`n: exportedVars.nFunction("${env.n}")`); |
|
|
||
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||
|
|
||
| return new Function(code)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unsafe-return> reported by reviewdog 🐶
Unsafe return of a value of type any.
|
|
||
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||
|
|
||
| return new Function(code)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-implied-eval> reported by reviewdog 🐶
Implied eval. Do not use the Function constructor to create functions.
|
|
||
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||
|
|
||
| return new Function(code)(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@typescript-eslint/no-unsafe-call> reported by reviewdog 🐶
Unsafe call of a(n) Function typed value.
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||
|
|
||
| return new Function(code)(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ;
| } | |
| }; |
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||
|
|
||
| return new Function(code)(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <stylistic/semi> reported by reviewdog 🐶
Missing semicolon.
| } | |
| }; |
TLDR; the only way to fix the downloader is to upgrade youtubei.js to version 16 and specify a js interpreter.
As this comment says, the current hardcoded player id (from #3973) doesn't work anymore. At the moment, the downloader plugin won't work.
I upgraded youtubei.js to version 16, added in the snippet shown here (specifying a js interpreter), and got the downloads to work again.
Changes: