YoutubeDL-Material icon indicating copy to clipboard operation
YoutubeDL-Material copied to clipboard

[BUG] Can't download any YouTube video

Open miguelarios opened this issue 2 years ago • 9 comments

Describe the bug I add a YouTube link and nothing gets downloaded.

To Reproduce Steps to reproduce the behavior:

  1. Go to home
  2. Click on URL field
  3. Add YouTube link
  4. Click download
  5. Go to downloads and see that nothing is being downloaded.

Expected behavior Download the video

Screenshots See attached.

image

image

image

Environment

  • YoutubeDL-Material version v4.3
  • Docker tag: nightly

Ideally you'd copy the info as presented on the "About" dialogue in YoutubeDL-Material. (for that, click on the three dots on the top right and then check "installation details". On later versions of YoutubeDL- Material you will find pretty much all the crucial information here that we need in most cases!)

Additional context Add any other context about the problem here. For example, a YouTube link.

miguelarios avatar Jun 30 '22 18:06 miguelarios

Mind providing some logs? Hard to tell what's going on here without them. Thanks!

Tzahi12345 avatar Jul 01 '22 04:07 Tzahi12345

Brand new to this app (just set it up yesterday). I have been having issuing downloading videos as well. It's almost a 50/50 chance whether the download actually succeeds or not with some random videos that I have tested so far. Often it just gets stuck here:

image

and never continues.

Reading the logs I keep getting errors along these lines:

2022-07-03T03:54:51.591Z ERROR: Error while retrieving info on video with URL https://www.youtube.com/watch?v=cn2L-oljtfc with the following message: Error: Command failed with exit code 1: node_modules/youtube-dl/bin/youtube-dl -o video/%(title)s.mp4 --write-info-json -f bestvideo+bestaudio --merge-output-format mp4 --write-thumbnail --no-clean-info-json -j --no-simulate --dump-json http://www.youtube.com/watch?v=cn2L-oljtfc
ERROR: unable to rename file: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag61.part' -> 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag61'
ERROR: unable to download video data: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag61'
2022-07-03T03:57:04.696Z ERROR: Error while retrieving info on video with URL https://www.youtube.com/watch?v=cn2L-oljtfc with the following message: Error: Command failed with exit code 1: node_modules/youtube-dl/bin/youtube-dl -o video/%(title)s.mp4 --write-info-json -f bestvideo+bestaudio --merge-output-format mp4 --write-thumbnail --no-clean-info-json -j --no-simulate --dump-json http://www.youtube.com/watch?v=cn2L-oljtfc
ERROR: unable to rename file: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag187.part' -> 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag187'
ERROR: unable to download video data: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag187'
2022-07-03T03:57:50.823Z ERROR: Error while retrieving info on video with URL https://www.youtube.com/watch?v=cn2L-oljtfc with the following message: Error: Command failed with exit code 1: node_modules/youtube-dl/bin/youtube-dl -o video/%(title)s.mp4 --write-info-json -f bestvideo+bestaudio --merge-output-format mp4 --write-thumbnail --no-clean-info-json -j --no-simulate --dump-json http://www.youtube.com/watch?v=cn2L-oljtfc
ERROR: unable to rename file: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag236.part' -> 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag236'
ERROR: unable to download video data: [Errno 2] No such file or directory: 'video/Parallel programming in Chapel - part 1.f247.webm.part-Frag236'
Lines: 
50

A rare case (only once so far), the video downloading does continue, but the downloaded file is just corrupt and unwatchable. Certainly also odd.

marcus-k avatar Jul 03 '22 04:07 marcus-k

Mind providing some logs? Hard to tell what's going on here without them. Thanks!

Sure! Sorry about that. It's just the logs are rather nonexistent

ERROR: [youtube] GCcCfRc-qgY: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] TaFlyFkZvM4: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] t4BUAKkPJe0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] Qhu7aQsLAvA: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] MZ6LS4l3roE: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] An9FA6a8dyc: Video unavailable. The uploader has not made this video available in your country
2022-07-03T04:59:07.076Z ERROR: Subscription check failed!
2022-07-03T05:01:18.824Z VERBOSE: Subscription: getting videos for subscription Cocktails with args: --dump-json,-o,"subscriptions/playlists/Cocktails/%(title)s.%(ext)s",-ciw,--write-info-json,--print-json,-f,bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4,--add-metadata,--write-thumbnail,--no-clean-info-json
2022-07-03T05:01:25.980Z VERBOSE: Subscription: finished check for Cocktails
2022-07-03T05:03:48.821Z VERBOSE: Watching Recipes with delay interval of 150000
2022-07-03T05:03:48.822Z VERBOSE: Watching Cocktails with delay interval of 150000
2022-07-03T05:03:48.826Z VERBOSE: Subscription: getting videos for subscription Recipes with args: --dump-json,-o,"subscriptions/playlists/Recipes/%(title)s.%(ext)s",-ciw,--write-info-json,--print-json,-f,bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4,--all-subs,--add-metadata,--write-thumbnail,--no-clean-info-json
2022-07-03T05:04:07.377Z VERBOSE: Subscription: finished check for Recipes
2022-07-03T05:04:07.377Z ERROR: WARNING: [youtube:tab] YouTube said: INFO - 10 unavailable videos are hidden
WARNING: [youtube:tab] YouTube said: INFO - Unavailable videos will be hidden during playback
ERROR: [youtube] Qy0HncHOQe0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] An9FA6a8dyc: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] 2oUskw2O_RM: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] YIv5ExcxNJ0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] GCcCfRc-qgY: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] TaFlyFkZvM4: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] t4BUAKkPJe0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] Qhu7aQsLAvA: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] MZ6LS4l3roE: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] An9FA6a8dyc: Video unavailable. The uploader has not made this video available in your country
2022-07-03T05:04:07.377Z ERROR: Subscription check failed!
2022-07-03T05:04:46.500Z INFO: Config items set using ENV variables.
2022-07-03T05:04:46.642Z INFO: Restarting server...
2022-07-03T05:04:47.259Z INFO: Config items set using ENV variables.
2022-07-03T05:04:48.165Z INFO: YoutubeDL-Material v4.3 started on PORT 17442
2022-07-03T05:04:48.166Z VERBOSE: Watching Recipes with delay interval of 150000
2022-07-03T05:04:48.167Z VERBOSE: Watching Cocktails with delay interval of 150000
2022-07-03T05:04:48.172Z VERBOSE: Subscription: getting videos for subscription Recipes with args: --dump-json,-o,"subscriptions/playlists/Recipes/%(title)s.%(ext)s",-ciw,--write-info-json,--print-json,-f,bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4,--all-subs,--add-metadata,--write-thumbnail,--no-clean-info-json
2022-07-03T05:04:48.411Z VERBOSE: Disabling checking downloads as none are available.
2022-07-03T05:05:05.688Z DEBUG: URL info retrieval delay: 1.66 seconds.
2022-07-03T05:05:06.135Z VERBOSE: Subscription: finished check for Recipes
2022-07-03T05:05:06.135Z ERROR: WARNING: [youtube:tab] YouTube said: INFO - 10 unavailable videos are hidden
WARNING: [youtube:tab] YouTube said: INFO - Unavailable videos will be hidden during playback
ERROR: [youtube] Qy0HncHOQe0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] An9FA6a8dyc: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] 2oUskw2O_RM: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] YIv5ExcxNJ0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] GCcCfRc-qgY: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] TaFlyFkZvM4: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] t4BUAKkPJe0: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] Qhu7aQsLAvA: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] MZ6LS4l3roE: Video unavailable. The uploader has not made this video available in your country
ERROR: [youtube] An9FA6a8dyc: Video unavailable. The uploader has not made this video available in your country
2022-07-03T05:05:06.135Z ERROR: Subscription check failed!
2022-07-03T05:05:10.395Z DEBUG: Inserted doc into download_queue

You can see how it adds it to the download queue but there is never a download of the description or title or anything. My screenshot looks the same as the other person that just posted on here.

miguelarios avatar Jul 03 '22 05:07 miguelarios

Any updates here? Still not working with latest updates.

miguelarios avatar Jul 26 '22 19:07 miguelarios

It looks like our errors are slightly different from the logs, but regardless, I am also still unfortunately unable to reliably download videos as well. I am using an unaltered version of the docker-compose file for setup too. Not sure what the issue might be.

marcus-k avatar Jul 26 '22 20:07 marcus-k

I just removed the container and using nightly and still when I copy a YouTube link and click download nothing happens. As in the download goes to the queue but it never actually downloads anything.

miguelarios avatar Aug 29 '22 02:08 miguelarios

I also seem to have this issue as well and this just started. Cleared logs, restarted server and tried to download something.

2023-05-25T01:53:22.563Z INFO: Restarting server...
2023-05-25T01:53:23.621Z INFO: Config items set using ENV variables.
2023-05-25T01:53:23.962Z INFO: YoutubeDL-Material v4.3.1 started on PORT 17442
2023-05-25T01:53:24.910Z VERBOSE: Disabling checking downloads as none are available.
2023-05-25T01:54:46.525Z DEBUG: Inserted doc into download_queue
2023-05-25T01:54:47.248Z DEBUG: URL info retrieval delay: 1.387 seconds.

The last thing I did was add a subscription to download a playlist. I also had noticed that the docker compose changed from image: mongo to image: mongo:4 so the mongodb wasn't starting and was using a local db instead. I fixed that as well but nothing has changed since adding a subscription.

I've considered the filenames were too long and outputted shorter names, no change. Permissions are still correct and I was using it fine just days prior.

docker-compose.yml

version: "2"
services:
    ytdl_material:
        image: tzahi12345/youtubedl-material:latest
        container_name: ytdl-material
        environment:
            ytdl_mongodb_connection_string: 'mongodb://ytdl-mongo-db:27017'
            ytdl_use_local_db: 'false'
            write_ytdl_config: 'true'
            UID: 1000
            GID: 1000
        restart: always
        depends_on:
            - ytdl-mongo-db
        volumes:
            - /mnt/Kingston/docker/YTDL-Material/appdata:/app/appdata
            - /mnt/Kingston/docker/YTDL-Material/audio:/app/audio
            - /mnt/Kingston/docker/YTDL-Material/video:/app/video
            - /mnt/Kingston/docker/YTDL-Material/subscriptions:/app/subscriptions
            - /mnt/Kingston/docker/YTDL-Material/users:/app/users
        ports:
            - "50032:17442"
    ytdl-mongo-db:
        image: mongo:4
        container_name: ytdl-db
        environment:
            UID: 1000
            GID: 1000
        restart: always
        ports:
            - "27017:27017"
        logging:
            driver: "none"
        volumes:
            - /mnt/Kingston/docker/YTDL-Material/db/:/data/db

ytdlerror

Edit: just tried to download the video with yt-dlp manually (edited logs to a little to hide the title & who, not here to start a debate 😅)

c:\youtubedl>yt-dlp.exe https://twitter.com/xxx/status/1234567890
[twitter] Extracting URL: https://twitter.com/xxx/status/1234567890
[twitter] 1234567890: Downloading guest token
[twitter] 1234567890: Downloading JSON metadata
[twitter] 1234567890: Downloading m3u8 information
[info] 1234567890: Downloading 1 format(s): http-2176
[download] Unable to open file: [Errno 22] Invalid argument: 'foo bar 🏳️\u200d🌈 - "xxxx. [1234567890].mp4.part'. Retrying (1/3)
...
ERROR: unable to open for writing: [Errno 22] Invalid argument: 'foo bar 🏳️\u200d🌈 - "xxxx. [1234567890].mp4.part'

So I added --restrict-filenames to the argument path. Did not change anything either.

Playing around with it more...

2023-05-25T03:14:13.911Z INFO: Config items set using ENV variables.
2023-05-25T03:14:14.188Z ERROR: Failed to check yt-dlp version for an update.
2023-05-25T03:14:14.189Z INFO: YoutubeDL-Material v4.3.1 started on PORT 17442
2023-05-25T03:14:15.192Z VERBOSE: Disabling checking downloads as none are available.
2023-05-25T03:14:27.367Z DEBUG: Successfully closed stream and removed file reference.
2023-05-25T03:14:32.683Z DEBUG: Inserted doc into download_queue
2023-05-25T03:14:34.320Z DEBUG: URL info retrieval delay: 2.324 seconds.
2023-05-25T03:14:34.320Z ERROR: Error during retrieving formats for https://www.youtube.com/watch?v=trm0IDFo_NI: Error: Command failed with exit code 1: node_modules/youtube-dl/bin/youtube-dl --dump-json http://www.youtube.com/watch?v=trm0IDFo_NI
2023-05-25T03:14:34.320Z ERROR: Failed to retrieve available formats for url: https://www.youtube.com/watch?v=trm0IDFo_NI

After realizing it's not updating yt-dlp, I looked into that and noticed by visiting https://api.github.com/repos/yt-dlp/yt-dlp/tags that I have exceeded the API rate limit. I managed to install yt-dlp but still, nothing changed.

Last edit:

2023-05-25T03:38:27.943Z ERROR: Error during retrieving formats for https://www.youtube.com/watch?v=trm0IDFo_NI: Error: Command failed with exit code 1: node_modules/youtube-dl/bin/youtube-dl --dump-json http://www.youtube.com/watch?v=trm0IDFo_NI
2023-05-25T03:38:27.943Z ERROR: Failed to retrieve available formats for url: https://www.youtube.com/watch?v=trm0IDFo_NI

It is yt-dlp and it is up to date. I noticed download_queue is locked at 10 and there are no available downloads to remove. I looked at the previous local storage DB and saw recent links were set to "null" for all the data except the URL. I think this has something to do with not being able to detect the resolutions and fails to download.

samstarnes avatar May 25 '23 02:05 samstarnes

Were you able to figure out something. I am facing the same issue since very long, but didn't have time to sit down and look into it and post it here.

syedair avatar Sep 03 '23 07:09 syedair

@syedair No, so for the past 3 months I've written my own. It works in its current state but is no where near finished. The code is a mess and there's a lot of features missing but I'm still working on it.

I'd still like to get this working though but no solutions. Logged into the mongoDB and cleaned out the queued downloads manually. No fix and oddly no specific errors in any logs.

samstarnes avatar Sep 03 '23 20:09 samstarnes