mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
add param m3u8 , allow download video via m3u8 url
This commit is contained in:
parent
1c841f7e8c
commit
663e53a95f
@ -1321,7 +1321,13 @@ def download_main(download, download_playlist, urls, playlist, **kwargs):
|
|||||||
if re.match(r'https?://', url) is None:
|
if re.match(r'https?://', url) is None:
|
||||||
url = 'http://' + url
|
url = 'http://' + url
|
||||||
|
|
||||||
if playlist:
|
if m3u8:
|
||||||
|
if output_filename:
|
||||||
|
title = output_filename
|
||||||
|
else:
|
||||||
|
title = "m3u8file"
|
||||||
|
download_url_ffmpeg(url=url, title=title,ext = 'mp4',output_dir = '.')
|
||||||
|
elif playlist:
|
||||||
download_playlist(url, **kwargs)
|
download_playlist(url, **kwargs)
|
||||||
else:
|
else:
|
||||||
download(url, **kwargs)
|
download(url, **kwargs)
|
||||||
@ -1425,7 +1431,6 @@ def set_socks_proxy(proxy):
|
|||||||
proxy_info = proxy.split("@")
|
proxy_info = proxy.split("@")
|
||||||
socks_proxy_addrs = proxy_info[1].split(':')
|
socks_proxy_addrs = proxy_info[1].split(':')
|
||||||
socks_proxy_auth = proxy_info[0].split(":")
|
socks_proxy_auth = proxy_info[0].split(":")
|
||||||
print(socks_proxy_auth[0]+" "+socks_proxy_auth[1]+" "+socks_proxy_addrs[0]+" "+socks_proxy_addrs[1])
|
|
||||||
socks.set_default_proxy(
|
socks.set_default_proxy(
|
||||||
socks.SOCKS5,
|
socks.SOCKS5,
|
||||||
socks_proxy_addrs[0],
|
socks_proxy_addrs[0],
|
||||||
@ -1436,7 +1441,6 @@ def set_socks_proxy(proxy):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
socks_proxy_addrs = proxy.split(':')
|
socks_proxy_addrs = proxy.split(':')
|
||||||
print(socks_proxy_addrs[0]+" "+socks_proxy_addrs[1])
|
|
||||||
socks.set_default_proxy(
|
socks.set_default_proxy(
|
||||||
socks.SOCKS5,
|
socks.SOCKS5,
|
||||||
socks_proxy_addrs[0],
|
socks_proxy_addrs[0],
|
||||||
@ -1601,6 +1605,10 @@ def script_main(download, download_playlist, **kwargs):
|
|||||||
download_grp.add_argument('--stream', help=argparse.SUPPRESS)
|
download_grp.add_argument('--stream', help=argparse.SUPPRESS)
|
||||||
download_grp.add_argument('--itag', help=argparse.SUPPRESS)
|
download_grp.add_argument('--itag', help=argparse.SUPPRESS)
|
||||||
|
|
||||||
|
download_grp.add_argument('-m', '--m3u8', action='store_true', default=False,
|
||||||
|
help = 'download vide using an m3u8 url')
|
||||||
|
|
||||||
|
|
||||||
parser.add_argument('URL', nargs='*', help=argparse.SUPPRESS)
|
parser.add_argument('URL', nargs='*', help=argparse.SUPPRESS)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -1626,6 +1634,7 @@ def script_main(download, download_playlist, **kwargs):
|
|||||||
global output_filename
|
global output_filename
|
||||||
global auto_rename
|
global auto_rename
|
||||||
global insecure
|
global insecure
|
||||||
|
global m3u8
|
||||||
output_filename = args.output_filename
|
output_filename = args.output_filename
|
||||||
extractor_proxy = args.extractor_proxy
|
extractor_proxy = args.extractor_proxy
|
||||||
|
|
||||||
@ -1647,6 +1656,9 @@ def script_main(download, download_playlist, **kwargs):
|
|||||||
if args.cookies:
|
if args.cookies:
|
||||||
load_cookies(args.cookies)
|
load_cookies(args.cookies)
|
||||||
|
|
||||||
|
if args.m3u8:
|
||||||
|
m3u8 = True
|
||||||
|
|
||||||
caption = True
|
caption = True
|
||||||
stream_id = args.format or args.stream or args.itag
|
stream_id = args.format or args.stream or args.itag
|
||||||
if args.no_caption:
|
if args.no_caption:
|
||||||
|
Loading…
Reference in New Issue
Block a user