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

Switch from ytdl-core to play-dl #1031

Closed
wants to merge 5 commits into from

Conversation

MarcoCoreDuo
Copy link
Contributor

@MarcoCoreDuo MarcoCoreDuo commented May 16, 2024

Closes #1018
Should also resolve ytdl-core Issues #979 #945 #936

Play-dl doesn't directly offer ts formats from livestreams like ytdl-core does, so I had to fetch and parse them myself from the m3u8 master playlist. Also, play-dl always provides the best audio quality at the end of the format array for non-livestreams. We could also replace node-fetch with native-fetch when the project is upgraded to Node 18 or later.

Edit: I replaced ffmpeg with play-dl stream for non-caching videos. This should actually resolve the issue mentioned in #1018. Also I don't know why the Lint check fails.

  • I updated the changelog

Copy link

github-actions bot commented May 18, 2024

📦 A new release has been made for this pull request.

To play around with this PR, pull codetheweb/muse:pr-1031 or codetheweb/muse:638f80da82318d06b9f8bf3f4b13e0b8e02099a5.

Images are available for x86_64 and ARM64.

Latest commit: 638f80d

Copy link
Collaborator

@codetheweb codetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

I tested this out and it seems like tracks aren't being cached anymore.

I'd also like to replace ytsr/spotify-web-api-node with play-dl, but that can be a separate PR if you want.

@MarcoCoreDuo
Copy link
Contributor Author

MarcoCoreDuo commented Jun 2, 2024

thank you!

I tested this out and it seems like tracks aren't being cached anymore.

That's strange. For me, caching works. I also checked it with the IDE debugger. Maybe you could send me the track you tested.

I'd also like to replace ytsr/spotify-web-api-node with play-dl, but that can be a separate PR if you want.

I will look into that.

Edit: Btw you should update muse's spotify-uri dependency because the spotify urls are now localized and will always return 'No video found'. The new version will ignore the localization.

@alvarosdev
Copy link

Hello friend, I tried with the following docker, but no sound reaches Discord :/

version: '3.4'

services:
  muse:
    image: codetheweb/muse:pr-1031
    restart: always
    volumes:
      - ./muse:/data
    env_file: .env

Logs

muse-1  | 2024-07-01T04:44:23.823Z muse Caching video
muse-1  | 2024-07-01T04:44:24.094Z muse Spawned ffmpeg with ffmpeg -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5 -to 179 -i https://rr3---sn-uxgg5-852s.googlevideo.com/videoplayback?expire=1719830663&ei=JzSCZoW_HYqC-LAP-Z-R0AM&ip=x.x.x.x&id=o-AMRHIDYqhnTZvEsqtnyTb3myXNg5sp_9JFiESjtuBlml&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zZ&mm=31%2C29&mn=sn-uxgg5-852s%2Csn-uxgg5-njaed&ms=au%2Crdu&mv=m&mvi=3&pcm2cms=yes&pl=19&initcwndbps=1755000&bui=AbKP-1Mr55v3yset3AVpDAeGTzwPfDDWDOD1M00Zz5dAw_OAg_TmF_TOVYcrT1LmSL-Hyss45JWaUC13&spc=UWF9fwTsv2M1BdaI8yXIQzTO-aqjcZQ84x_et_IDtPCDy5i8mSLzMXgg0hTd&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=WwPH8zmNszPmCfEWbU5R7wIQ&rqh=1&gir=yes&clen=2837775&dur=178.261&lmt=1714668725008347&mt=1719808616&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=4402434&n=gg2Qg3z7Rpd0QvRX&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAMMuqUyc4IEvvwApHV339Nl79OthpDwFyN4OyFeVbwjRAiBWb_3y-DriWKUJs6olTkKz8mCbUQlCCwqJzrTztQyf7Q%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRAIgdsvg5whdr5Fx-NZHXlMYGdw0wtO8xUlsQm81cvj778ACIDtoLXdD0Q2bBr83wJ-8FJC7x3KEy6PR2S_v2Lu1UL5C -acodec libopus -vn -f webm -filter:a volume=-8.9099998dB pipe:1

That URL (rr3---blabla...) returns an HTTP 403 Forbidden error code.

@MarcoCoreDuo
Copy link
Contributor Author

Hello friend, I tried with the following docker, but no sound reaches Discord :/

version: '3.4'

services:
  muse:
    image: codetheweb/muse:pr-1031
    restart: always
    volumes:
      - ./muse:/data
    env_file: .env

Logs

muse-1  | 2024-07-01T04:44:23.823Z muse Caching video
muse-1  | 2024-07-01T04:44:24.094Z muse Spawned ffmpeg with ffmpeg -reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5 -to 179 -i https://rr3---sn-uxgg5-852s.googlevideo.com/videoplayback?expire=1719830663&ei=JzSCZoW_HYqC-LAP-Z-R0AM&ip=x.x.x.x&id=o-AMRHIDYqhnTZvEsqtnyTb3myXNg5sp_9JFiESjtuBlml&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=zZ&mm=31%2C29&mn=sn-uxgg5-852s%2Csn-uxgg5-njaed&ms=au%2Crdu&mv=m&mvi=3&pcm2cms=yes&pl=19&initcwndbps=1755000&bui=AbKP-1Mr55v3yset3AVpDAeGTzwPfDDWDOD1M00Zz5dAw_OAg_TmF_TOVYcrT1LmSL-Hyss45JWaUC13&spc=UWF9fwTsv2M1BdaI8yXIQzTO-aqjcZQ84x_et_IDtPCDy5i8mSLzMXgg0hTd&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=WwPH8zmNszPmCfEWbU5R7wIQ&rqh=1&gir=yes&clen=2837775&dur=178.261&lmt=1714668725008347&mt=1719808616&fvip=5&keepalive=yes&c=WEB&sefc=1&txp=4402434&n=gg2Qg3z7Rpd0QvRX&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAMMuqUyc4IEvvwApHV339Nl79OthpDwFyN4OyFeVbwjRAiBWb_3y-DriWKUJs6olTkKz8mCbUQlCCwqJzrTztQyf7Q%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AHlkHjAwRAIgdsvg5whdr5Fx-NZHXlMYGdw0wtO8xUlsQm81cvj778ACIDtoLXdD0Q2bBr83wJ-8FJC7x3KEy6PR2S_v2Lu1UL5C -acodec libopus -vn -f webm -filter:a volume=-8.9099998dB pipe:1

That URL (rr3---blabla...) returns an HTTP 403 Forbidden error code.

Hi, sadly play-dl broke two weeks ago because YouTube changed something. We have to wait for a fix.

@MarcoCoreDuo MarcoCoreDuo marked this pull request as draft July 1, 2024 05:25
@Codixer
Copy link
Contributor

Codixer commented Oct 28, 2024

@MarcoCoreDuo
Hey Marco! I am going past all PR's and checking this one, would you like to still work on this? Or can this be closed?

@MarcoCoreDuo
Copy link
Contributor Author

@MarcoCoreDuo Hey Marco! I am going past all PR's and checking this one, would you like to still work on this? Or can this be closed?

Hi, I think play-dl is still broken (no updates) and I can't really debug because of the "Sign in to confirm you’re not a bot" error. I will close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to play-dl
4 participants