mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 04:30:10 +09:00
Move code into a separate Python module
This commit is contained in:
parent
5b3330e0cf
commit
235b3ba479
7
Makefile
7
Makefile
@ -1,6 +1,6 @@
|
|||||||
default: update
|
default: update
|
||||||
|
|
||||||
update: update-readme update-latest
|
update: compile update-readme update-latest
|
||||||
|
|
||||||
update-latest:
|
update-latest:
|
||||||
./youtube-dl --version > LATEST_VERSION
|
./youtube-dl --version > LATEST_VERSION
|
||||||
@ -15,6 +15,7 @@ update-readme:
|
|||||||
echo -e '\n## FAQ' >> README.md && \
|
echo -e '\n## FAQ' >> README.md && \
|
||||||
echo "$${footer}" >> README.md
|
echo "$${footer}" >> README.md
|
||||||
|
|
||||||
|
compile:
|
||||||
|
cp youtube_dl/__init__.py youtube-dl
|
||||||
|
|
||||||
|
.PHONY: default compile update update-latest update-readme
|
||||||
.PHONY: default update update-latest update-readme
|
|
||||||
|
10
youtube-dl
10
youtube-dl
@ -4045,7 +4045,7 @@ def gen_extractors():
|
|||||||
GenericIE()
|
GenericIE()
|
||||||
]
|
]
|
||||||
|
|
||||||
def main():
|
def _real_main():
|
||||||
parser, opts, args = parseOpts()
|
parser, opts, args = parseOpts()
|
||||||
|
|
||||||
# Open appropriate CookieJar
|
# Open appropriate CookieJar
|
||||||
@ -4205,10 +4205,9 @@ def main():
|
|||||||
|
|
||||||
sys.exit(retcode)
|
sys.exit(retcode)
|
||||||
|
|
||||||
|
def main():
|
||||||
if __name__ == '__main__':
|
|
||||||
try:
|
try:
|
||||||
main()
|
_real_main()
|
||||||
except DownloadError:
|
except DownloadError:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except SameFileError:
|
except SameFileError:
|
||||||
@ -4216,4 +4215,7 @@ if __name__ == '__main__':
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
sys.exit(u'\nERROR: Interrupted by user')
|
sys.exit(u'\nERROR: Interrupted by user')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
# vim: set ts=4 sw=4 sts=4 noet ai si filetype=python:
|
# vim: set ts=4 sw=4 sts=4 noet ai si filetype=python:
|
||||||
|
6
youtube-dl.dev
Executable file
6
youtube-dl.dev
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import youtube_dl
|
||||||
|
|
||||||
|
youtube_dl.main()
|
4221
youtube_dl/__init__.py
Executable file
4221
youtube_dl/__init__.py
Executable file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user