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