ybd-project / ytdl-core

Fast and secure YouTube downloader for JavaScript and TypeScript
MIT License
28 stars 5 forks source link

Stable method of getting PoToken and VisitorData (automatic) #6

Closed ybd-project closed 3 months ago

ybd-project commented 3 months ago

Details

@ybd-project/ytdl-core allows the specification of PoToken and VisitorData. But the only way to get these is as follows.

  1. open the video embed page (/embed/)
  2. play the video and monitor the request
  3. get PoToken and VisitorData from the body of the request to /youtubei/v1/player

It is very difficult to do these things within ytdl-core and will degrade performance. Therefore, I would like to discussion here the automatic acquisition of PoToken and VisitorData.

ybd-project commented 3 months ago

Update: YunzheZJU/youtube-po-token-generator is the most promising so far.

yourshaxzod commented 3 months ago

Yangilanish: YunzheZJU/youtube-po-token-generator hozirgacha eng istiqbolli hisoblanadi.

Is there a better solution using oauth or is there any bugs with this method?

ybd-project commented 3 months ago

Is there a better solution using oauth or is there any bugs with this method?

There is also a way to use OAuth, but it is unclear whether this can be implemented in ytdl-core, so this will be investigated.

ybd-project commented 3 months ago

There is also a way to use OAuth, but it is unclear whether this can be implemented in ytdl-core, so this will be investigated.

After researching, we may be able to implement this by referring to LuanRT/YouTube.js. LuanRT/YouTube.js has very good implementation examples and can be based on them. (Do not import YouTube.js internally due to stability and performance issues.)

https://github.com/LuanRT/YouTube.js

ybd-project commented 3 months ago

This issue is expected to be resolved and has been closed.