distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
289 stars 50 forks source link

Intermittent 403 Errors with Audio URL #79

Closed fsholehan closed 3 months ago

fsholehan commented 3 months ago

In version 4.3.7, the audio URL was working perfectly. However, in the latest version (4.14.4), it initially works, but then it intermittently either works or returns a 403 error. Has there been any update related to this?

Environment

ybd-project commented 3 months ago

I don't see any relevant updates, but how do you get the URL for the audio? Please show us the code you are implementing.

fsholehan commented 3 months ago

Screenshot_2024-08-09_04-00-03

exports.audioOnly = async (req, res) => { const { videoId } = req.query; let info = await distube.getInfo(videoId, { agent }); let audioFormats = distube.filterFormats(info.formats, "audioonly"); res.json(audioFormats); };

ybd-project commented 3 months ago

exports.audioOnly = async (req, res) => { const { videoId } = req.query; let info = await distube.getInfo(videoId, { agent }); let audioFormats = distube.filterFormats(info.formats, "audioonly"); res.json(audioFormats); };

Is there a problem with URLs using audio codecs other than opus? Also, does the Agent use a proxy?

fsholehan commented 3 months ago

exports.audioOnly = async (req, res) => { const { videoId } = req.query; let info = await distube.getInfo(videoId, { agent }); let audioFormats = distube.filterFormats(info.formats, "audioonly"); res.json(audioFormats); };

Is there a problem with URLs using audio codecs other than opus? Also, does the Agent use a proxy?

Yes, all audio URLs with codecs other than Opus are getting a 403 status.

No, i dont use proxy.

ybd-project commented 3 months ago

If the environment in which you want to run it is a server, we recommend using a proxy, but not if it is local, as it will time out. Deploying to Glitch or elsewhere is recommended.

fsholehan commented 3 months ago

If the environment in which you want to run it is a server, we recommend using a proxy, but not if it is local, as it will time out. Deploying to Glitch or elsewhere is recommended.

Oke i will try it

fsholehan commented 3 months ago

If the environment in which you want to run it is a server, we recommend using a proxy, but not if it is local, as it will time out. Deploying to Glitch or elsewhere is recommended.

I add proxy and its work, thank you

ybd-project commented 3 months ago

You're welcome :)

fsholehan commented 3 months ago

You're welcome :)

But, its take time too long ;(

ybd-project commented 3 months ago

You're welcome :)

But, its take time too long ;(

Can you tell me the IP address of your proxy? I am using 152.26.229.66:9443.

fsholehan commented 3 months ago

You're welcome :)

But, its take time too long ;(

Can you tell me the IP address of your proxy? I am using 152.26.229.66:9443.

I'm using proxy same as you

ybd-project commented 3 months ago

I'm using proxy same as you

Yesterday I tested the publicly available proxy IP list and got the following working IP addresses. Try it out.

  1. 152.26.229.42:9443
  2. 152.26.229.66:9443
  3. 152.26.229.86:9443
  4. 152.26.229.88:9443
  5. 152.26.231.42:9443
  6. 152.26.231.77:9443
  7. 152.26.231.86:9443
  8. 177.234.241.25:999 (unstable)
  9. 177.234.241.26:999 (unstable)
  10. 177.234.241.27:999 (unstable)
  11. 177.234.241.30:999 (unstable)
thind9xdev commented 3 months ago
curl --location 'https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: vi,en;q=0.9,vi-VN;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-US;q=0.5' \
--header 'author: phuongmychimusic' \
--header 'origin: https://phuongmychi.vn'

I have change something in API, you can try it https://rr4---sn-npoeened.googlevideo.com/videoplayback?expire=1723238135&ei=lzK2ZpnMLJPLjMwP-YS0kA8&ip=2407%3A3640%3A2166%3A3061%3A%3A1&id=o-AM4Kem13wySekQAV8CB-sdkJ0vpqwp-7Kc3eiYsk3Y1t&itag=140&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=hc&mm=31%2C26&mn=sn-npoeened%2Csn-30a7ynl7&ms=au%2Conr&mv=u&mvi=4&pl=49&vprv=1&svpuc=1&mime=audio%2Fmp4&rqh=1&gir=yes&clen=4152076&dur=256.487&lmt=1705509042799476&mt=1723215504&fvip=1&keepalive=yes&c=IOS&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cvprv%2Csvpuc%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgVMqtUBVNM_pFVoKbRwxn-SLIO6yxP8jPFfA32iywP24CIQCp4hPaXQO2KQ2M_iX4WyF7UzjPJfoc-Fb9ech3meh1DQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AGtxev0wRgIhAMJ3h4wXalobS8mQpg-OaF9gNVYxyv65r4MkRMTDe3NSAiEAgNvuA5uirCparpodeuwKcbkxIx2pPOc6CAN4OE3WthQ%3D

fsholehan commented 3 months ago

I'm using proxy same as you

Yesterday I tested the publicly available proxy IP list and got the following working IP addresses. Try it out.

  1. 152.26.229.42:9443
  2. 152.26.229.66:9443
  3. 152.26.229.86:9443
  4. 152.26.229.88:9443
  5. 152.26.231.42:9443
  6. 152.26.231.77:9443
  7. 152.26.231.86:9443
  8. 177.234.241.25:999 (unstable)
  9. 177.234.241.26:999 (unstable)
  10. 177.234.241.27:999 (unstable)
  11. 177.234.241.30:999 (unstable)

Ok, thank you :)

fsholehan commented 3 months ago
curl --location 'https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: vi,en;q=0.9,vi-VN;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-US;q=0.5' \
--header 'author: phuongmychimusic' \
--header 'origin: https://phuongmychi.vn'

I have change something in API, you can try it https://rr4---sn-npoeened.googlevideo.com/videoplayback?expire=1723238135&ei=lzK2ZpnMLJPLjMwP-YS0kA8&ip=2407%3A3640%3A2166%3A3061%3A%3A1&id=o-AM4Kem13wySekQAV8CB-sdkJ0vpqwp-7Kc3eiYsk3Y1t&itag=140&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=hc&mm=31%2C26&mn=sn-npoeened%2Csn-30a7ynl7&ms=au%2Conr&mv=u&mvi=4&pl=49&vprv=1&svpuc=1&mime=audio%2Fmp4&rqh=1&gir=yes&clen=4152076&dur=256.487&lmt=1705509042799476&mt=1723215504&fvip=1&keepalive=yes&c=IOS&txp=4532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cvprv%2Csvpuc%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIgVMqtUBVNM_pFVoKbRwxn-SLIO6yxP8jPFfA32iywP24CIQCp4hPaXQO2KQ2M_iX4WyF7UzjPJfoc-Fb9ech3meh1DQ%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AGtxev0wRgIhAMJ3h4wXalobS8mQpg-OaF9gNVYxyv65r4MkRMTDe3NSAiEAgNvuA5uirCparpodeuwKcbkxIx2pPOc6CAN4OE3WthQ%3D

The link expired, can you give the new link?

ybd-project commented 3 months ago

From this API: https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU

fsholehan commented 3 months ago

From this API: https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU

Its working fine