mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-14 21:23:05 +00:00
Merge branch 'master' into c13cl
This commit is contained in:
commit
0560d30b35
@ -73,14 +73,16 @@ def _exit(status=0, *args):
|
|||||||
|
|
||||||
|
|
||||||
def get_urls(urls, batchfile, verbose):
|
def get_urls(urls, batchfile, verbose):
|
||||||
# Batch file verification
|
"""
|
||||||
|
@param verbose -1: quiet, 0: normal, 1: verbose
|
||||||
|
"""
|
||||||
batch_urls = []
|
batch_urls = []
|
||||||
if batchfile is not None:
|
if batchfile is not None:
|
||||||
try:
|
try:
|
||||||
batch_urls = read_batch_urls(
|
batch_urls = read_batch_urls(
|
||||||
read_stdin('URLs') if batchfile == '-'
|
read_stdin(None if verbose == -1 else 'URLs') if batchfile == '-'
|
||||||
else open(expand_path(batchfile), encoding='utf-8', errors='ignore'))
|
else open(expand_path(batchfile), encoding='utf-8', errors='ignore'))
|
||||||
if verbose:
|
if verbose == 1:
|
||||||
write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')
|
write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n')
|
||||||
except OSError:
|
except OSError:
|
||||||
_exit(f'ERROR: batch file {batchfile} could not be read')
|
_exit(f'ERROR: batch file {batchfile} could not be read')
|
||||||
@ -721,7 +723,7 @@ ParsedOptions = collections.namedtuple('ParsedOptions', ('parser', 'options', 'u
|
|||||||
def parse_options(argv=None):
|
def parse_options(argv=None):
|
||||||
"""@returns ParsedOptions(parser, opts, urls, ydl_opts)"""
|
"""@returns ParsedOptions(parser, opts, urls, ydl_opts)"""
|
||||||
parser, opts, urls = parseOpts(argv)
|
parser, opts, urls = parseOpts(argv)
|
||||||
urls = get_urls(urls, opts.batchfile, opts.verbose)
|
urls = get_urls(urls, opts.batchfile, -1 if opts.quiet and not opts.verbose else opts.verbose)
|
||||||
|
|
||||||
set_compat_opts(opts)
|
set_compat_opts(opts)
|
||||||
try:
|
try:
|
||||||
|
@ -428,7 +428,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|||||||
r'(?:www\.)?piped\.adminforge\.de',
|
r'(?:www\.)?piped\.adminforge\.de',
|
||||||
r'(?:www\.)?watch\.whatevertinfoil\.de',
|
r'(?:www\.)?watch\.whatevertinfoil\.de',
|
||||||
r'(?:www\.)?piped\.qdi\.fi',
|
r'(?:www\.)?piped\.qdi\.fi',
|
||||||
r'(?:www\.)?piped\.video',
|
r'(?:(?:www|cf)\.)?piped\.video',
|
||||||
r'(?:www\.)?piped\.aeong\.one',
|
r'(?:www\.)?piped\.aeong\.one',
|
||||||
r'(?:www\.)?piped\.moomoo\.me',
|
r'(?:www\.)?piped\.moomoo\.me',
|
||||||
r'(?:www\.)?piped\.chauvet\.pro',
|
r'(?:www\.)?piped\.chauvet\.pro',
|
||||||
|
@ -4789,6 +4789,7 @@ def parse_http_range(range):
|
|||||||
|
|
||||||
|
|
||||||
def read_stdin(what):
|
def read_stdin(what):
|
||||||
|
if what:
|
||||||
eof = 'Ctrl+Z' if compat_os_name == 'nt' else 'Ctrl+D'
|
eof = 'Ctrl+Z' if compat_os_name == 'nt' else 'Ctrl+D'
|
||||||
write_string(f'Reading {what} from STDIN - EOF ({eof}) to end:\n')
|
write_string(f'Reading {what} from STDIN - EOF ({eof}) to end:\n')
|
||||||
return sys.stdin
|
return sys.stdin
|
||||||
|
@ -95,6 +95,7 @@ _REGEX_TS = re.compile(r'''(?x)
|
|||||||
_REGEX_EOF = re.compile(r'\Z')
|
_REGEX_EOF = re.compile(r'\Z')
|
||||||
_REGEX_NL = re.compile(r'(?:\r\n|[\r\n]|$)')
|
_REGEX_NL = re.compile(r'(?:\r\n|[\r\n]|$)')
|
||||||
_REGEX_BLANK = re.compile(r'(?:\r\n|[\r\n])+')
|
_REGEX_BLANK = re.compile(r'(?:\r\n|[\r\n])+')
|
||||||
|
_REGEX_OPTIONAL_WHITESPACE = re.compile(r'[ \t]*')
|
||||||
|
|
||||||
|
|
||||||
def _parse_ts(ts):
|
def _parse_ts(ts):
|
||||||
@ -285,6 +286,7 @@ class CueBlock(Block):
|
|||||||
m1 = parser.consume(_REGEX_TS)
|
m1 = parser.consume(_REGEX_TS)
|
||||||
if not m1:
|
if not m1:
|
||||||
return None
|
return None
|
||||||
|
parser.consume(_REGEX_OPTIONAL_WHITESPACE)
|
||||||
m2 = parser.consume(cls._REGEX_SETTINGS)
|
m2 = parser.consume(cls._REGEX_SETTINGS)
|
||||||
if not parser.consume(_REGEX_NL):
|
if not parser.consume(_REGEX_NL):
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user