Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Different return codes for different situations, please. #852
Comments
|
Sorry, I don't understand your overall problem, and I strongly suspect there is a better solution. Why does your script want to know the reason why youtube-dl exited? Why we could document exit codes and use multiple ones, that would become very complicating when multiple videos are involved. |
|
Different errors require different actions. "when multiple videos are involved." Huh, I never noticed that you can d/l multiple videos. I put video URLs in a text file and the script reads the "head -n1" url, and once it's succeeded in downloading it, deletes it (with "sed '1d'" and again reads the "head -n1" url. This way, I can keep appending URLs to the back of the file as I see fit. |
|
a) is #506, #809 . Instead of just working with your script, it would be beneficial have this feature for all users of youtube-dl. A 404 doesn't necessarily mean that the video doesn't exist - it could just be a temporary error. Basically, you want youtube-dl to download the video (and retry if a network issue occurs), and fail (with exit code 1) otherwise. Checking of videos from the input batch file has been suggested as well, but that is indeed something that doesn't fit into youtube-dl's core competencies, although I wouldn't reject any code change to that effect. I'm closing this issue now, as a duplicate of #505 and #809. However, feel free to comment if you think there are other reasons for multiple exit codes, and we'll promptly reopen it. Thanks! |
|
"--retries" seems a partial solution. Errors happen so infrequently, though, that I won't know for a while. |
|
I would like to have a different exit code for network based problems vs. out of space or other things. |
|
I have a big script which downloads hundreds of videos and also tracks which video is already downloaded, which not needs being downloaded and log errors. Logging errors means automatically assigning error status after a try, not just human reading console. So I need to distinguish between a) success b) no video on page c) video is present but page is not supported (error happened). Now I have to analyze each log contents. |
|
@sergei-sh Please go to #882 for future discussions. Exit codes sounds a possible feature for me, while this issue is already superseded by #882. By the way, it's almost impossible to check whether there are videos or not. A common approach is introducing some heuristics, for example finding error strings in the web page. It should work in most cases but nobody can guarantee. Anyway, #10308 should be resolved first - adding more exception classes to the code base. |
Hi,
(Great job fixing the "slow flv" issue!)
ERROR: Unable to download video webpage: HTTP Error 404: Not Found
Also, when it fails to d/l the complete video.
Please exit with different "greater than 1" codes when such errors occur. That way, scripts can handle them in the appropriate manner.
Thanks.