|
|
@ -27,7 +27,7 @@ import unicodedata
|
|
|
|
from .cache import Cache
|
|
|
|
from .cache import Cache
|
|
|
|
from .compat import urllib # isort: split
|
|
|
|
from .compat import urllib # isort: split
|
|
|
|
from .compat import compat_os_name, urllib_req_to_req
|
|
|
|
from .compat import compat_os_name, urllib_req_to_req
|
|
|
|
from .cookies import LenientSimpleCookie, load_cookies
|
|
|
|
from .cookies import CookieLoadError, LenientSimpleCookie, load_cookies
|
|
|
|
from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name
|
|
|
|
from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name
|
|
|
|
from .downloader.rtmp import rtmpdump_version
|
|
|
|
from .downloader.rtmp import rtmpdump_version
|
|
|
|
from .extractor import gen_extractor_classes, get_info_extractor
|
|
|
|
from .extractor import gen_extractor_classes, get_info_extractor
|
|
|
@ -1624,7 +1624,7 @@ class YoutubeDL:
|
|
|
|
while True:
|
|
|
|
while True:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
return func(self, *args, **kwargs)
|
|
|
|
return func(self, *args, **kwargs)
|
|
|
|
except (DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
|
|
|
|
except (CookieLoadError, DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
except ReExtractInfo as e:
|
|
|
|
except ReExtractInfo as e:
|
|
|
|
if e.expected:
|
|
|
|
if e.expected:
|
|
|
@ -3580,6 +3580,8 @@ class YoutubeDL:
|
|
|
|
def wrapper(*args, **kwargs):
|
|
|
|
def wrapper(*args, **kwargs):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
res = func(*args, **kwargs)
|
|
|
|
res = func(*args, **kwargs)
|
|
|
|
|
|
|
|
except CookieLoadError:
|
|
|
|
|
|
|
|
raise
|
|
|
|
except UnavailableVideoError as e:
|
|
|
|
except UnavailableVideoError as e:
|
|
|
|
self.report_error(e)
|
|
|
|
self.report_error(e)
|
|
|
|
except DownloadCancelled as e:
|
|
|
|
except DownloadCancelled as e:
|
|
|
@ -4113,8 +4115,13 @@ class YoutubeDL:
|
|
|
|
@functools.cached_property
|
|
|
|
@functools.cached_property
|
|
|
|
def cookiejar(self):
|
|
|
|
def cookiejar(self):
|
|
|
|
"""Global cookiejar instance"""
|
|
|
|
"""Global cookiejar instance"""
|
|
|
|
return load_cookies(
|
|
|
|
try:
|
|
|
|
self.params.get('cookiefile'), self.params.get('cookiesfrombrowser'), self)
|
|
|
|
return load_cookies(
|
|
|
|
|
|
|
|
self.params.get('cookiefile'), self.params.get('cookiesfrombrowser'), self)
|
|
|
|
|
|
|
|
except CookieLoadError as error:
|
|
|
|
|
|
|
|
cause = error.__context__
|
|
|
|
|
|
|
|
self.report_error(str(cause), tb=''.join(traceback.format_exception(cause)))
|
|
|
|
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def _opener(self):
|
|
|
|
def _opener(self):
|
|
|
|