-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ import { | |||||||||
| UniversalCache, | ||||||||||
| Utils, | ||||||||||
| YTNodes, | ||||||||||
| Platform, | ||||||||||
| } from '\u0079\u006f\u0075\u0074\u0075\u0062\u0065i.js'; | ||||||||||
| import is from 'electron-is'; | ||||||||||
| import filenamify from 'filenamify'; | ||||||||||
|
|
@@ -57,6 +58,22 @@ const ffmpeg = lazy(async () => | |||||||||
| ); | ||||||||||
| const ffmpegMutex = new Mutex(); | ||||||||||
|
|
||||||||||
| Platform.shim.eval = async (data: Types.BuildScriptResult, env: Record<string, Types.VMPrimative>) => { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@typescript-eslint/require-await> reported by reviewdog 🐶 |
||||||||||
| const properties = []; | ||||||||||
|
|
||||||||||
| if(env.n) { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Suggested change
|
||||||||||
| properties.push(`n: exportedVars.nFunction("${env.n}")`) | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <stylistic/semi> reported by reviewdog 🐶
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| if (env.sig) { | ||||||||||
| properties.push(`sig: exportedVars.sigFunction("${env.sig}")`) | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <stylistic/semi> reported by reviewdog 🐶
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| const code = `${data.output}\nreturn { ${properties.join(', ')} }`; | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@typescript-eslint/no-unsafe-member-access> reported by reviewdog 🐶 |
||||||||||
|
|
||||||||||
| return new Function(code)(); | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@typescript-eslint/no-unsafe-return> reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@typescript-eslint/no-implied-eval> reported by reviewdog 🐶
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@typescript-eslint/no-unsafe-call> reported by reviewdog 🐶 |
||||||||||
| } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <stylistic/semi> reported by reviewdog 🐶
Suggested change
|
||||||||||
|
|
||||||||||
| let yt: Innertube; | ||||||||||
| let win: BrowserWindow; | ||||||||||
| let playingUrl: string; | ||||||||||
|
|
@@ -131,7 +148,6 @@ export const onMainLoad = async ({ | |||||||||
|
|
||||||||||
| yt = await Innertube.create({ | ||||||||||
| cache: new UniversalCache(false), | ||||||||||
| player_id: '0004de42', | ||||||||||
| cookie: await getCookieFromWindow(win), | ||||||||||
| generate_session_locally: true, | ||||||||||
| fetch: getNetFetchAsFetch(), | ||||||||||
|
|
||||||||||
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>,⏎