Battleman / zoomdl

Download Zoom recorded meetings easily
GNU General Public License v3.0
341 stars 44 forks source link

Implement exit statuses #76

Open niklasbogensperger opened 2 years ago

niklasbogensperger commented 2 years ago

Prerequisite

Describe the bug

I wanted to use zoomdl as part of a bash script I am writing for myself to download videos to a ramdisk and upload it directly to my cloud storage. However, I discovered that even if something fails, zoomdl will only print out error messages to the console but not set an exit status so my script can react properly. Zoomdl will report successful completion to the shell in any case.

To Reproduce

  1. Use a bad/expired zoom recording link
  2. Zoomdl will report something like "[ERROR] Video not found in page. Is it login-protected?" in the shell
  3. The shell will report that zoomdl terminated successfully with exit code 0 and await your input again
  4. So if you want to do some error handling as part of a larger script, you're out of luck

Expected behavior

Zoomdl is distributed as an executable (not just a raw python script) and thus meant to be run in a shell, so it should also report standard shell exit codes.

Screenshots

URL (opt)

<any expired/invalid zoom recording link> for example: https://www.zoom.us/rec/play/404

Logs

~ >  ./zoomdl -u https://www.zoom.us/rec/play/404 -v 0
Using standard Windows UA
Changing page to https://www.zoom.us/rec/play/404
Advanced meta failed
Unable to extract chatList from page
Unable to extract transcriptList from page
Metas are {'cookie_currency': 'EUR', 'currency_symbol': '€', '__platformCheck': '', 'detect': 'https://st2.zoom.us/cdn-detect.png', 'chatList': [], 'transcriptList': []}
No video URL in meta, going bruteforce
[ERROR] Video not found in page. Is it login-protected? 
Try to refresh the webpage, and export cookies again
Unable to find metadata, aborting.

~ > echo $?
0

Versions (please complete the following information):

Additional context (opt) I want this line to work as intended in my shell script: ${script_dir}/zoomdl -u "$url" -f "$filename" || continue If zoomdl encounters an error, it should return a non-zero exit code to the shell such that the continue statement is executed and skips the rest of the loop this line is contained in.