Skip to content
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

Split out download fork to allow webpack compilation #3

Open
pke opened this issue Sep 4, 2021 · 4 comments
Open

Split out download fork to allow webpack compilation #3

pke opened this issue Sep 4, 2021 · 4 comments
Labels
question Further information is requested

Comments

@pke
Copy link

pke commented Sep 4, 2021

I am currently having trouble compiling the code with webpack. I only need the code to download video meta info which does not need the code to fork "dl.js" in video.js.
Could the video meta code live in a webpack compatible module?

@gatecrasher777
Copy link
Owner

In video.js comment out line 8, lines 383 - 589, lines 667-779.
In index.js comment out lines 18-50, lines 58-62

That will leave you without a download function, but you should have no problem getting the video meta info and streams,

I've only ever interfaced with the innertube api via a node server, but it ought to work in the browser provided you are able to overcome any CORS issues.

@gatecrasher777 gatecrasher777 added the question Further information is requested label Sep 4, 2021
@pke
Copy link
Author

pke commented Sep 4, 2021

I'll give it a try!

@pke
Copy link
Author

pke commented Sep 5, 2021

This still errors when deploying to vercel.com and used in a next.js app.

2021-09-04T23:54:48.823Z	b6abd641-14f3-4abc-9570-a09f77b93341	ERROR	Error: Cannot find module './model'
Require stack:
- /var/task/node_modules/ytcog/lib/session.js
- /var/task/node_modules/ytcog/lib/index.js
- /var/task/.next/server/pages/api.js
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.js
- /var/runtime/UserFunction.js
- /var/runtime/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/var/task/node_modules/ytcog/lib/session.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/task/node_modules/ytcog/lib/session.js',
    '/var/task/node_modules/ytcog/lib/index.js',
    '/var/task/.next/server/pages/api.js',
    '/var/task/node_modules/next/dist/server/next-server.js',
    '/var/task/___next_launcher.js',
    '/var/runtime/UserFunction.js',
    '/var/runtime/index.js'
  ]
}

@gatecrasher777
Copy link
Owner

It's not finding the model.js module which is right there in the ytcog lib folder. Perhaps you need to somehow configure webpack, npm or next.js to look in the ytcog lib folder to resolve the filenames.

Repository owner deleted a comment from vazw Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants