very-cool-group

exit()

If you want to exit your code programmatically, you might think to use the functions exit() or quit(), however this is bad practice. These functions are constants added by the site module as a convenient method for exiting the interactive interpreter shell, and should not be used in programs.

You should use either SystemExit or sys.exit() instead. There's not much practical difference between these two other than having to import sys for the latter. Both take an optional argument to provide an exit status.

Official documentation with the warning not to use exit() or quit() in source code.

ytdl

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)