X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2FFileDownloader.py;h=1c5eeeabe6a7a0a069c864db9936c97385a60caf;hb=3cd98c7894d2523752230d9fa3307e6e39723218;hp=b234f185701e0194bca822a88747192ea56b1974;hpb=d77c3dfd027e9af4d44fc7109fac0012451268c2;p=youtube-dl diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index b234f1857..1c5eeeabe 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -14,7 +14,7 @@ import urllib2 if os.name == 'nt': import ctypes -from Utils import * +from utils import * class FileDownloader(object): @@ -341,9 +341,11 @@ class FileDownloader(object): return u'"' + title + '" title matched reject pattern "' + rejecttitle + '"' return None - def process_info(self, info_dict): + def process_info(self, info_dict, provider): """Process a single dictionary returned by an InfoExtractor.""" + info_dict['stitle'] = sanitize_filename(info_dict['title']) + reason = self._match_entry(info_dict) if reason is not None: self.to_screen(u'[download] ' + reason) @@ -470,7 +472,13 @@ class FileDownloader(object): suitable_found = True # Extract information from URL and process it - ie.extract(url) + videos = ie.extract(url) + for video in videos or []: + try: + self.increment_downloads() + self.process_info(video, ie.IE_NAME) + except UnavailableVideoError: + self.trouble(u'\nERROR: unable to download video') # Suitable InfoExtractor had been found; go to next URL break