1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 14:45:14 +00:00

--config-location - to provide options interactively

This commit is contained in:
pukkandan
2022-05-24 17:30:28 +05:30
parent d2ff2c91bb
commit 6b9e832db7
4 changed files with 19 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ import os
import re
import sys
from .compat import compat_getpass, compat_os_name, compat_shlex_quote
from .compat import compat_getpass, compat_shlex_quote
from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
from .downloader import FileDownloader
from .extractor import GenericIE, list_extractor_classes
@@ -42,6 +42,7 @@ from .utils import (
parse_duration,
preferredencoding,
read_batch_urls,
read_stdin,
render_table,
setproctitle,
std_headers,
@@ -63,14 +64,9 @@ def get_urls(urls, batchfile, verbose):
batch_urls = []
if batchfile is not None:
try:
if batchfile == '-':
write_string('Reading URLs from stdin - EOF (%s) to end:\n' % (
'Ctrl+Z' if compat_os_name == 'nt' else 'Ctrl+D'))
batchfd = sys.stdin
else:
batchfd = open(
expand_path(batchfile), encoding='utf-8', errors='ignore')
batch_urls = read_batch_urls(batchfd)
batch_urls = read_batch_urls(
read_stdin('URLs') if batchfile == '-'
else open(expand_path(batchfile), encoding='utf-8', errors='ignore'))
if verbose:
write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')
except OSError: