_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'
_NETRC_MACHINE = 'youtube'
# Listed in order of quality
- _available_formats = ['38', '37', '22', '45', '35', '34', '43', '18', '6', '5', '17', '13']
+ _available_formats = ['38', '37', '45', '22', '43', '35', '34', '18', '6', '5', '17', '13']
_video_extensions = {
'13': '3gp',
'17': 'mp4',
@staticmethod
def get_audio_codec(path):
- handle = subprocess.Popen(['ffprobe', '-show_streams', path],
- stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
- output = handle.communicate()[0]
- if handle.wait() != 0:
+ try:
+ handle = subprocess.Popen(['ffprobe', '-show_streams', path],
+ stderr=file(os.path.devnull, 'w'), stdout=subprocess.PIPE)
+ output = handle.communicate()[0]
+ if handle.wait() != 0:
+ return None
+ except (IOError, OSError):
return None
audio_codec = None
for line in output.split('\n'):
filecodec = self.get_audio_codec(path)
if filecodec is None:
- self._downloader.to_stderr(u'WARNING: no audio codec found in file')
+ self._downloader.to_stderr(u'WARNING: unable to obtain file audio codec with ffprobe')
return None
more_opts = []
status = self.run_ffmpeg(path, new_path, acodec, more_opts)
if not status:
- self._downloader.to_stderr(u'WARNING: error running ffmpeg' % ret)
+ self._downloader.to_stderr(u'WARNING: error running ffmpeg')
return None
try:
# Parse command line
parser = optparse.OptionParser(
usage='Usage: %prog [options] url...',
- version='2011.01.30',
+ version='2011.02.25b',
conflict_handler='resolve',
)