projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[tv5mondeplus] Add new extractor(closes #11386)
[youtube-dl]
/
youtube_dl
/
YoutubeDL.py
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index cb502c26f6bf20788279f5bbfb0ed8e7e0e909f2..54bc8b06d9827408e66232cedc1629fcd175b52a 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-29,7
+29,6
@@
import random
from .compat import (
compat_basestring,
compat_cookiejar,
from .compat import (
compat_basestring,
compat_cookiejar,
- compat_expanduser,
compat_get_terminal_size,
compat_http_client,
compat_kwargs,
compat_get_terminal_size,
compat_http_client,
compat_kwargs,
@@
-54,6
+53,7
@@
from .utils import (
encode_compat_str,
encodeFilename,
error_to_compat_str,
encode_compat_str,
encodeFilename,
error_to_compat_str,
+ expand_path,
ExtractorError,
format_bytes,
formatSeconds,
ExtractorError,
format_bytes,
formatSeconds,
@@
-672,7
+672,7
@@
class YoutubeDL(object):
FORMAT_RE.format(numeric_field),
r'%({0})s'.format(numeric_field), outtmpl)
FORMAT_RE.format(numeric_field),
r'%({0})s'.format(numeric_field), outtmpl)
- tmpl =
compat_expanduser
(outtmpl)
+ tmpl =
expand_path
(outtmpl)
filename = tmpl % template_dict
# Temporary fix for #4787
# 'Treat' all problem characters by passing filename through preferredencoding
filename = tmpl % template_dict
# Temporary fix for #4787
# 'Treat' all problem characters by passing filename through preferredencoding
@@
-837,6
+837,12
@@
class YoutubeDL(object):
ie_result['url'], ie_key=ie_result.get('ie_key'),
extra_info=extra_info, download=False, process=False)
ie_result['url'], ie_key=ie_result.get('ie_key'),
extra_info=extra_info, download=False, process=False)
+ # extract_info may return None when ignoreerrors is enabled and
+ # extraction failed with an error, don't crash and return early
+ # in this case
+ if not info:
+ return info
+
force_properties = dict(
(k, v) for k, v in ie_result.items() if v is not None)
for f in ('_type', 'url', 'ie_key'):
force_properties = dict(
(k, v) for k, v in ie_result.items() if v is not None)
for f in ('_type', 'url', 'ie_key'):
@@
-2170,7
+2176,7
@@
class YoutubeDL(object):
if opts_cookiefile is None:
self.cookiejar = compat_cookiejar.CookieJar()
else:
if opts_cookiefile is None:
self.cookiejar = compat_cookiejar.CookieJar()
else:
- opts_cookiefile =
compat_expanduser
(opts_cookiefile)
+ opts_cookiefile =
expand_path
(opts_cookiefile)
self.cookiejar = compat_cookiejar.MozillaCookieJar(
opts_cookiefile)
if os.access(opts_cookiefile, os.R_OK):
self.cookiejar = compat_cookiejar.MozillaCookieJar(
opts_cookiefile)
if os.access(opts_cookiefile, os.R_OK):