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

Exit code 0 when actually failing #15634

Closed
bumbummen99 opened this issue Feb 17, 2018 · 3 comments
Closed

Exit code 0 when actually failing #15634

bumbummen99 opened this issue Feb 17, 2018 · 3 comments

Comments

@bumbummen99
Copy link

@bumbummen99 bumbummen99 commented Feb 17, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.02.11. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • [X ] I've verified and I assure that I'm running youtube-dl 2018.02.11

Before submitting an issue make sure you have:

  • [X ] At least skimmed through the README, most notably the FAQ and BUGS sections
  • [X ] Searched the bugtracker for similar issues including closed ones
  • [X ] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • [X ] Question
  • Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):


If the purpose of this issue is a site support request please provide all kinds of example URLs support for which should be included (replace following example URLs by yours):

Note that youtube-dl does not support sites dedicated to copyright infringement. In order for site support request to be accepted all provided example URLs should not violate any copyrights.


Description of your issue, suggested solution and other information

I am trying to develop an aplication with youtube-dl. When downloading a video to a very nested subfolder in order to reach the maixmum path length youtube-dl outputs the error

ERROR: unable to open for writing: [Errno 2] No such file or directory: 'South Park_December 17, 1997_1_0110_South Park 110 - Mr. Hankey, der Weihnachtskot - 1. Ak-e6039bb4-ed00-11e0-aca6-0026b9414f30.mp4.part-Frag0.part'

(Used southpark for example). The process then exits with error code 0 (success) indicating that everything went well. I have also tested this beahivour with mistyped url's (404). Checking for the exitcode is therefore not working. Also if i start youtube dl within a c# process i cant get the error output. If i redirect all output it is still visible within my console window so it seems like the error message is returned some other way.

How can i catch all errors programmaticaly when using youtube-dl and why is the exit code always 0?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 17, 2018

>py -3.6 -m youtube_dl BaW_jenozKc  -o '%(title)400s.%(ext)s'
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading video info webpage
[youtube] BaW_jenozKc: Extracting video information
ERROR: unable to open for writing: [Errno 2] No such file or directory: "'                                                                                                                                                                                                                                                                                                                                                                                    youtube-dl test video ''_ä↭𝕐.mp4'.f137.part"

>echo %ERRORLEVEL%
1

Most likely you're getting error code of wrapping process not youtube-dl.

@bumbummen99
Copy link
Author

@bumbummen99 bumbummen99 commented Feb 17, 2018

I have got it working by starting youtube-dl directly as a Process and setting the WorkingDirectory first. That way i could avoid using cmd.exe and get the right exit code. -o does not work for multiple files.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 17, 2018

-o does not work for multiple files.

Not true.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.