Battleman / zoomdl

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

Implement system exit code on error #77

Closed niklasbogensperger closed 2 years ago

niklasbogensperger commented 2 years ago

Would solve my own open issue. Closes #76 There is potential to implement more granular exit codes in the future.

niklasbogensperger commented 2 years ago

Sample log output (see my issue for comparison):

❯ ./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 $?
1

I also confirmed it still works as expected with a valid zoom recording link. It just returns exit status 0 as before and as intended.

niklasbogensperger commented 2 years ago

I just realized that there are indeed some sys.exit() statements already implemented (also in another pull request, #75; ex. line), but not all errors are actually covered as evidenced by the log in my issue.

I don't know which solution you prefer (a sys.exit() after every individual error vs. a sys.exit(exit_code) at the end of the script) but I think it would be good if it is implemented consistently.

Battleman commented 2 years ago

I see the problem. I'll merge that one into Beta and see what looks best. Thanks for the contribution.

niklasbogensperger commented 2 years ago

I see the problem. I'll merge that one into Beta and see what looks best. Thanks for the contribution.

Thanks! Let me know if I can help at all with implementing.