mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +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
|
||||
"""
|
||||
def __init__(self):
|
||||
try:
|
||||
from youtube_dl import YoutubeDL as YoutubeDL
|
||||
except ImportError: #pragma: no cover
|
||||
except ImportError:
|
||||
self.ydl = None
|
||||
return
|
||||
|
||||
@ -270,7 +270,7 @@ class YoutubeDLWrapper(object):
|
||||
self.ydl.add_default_info_extractors()
|
||||
|
||||
def extract_info(self, url):
|
||||
if not self.ydl: #pragma: no cover
|
||||
if not self.ydl:
|
||||
return None
|
||||
|
||||
info = self.ydl.extract_info(url)
|
||||
|
Loading…
x
Reference in New Issue
Block a user