ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.42k stars 10.04k forks source link

python script that uses youtube-dl works on my machine, but not on the server #29607

Closed MoaadLala closed 1 year ago

MoaadLala commented 3 years ago

I have been trying to setup a python server, that uses youtube-dl, the script on my machine (on localhost) is working, but on the server, it doesn't, i made sure that am using the same versions as in my linux machine (youtube-dl 2021.6.6, flask 2.0.1, flask-cors 3.0.10, python 3.8), is there a way to solve this issue? Thanks to anyone who helps to solve this annoying bug..

dirkf commented 3 years ago

Even though you put the instructions in the issue title, we don't see the "complete output" requested.

No doubt the environment in which the server is running yt-dl is different from that on your Linux machine. The verbose log from the server instance will likely make this clear.

MoaadLala commented 3 years ago

So like I said, am using it with python, how can I add the verbose flag there? Thank you for answering

ghost commented 3 years ago

If you are using EMBEDDING YOUTUBE-DL, add 'verbose': True, to the options. And please show the whole options, urls and the logs.

MoaadLala commented 3 years ago

For some reason, after adding the 'verbose': True to my options, it now works... Thank you so much for helping, i really appreciate it.

This is what i got back from my linux machine (localhost), which works fine:

This is what i got back from my Flask server (python):

2021-07-22 12:35:25,701: [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 2021-07-22 12:35:25,701: [debug] youtube-dl version 2021.06.06 2021-07-22 12:35:25,761: [debug] Python version 3.8.5 (CPython) - Linux-5.4.0-1038-aws-x86_64-with-glibc2.29 2021-07-22 12:35:26,370: [debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4 2021-07-22 12:35:26,371: [debug] Proxy map: {'http': 'http://proxy.server:3128', 'https': 'http://proxy.server:3128', 'no': 'localhost,127.0.0.1,localaddress,.localdomain.com,/var/run/docker.sock'}

MoaadLala commented 3 years ago

So, apparently it works with some videos while it doesn't with others, is there a way around this?

dirkf commented 3 years ago

Show the full verbose output from a successful and a failing video.