mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
youtube-dl: adjust coverage as using mock youtube-dl wrapper #118
This commit is contained in:
parent
080587516b
commit
4d7d40454d
@ -255,13 +255,13 @@ class RewriteHandler(SearchPageWbUrlHandler):
|
|||||||
|
|
||||||
|
|
||||||
#=================================================================
|
#=================================================================
|
||||||
class YoutubeDLWrapper(object):
|
class YoutubeDLWrapper(object): #pragma: no cover
|
||||||
""" YoutubeDL wrapper, inits youtubee-dl if it is available
|
""" YoutubeDL wrapper, inits youtubee-dl if it is available
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
from youtube_dl import YoutubeDL as YoutubeDL
|
from youtube_dl import YoutubeDL as YoutubeDL
|
||||||
except ImportError: #pragma: no cover
|
except ImportError:
|
||||||
self.ydl = None
|
self.ydl = None
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ class YoutubeDLWrapper(object):
|
|||||||
self.ydl.add_default_info_extractors()
|
self.ydl.add_default_info_extractors()
|
||||||
|
|
||||||
def extract_info(self, url):
|
def extract_info(self, url):
|
||||||
if not self.ydl: #pragma: no cover
|
if not self.ydl:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
info = self.ydl.extract_info(url)
|
info = self.ydl.extract_info(url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user