Tzahi12345 / YoutubeDL-Material

Self-hosted YouTube downloader built on Material Design
MIT License
2.6k stars 265 forks source link

mp3 Playlist unplayable. #202

Closed ItzGonzoHD closed 3 years ago

ItzGonzoHD commented 4 years ago

I'm trying to download a YouTube playlist thru the subscriptions tab with Audio Only enabled, they all seem to successfully download and i can see them in my download folder but when i try to play them with VLC they dont play at all.

I have also tried to download some of the videos in audio only thru the main page and the first few tries they download and are playable with VLC but after some time they start being downloaded unplayable.

i have also used foobar2000 only to tell me the files are corrupted or unsupported format but they are all .mp3

any help will be appreciated and i can provide logs or anything needed if requested. (just need to find them)

Tzahi12345 commented 4 years ago

Can you check the browser console to see if any errors go through? I think I reproduced this issue but after a page reload it went away :/

What an elusive bug lol, I'll try to see if I can consistently reproduce it somehow.

ItzGonzoHD commented 4 years ago

no errors go through the browser console.

btw, im using docker thru unraid. but i can see this in logs LOG

also this is what i see when i try to play with foobar IMG

Tzahi12345 commented 4 years ago

Have you tried using the default downloading agent? Perhaps that will fix the No such file or directory error.

ItzGonzoHD commented 4 years ago

I set it to use the default downloading agent LOG no change in the error. and files still unplayable.

also decided to download them with the audio-only mode off.. it downloads the whole playlist without any error and can play them perfectly.

Tzahi12345 commented 4 years ago

Hm I can't seem to reproduce. Can you try pulling the latest nightly and seeing if that fixes it? I added a potential fix, but I can't test it until I'm able to consistently reproduce the problem.

Also, do you mind sharing the playlist it's failing on? The bug could be specific to that playlist for some reason.

ItzGonzoHD commented 4 years ago

I pulled the latest and downloaded the playlist. only had 1 file playable and also made another subscription and only 3 I made a new docker with the nightly release.

LOGS 1 file playable test1 3 file playable test2

EDIT: all files playable thru the browser, but not on my pc and they can also only be played with my media server(plex).

ItzGonzoHD commented 4 years ago

I was able to download the playlist directly from the Home page using custom arguments such as

-o audio/%(playlist)s/%(playlist)s - %(title)s.%(ext)s -x --audio-format mp3 --write-info-json --print-json

this way all files are playable.

RashiqAzhan commented 3 years ago

I would like to chime in here. All by subscription audio-only mp3 are unplayable. I've tired other computers but to no avail. Even right clicking the files causes the explorer to stop responding. After it does respond (ages later) the music won't start playing immediately. Then it stutters and I can't seek forwards or backwards. This happens with Goove Music and the Windows Media Player.

Aimp seems to take forever to load these songs but other songs from the same drive load fine.

The same songs downloaded through other means plays without a hitch.

I have included 3 mp3 files as a sample that gave me problems. There are from a sample size of 7000. It would be a shame if I had to manually find each and every one these songs and download them manually.

Sample.zip

Tzahi12345 commented 3 years ago

@RashiqAzhan I tried the videos. They loaded up no problem, but had the same scrolling/corruption issues.

I had a sneaking suspicion that it wasn't actually an mp3 that was downloaded, and it looks like I'm right. Run the file through this file-type checker website and you'll see what I mean, these "mp3s" are actually webms.

It actually looks like a simple fix from my end, basically I'm defining the file extension when I shouldn't, and it ends up confuses the auto-conversion for youtube-dl (it thinks it's already an mp3). See more details here. Looks like this is the original bug that @ItzGonzoHD was dealing with, and it makes extra sense that -o audio/%(playlist)s/%(playlist)s - %(title)s.%(ext)s -x --audio-format mp3 --write-info-json --print-json would fix it, because those args leave the file extension dynamic (%(ext)s as it should be). I'll try to get a fix out tonight, if not over this weekend for sure!

Tzahi12345 commented 3 years ago

Bug should be fixed! See commit here. Not sure how you should handle all the files with the wrong extension, maybe a script to auto-detect when it's wrong and use ffmpeg to convert? Just throwing ideas out there.

Anyways, thanks for the help getting this resolved, it was quite obscure and probably only affects a limited number of videos so it's good we caught it now rather than later. Let me know if the latest nightly removes this problem!

ItzGonzoHD commented 3 years ago

Used the latest nightly pull for the past hour and havent had an error with it.

All files downloaded are now playable. Thank you for the fix.

RashiqAzhan commented 3 years ago

Sorry for the dumb questions but where can I find the nightly builds? Do I clone the 'fix-playlist-downloading-bug' branch and go from there?

Also, copying over the appdata and the subscription folder from the old install to the new install is sufficient to preserve subscription data?

Tzahi12345 commented 3 years ago

Sorry for the dumb questions but where can I find the nightly builds?

Not a dumb question! If you're on Docker then just change the image from tzahi12345/youtubedl-material:latest to tzahi12345/youtubedl-material:nightly.

If you're not on Docker, the process is a tad more complicated. Head over to the Build it yourself second of the README. You'll want to transfer your appdata, users, subscriptions, audio, and video folders from your original install once that's done.

Updating using Docker is by far the easiest way as it only requires a docker-compose pull and then you're all set :)