mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-18 04:47:25 +01:00
Refactor main function
This commit is contained in:
parent
51c8e53ffe
commit
5adcaa4385
@ -2872,9 +2872,7 @@ def parseOpts():
|
||||
|
||||
return parser, opts, args
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
def main():
|
||||
parser, opts, args = parseOpts()
|
||||
|
||||
# Open appropriate CookieJar
|
||||
@ -3046,6 +3044,10 @@ if __name__ == '__main__':
|
||||
|
||||
sys.exit(retcode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except DownloadError:
|
||||
sys.exit(1)
|
||||
except SameFileError:
|
||||
|
Loading…
Reference in New Issue
Block a user