Skip to content

Commit

Permalink
youtube-dl: adjust coverage as using mock youtube-dl wrapper #118
Browse files Browse the repository at this point in the history
  • Loading branch information
ikreymer committed Jun 28, 2015
1 parent 0805875 commit 4d7d404
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pywb/webapp/live_rewrite_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ def _get_video_info(self, wbrequest, info_url=None, video_url=None):


#=================================================================
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

Expand All @@ -270,7 +270,7 @@ def __init__(self):
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)
Expand Down

0 comments on commit 4d7d404

Please sign in to comment.