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 for --download-archive #13598

Open
ghost opened this issue Jul 7, 2017 · 2 comments
Open

Exit code for --download-archive #13598

ghost opened this issue Jul 7, 2017 · 2 comments

Comments

@ghost
Copy link

@ghost ghost commented Jul 7, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

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

  • I've verified and I assure that I'm running youtube-dl 2017.07.02

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

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)
  • Question
  • Other

Output

$ youtube-dl -v --download-archive archive https://www.youtube.com/watch?v=tPEE9ZwTmy0
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--download-archive', u'archive', u'https://www.youtube.com/watch?v=tPEE9ZwTmy0']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.07.02
[debug] Python version 2.7.12 - Linux-4.4.0-83-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.11-0ubuntu0.16.04.1, ffprobe 2.8.11-0ubuntu0.16.04.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] tPEE9ZwTmy0: Downloading webpage
[youtube] tPEE9ZwTmy0: Downloading video info webpage
[youtube] tPEE9ZwTmy0: Extracting video information
[youtube] tPEE9ZwTmy0: Downloading MPD manifest
[download] Shortest Video on Youtube has already been recorded in archive
$ echo $?
0

Issue

The exit code is 0 even though no video is downloaded. This makes it impossible in a script to determine if youtube-dl actually downloaded something. Could we have an appropriate exit code, like with --max-downloads? See also #10388

@tommcintyre
Copy link

@tommcintyre tommcintyre commented Jul 22, 2017

An exit case of 0 in this case is correct; there was no failure, everything worked as expected, so a nonzero exit code would not be convention. There are better ways to do what you want.

--max-downloads should arguably not be abusing the exit code in such a way either - as discussed here: #10388 (comment).

@weedy
Copy link

@weedy weedy commented Nov 19, 2017

I'm having the opposite problem.

youtube-dl ytuser:${channel} --console-title -f '298+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/best[ext=mp4]/best' --youtube-include-dash-manifest --output "%(upload_date)s-%(playlist_index)s-%(title)s-%(id)s.%(ext)s" --restrict-filenames --download-archive ${channel}-youtube --ignore-errors --sleep-interval 3 --playlist-reverse --socket-timeout 11 --write-sub --sub-format 'ass/srt/best' --sub-lang en --embed-subs --rate-limit 7M --dateafter 20171022 --datebefore $(date --date='3 days ago' '+%Y%m%_d')
...
[download] MY HANGOVER MAKEUP ROUTINE // Grace Helbig has already been recorded in archive
[download] Downloading video 753 of 754
[download] MTV EMAs FASHION REVIEW w/KRISTEN MCATEE // Grace Helbig has already been recorded in archive
[download] Downloading video 754 of 754
[youtube] QdOVWsqPp2E: Downloading webpage
[youtube] QdOVWsqPp2E: Downloading video info webpage
[youtube] QdOVWsqPp2E: Extracting video information
WARNING: video doesn't have subtitles
[youtube] QdOVWsqPp2E: Downloading MPD manifest
[download] 2017-11-17 upload date is not in range 2017-10-22 - 2017-11-16
[download] Finished downloading playlist: Uploads from Grace Helbig
Error code: 1
[youtube:user] graciehinabox: Downloading channel page
[youtube:playlist] UUIiBf-JbtCazHSFqXV4JgoA: Downloading webpage
[download] Downloading playlist: Uploads from Grace Helbig

youtube-dl has completed what I consider a successful run but isn't exiting with a 0.
Was this changed since this bug was created? It doesn't even happen on every channel.

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.