--- /dev/null
+youtube-dl (2010.10.24-1) unstable; urgency=low
+
+ * New upstream release. Highlights:
+ + Add --cookies option to allow saving cookies to disk
+ (primarily to be used with external downloaders: e.g., aria2c).
+ + Support "https" both for YouTube URLs and for login.
+ * debian/patches:
+ + refresh patch.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Mon, 25 Oct 2010 02:23:40 -0200
+
+youtube-dl (2010.10.03-1) unstable; urgency=low
+
+ * The "upload from sunny California" release
+ * New upstream release:
+ + Downloading manually the release 2010.10.03 corresponding to
+ http://bitbucket.org/rg3/youtube-dl/changeset/190d2d0fd729
+ + Abort downloads that can't be written to the disk
+ + Fix downloading some videos from metacafe.com
+ + Try to discover the video extension from metacafe.com
+ + Allow #! in youtube urls
+ + Fix extraction of uploader nickname on dailymotion
+ + Support downloads from youtube-nocookie.com urls
+ + Code improvements in general
+ + Retry that fail with codes 5xx on youtube
+ * debian/patches/*:
+ + rename 01-add-support-to-webm.patch to 01-prefer-open-formats.patch
+ + update the patch to apply to new versions of youtube-dl
+ + re-enable the patch to give preference to webm videos
+
+ -- Rogério Brito <rbrito@ime.usp.br> Wed, 13 Oct 2010 21:58:24 -0700
+
+youtube-dl (2010.08.04-1) unstable; urgency=low
+
+ * New upstream release:
+ + Fix metacafe.com code not working due to gdaKey again
+ + Add option (--playlist-start) to specify the initial video for playlists
+ + Put back -b option as a placeholder with a warning message
+ + Consider the file downloaded if the size differs in less than 100 bytes
+ + Reorganize request code to make it a bit more robust
+ + Properly detect YouTube error messages to print them on screen
+ * debian/control:
+ + Remove suggests on gst-p-b (>= 0.10.18.3-2)
+ + The package complies with Policy 3.9.1 without any other changes.
+ * debian/watch:
+ + Remove commented lines.
+ * debian/youtube-dl.pod:
+ + Update the manpage to include newer options.
+ + Don't mention removed options anymore. Closes: #590825, #592368.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Mon, 09 Aug 2010 13:27:41 -0400
+
+youtube-dl (2010.07.24-1) unstable; urgency=medium
+
+ * Urgency medium due to changes in the site that broke earlier versions.
+ * New upstream release:
+ + restore support for WebM formats.
+ * debian/changelog:
+ + fix entry that stated incorrect removed options. Closes: #590144.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Sat, 24 Jul 2010 22:29:21 -0300
+
+youtube-dl (2010.07.22-1) unstable; urgency=medium
+
+ * Urgency set to medium due to changes in the site
+ * New upstream release:
+ + make youtube-dl work again. Closes: #589974.
+ + removed command line options -b and -d.
+ * debian/NEWS:
+ + document the removal of command line options and the new behavior.
+ * debian/patches:
+ + disabled for the moment.
+ * debian/control:
+ + include the support of dailymotion in the long description.
+ + update the standards version to 3.9.0, with no other changes.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Thu, 22 Jul 2010 18:58:29 -0300
+
+youtube-dl (2010.07.14-1) unstable; urgency=low
+
+ * New upstream release:
+ + add preliminary support for Dailymotion videos
+ + improve support for WebM in YouTube
+ + add support for the "original" video format in YouTube
+ + add a --max-quality option
+ + add support for youtu.be URLs
+ + add fixes.
+ * debian/patches/01-add-support-to-webm.patch:
+ + update and refresh.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Wed, 14 Jul 2010 22:39:54 -0300
+
+youtube-dl (2010.06.06-1) unstable; urgency=low
+
+ * New upstream release:
+ + support for retrying connections after a 503 error
+ + argument '-' can be used with -a to indicate stdin
+ + support for webm formats
+ * debian/patches/01-add-support-to-webm.patch:
+ + remove parts applied upstream
+ + update to download webm videos based on their quality
+
+ -- Rogério Brito <rbrito@ime.usp.br> Mon, 07 Jun 2010 04:16:54 -0300
+
+youtube-dl (2010.04.04-3) unstable; urgency=low
+
+ * Migrate the packaging to smaller dh(7) style.
+ * Update the years of copyright.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Tue, 01 Jun 2010 11:06:06 -0300
+
+youtube-dl (2010.04.04-2) unstable; urgency=low
+
+ * Add support to webm (vp8 + vorbis) format:
+ + debian/patches/01-add-support-to-webm.patch: the code
+ + debian/NEWS: the documentation
+ + debian/control: the suggests field
+
+ -- Rogério Brito <rbrito@ime.usp.br> Sat, 29 May 2010 13:11:43 -0300
+
+youtube-dl (2010.04.04-1) unstable; urgency=low
+
+ * New upstream release:
+ + allow grabbing videos from vevo.
+ + allow download whole playlists and keep the videos numbered.
+ + add support for new playlist style.
+ + fix detection of multipage playlists.
+ + insist a little bit more to grab videos from youtube.
+ + add information extractor for video.yahoo.com.
+ + fix cosmetic issues with rtmpdump.
+ + add option --all-formats to grab all available formats for a given video.
+ + add "-" (without quotes) as an alias to output videos to stdout.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Sun, 04 Apr 2010 17:55:00 -0300
+
+youtube-dl (2010.03.13-1) unstable; urgency=low
+
+ * New upstream release
+ + added option to disable the status/progress updates.
+ + fine tuned the sequence of formats searched to discover the best quality.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Sun, 14 Mar 2010 23:33:48 -0300
+
+youtube-dl (2010.02.13-1) unstable; urgency=low
+
+ * New upstream release
+ + stronger parsing of URLs.
+ + better generation of filenames.
+ * debian/control:
+ + include misc-depends due to debhelper.
+ + the package is compliant with policy 3.8.4.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Wed, 17 Feb 2010 00:19:23 -0200
+
+youtube-dl (2010.01.19-1) unstable; urgency=low
+
+ * New upstream release. As upstream does not provide a changelog, here
+ are the highlights:
+ + patched to add Google Video and Photobucket support
+ + add support for using rtmpdump
+ + added support to download all of a user's videos!
+ + fix detection of uploader nickname in metacafe
+ + take format 37 into account
+ + add self-updating code
+ + allow empty titles because they do appear in some videos
+ + use default values for "continuedl" and "nooverwrites" parameters
+ + avoid using Unicode strings when forming URL requests
+ + improve preferred encoding detection method
+ * Remove all patches (applied upstream).
+ * Add suggests on rtmpdump.
+ * Shorten the short description.
+ * Include list of sites supported in the long description.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Tue, 26 Jan 2010 11:28:40 -0200
+
+youtube-dl (2009.09.13-2) unstable; urgency=low
+
+ * change to "3.0 (quilt)" format.
+ * add support for 1080p videos. Thanks Josh Triplett. Closes: #557042.
+ * include a better manpage. Closes: #553919.
+ * include the DMUA: yes field.
+ * kindly reviewed by Li Daobing.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Thu, 19 Nov 2009 11:21:36 -0200
+
+youtube-dl (2009.09.13-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/watch:
+ + adjust for the new upstream layout.
+ * debian/control:
+ + Standards-Version updated to 3.8.3. No changes needed.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Sat, 10 Oct 2009 12:17:53 -0300
+
+youtube-dl (2009.08.08-1~try01) unstable; urgency=low
+
+ * The current maintainer seems busy (Closes: #491616):
+ + ability to recognize more qualities of a video.
+ + ability to automatically find the best quality video.
+ + ability to download entire playlists.
+ + ability to specify various urls. (Closes: #452071)
+ + ability to resume interrupted downloads.
+ + many other things.
+ * debian/copyright:
+ + rework the file.
+ + mention that the package is in the public domain.
+ + include my information.
+ + update the URL of the package.
+ * debian/control:
+ + add a Homepage: field.
+ + keeping the current manpage for now.
+ + give more details in the long description.
+ + list me as the maintainer.
+ + Standards-Version updated to 3.8.2.
+ * debian/watch:
+ + let's help with automatic updates.
+
+ -- Rogério Brito <rbrito@ime.usp.br> Mon, 10 Aug 2009 08:14:08 -0300
+
+youtube-dl (2008.03.22-1) unstable; urgency=low
+
+ * New upstream release:
+ - adds -f / --format command line option.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Wed, 26 Mar 2008 13:19:23 -0400
+
+youtube-dl (2008.03.08-1) unstable; urgency=low
+
+ * New upstream release:
+ - adds -b / --best-quality command line option.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Wed, 12 Mar 2008 14:26:04 -0400
+
+youtube-dl (2008.01.24-1) unstable; urgency=low
+
+ * New upstream release; closes: #462427, #462428.
+ - fixes youtube download issues.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Thu, 24 Jan 2008 22:15:05 -0500
+
+youtube-dl (2007.10.09-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Mon, 08 Oct 2007 19:22:33 -0400
+
+youtube-dl (2007.08.24-1) unstable; urgency=low
+
+ * New upstream release; closes: #439363.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Fri, 24 Aug 2007 13:54:40 -0400
+
+youtube-dl (2007.06.22-1) unstable; urgency=low
+
+ * New upstream release:
+ - regex update.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Thu, 21 Jun 2007 20:42:57 -0400
+
+youtube-dl (2007.06.06-1) unstable; urgency=low
+
+ * New upstream release:
+ - "--title-too" command line option to print the video's title.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Thu, 07 Jun 2007 01:04:01 -0400
+
+youtube-dl (2007.03.27-1) unstable; urgency=low
+
+ * New upstream release:
+ - Progress meter.
+ - "--literal" command line option to use the video title in the filename.
+ - "--get-url" command line option to print the real video URL.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Mon, 2 Apr 2007 21:46:56 -0400
+
+youtube-dl (2007.02.18-1) unstable; urgency=low
+
+ * New upstream release:
+ - Diction.
+ - Catches socket errors.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Tue, 20 Feb 2007 13:57:32 -0500
+
+youtube-dl (2007.01.19-1) unstable; urgency=low
+
+ * New upstream release, closes: #406146.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Sun, 28 Jan 2007 17:41:44 -0500
+
+youtube-dl (2006.12.07-1) unstable; urgency=low
+
+ * New upstream release:
+ - Use -t to name the downloaded file after the title, closes: #395184.
+ - Parses URLs without a leading "http://", closes: #400321.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Sun, 10 Dec 2006 13:52:36 -0500
+
+youtube-dl (2006.11.12-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Sat, 25 Nov 2006 16:12:03 -0500
+
+youtube-dl (2006.09.25-1) unstable; urgency=low
+
+ * New upstream release.
+ * python >= 2.4 is now required.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Wed, 27 Sep 2006 17:43:07 -0400
+
+youtube-dl (2006.08.28-1) unstable; urgency=low
+
+ * Initial release, closes: #385748.
+
+ -- Robert S. Edmonds <edmonds@debian.org> Sun, 3 Sep 2006 19:43:27 -0400
+
# Author: Danny Colligan
# Author: Benjamin Johnson
# License: Public domain code
+import cookielib
import htmlentitydefs
import httplib
import locale
from cgi import parse_qs
std_headers = {
- 'User-Agent': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 Firefox/3.6.8',
+ 'User-Agent': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.11) Gecko/20101019 Firefox/3.6.11',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'en-us,en;q=0.5',
"""
try:
if filename == u'-':
+ if sys.platform == 'win32':
+ import msvcrt
+ msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
return (sys.stdout, filename)
stream = open(filename, open_mode)
return (stream, filename)
Available options:
- username: Username for authentication purposes.
- password: Password for authentication purposes.
- usenetrc: Use netrc for authentication instead.
- quiet: Do not print messages to stdout.
- forceurl: Force printing final URL.
- forcetitle: Force printing title.
- simulate: Do not download the video files.
- format: Video format code.
- format_limit: Highest quality format to try.
- outtmpl: Template for output names.
- ignoreerrors: Do not stop on download errors.
- ratelimit: Download speed limit, in bytes/sec.
- nooverwrites: Prevent overwriting files.
- retries: Number of times to retry for HTTP error 5xx
- continuedl: Try to continue downloads if possible.
- noprogress: Do not print the progress bar.
+ username: Username for authentication purposes.
+ password: Password for authentication purposes.
+ usenetrc: Use netrc for authentication instead.
+ quiet: Do not print messages to stdout.
+ forceurl: Force printing final URL.
+ forcetitle: Force printing title.
+ forcethumbnail: Force printing thumbnail URL.
+ forcedescription: Force printing description.
+ simulate: Do not download the video files.
+ format: Video format code.
+ format_limit: Highest quality format to try.
+ outtmpl: Template for output names.
+ ignoreerrors: Do not stop on download errors.
+ ratelimit: Download speed limit, in bytes/sec.
+ nooverwrites: Prevent overwriting files.
+ retries: Number of times to retry for HTTP error 5xx
+ continuedl: Try to continue downloads if possible.
+ noprogress: Do not print the progress bar.
+ playliststart: Playlist item to start at.
+ logtostderr: Log messages to stderr instead of stdout.
"""
params = None
_pps = []
_download_retcode = None
_num_downloads = None
+ _screen_file = None
def __init__(self, params):
"""Create a FileDownloader object with the given options."""
self._pps = []
self._download_retcode = 0
self._num_downloads = 0
+ self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]
self.params = params
@staticmethod
self._pps.append(pp)
pp.set_downloader(self)
- def to_stdout(self, message, skip_eol=False, ignore_encoding_errors=False):
+ def to_screen(self, message, skip_eol=False, ignore_encoding_errors=False):
"""Print message to stdout if not in quiet mode."""
try:
if not self.params.get('quiet', False):
- print (u'%s%s' % (message, [u'\n', u''][skip_eol])).encode(preferredencoding()),
- sys.stdout.flush()
+ terminator = [u'\n', u''][skip_eol]
+ print >>self._screen_file, (u'%s%s' % (message, terminator)).encode(preferredencoding()),
+ self._screen_file.flush()
except (UnicodeEncodeError), err:
if not ignore_encoding_errors:
raise
def report_destination(self, filename):
"""Report destination filename."""
- self.to_stdout(u'[download] Destination: %s' % filename, ignore_encoding_errors=True)
+ self.to_screen(u'[download] Destination: %s' % filename, ignore_encoding_errors=True)
def report_progress(self, percent_str, data_len_str, speed_str, eta_str):
"""Report download progress."""
if self.params.get('noprogress', False):
return
- self.to_stdout(u'\r[download] %s of %s at %s ETA %s' %
+ self.to_screen(u'\r[download] %s of %s at %s ETA %s' %
(percent_str, data_len_str, speed_str, eta_str), skip_eol=True)
def report_resuming_byte(self, resume_len):
"""Report attempt to resume at given byte."""
- self.to_stdout(u'[download] Resuming download at byte %s' % resume_len)
+ self.to_screen(u'[download] Resuming download at byte %s' % resume_len)
def report_retry(self, count, retries):
"""Report retry in case of HTTP error 5xx"""
- self.to_stdout(u'[download] Got server HTTP error. Retrying (attempt %d of %d)...' % (count, retries))
+ self.to_screen(u'[download] Got server HTTP error. Retrying (attempt %d of %d)...' % (count, retries))
def report_file_already_downloaded(self, file_name):
"""Report file has already been fully downloaded."""
try:
- self.to_stdout(u'[download] %s has already been downloaded' % file_name)
+ self.to_screen(u'[download] %s has already been downloaded' % file_name)
except (UnicodeEncodeError), err:
- self.to_stdout(u'[download] The file has already been downloaded')
+ self.to_screen(u'[download] The file has already been downloaded')
def report_unable_to_resume(self):
"""Report it was impossible to resume download."""
- self.to_stdout(u'[download] Unable to resume')
+ self.to_screen(u'[download] Unable to resume')
def report_finish(self):
"""Report download finished."""
if self.params.get('noprogress', False):
- self.to_stdout(u'[download] Download completed')
+ self.to_screen(u'[download] Download completed')
else:
- self.to_stdout(u'')
+ self.to_screen(u'')
def increment_downloads(self):
"""Increment the ordinal that assigns a number to each file."""
retval = subprocess.call(basic_args + [[], ['-e', '-k', '1']][self.params.get('continuedl', False)])
while retval == 2 or retval == 1:
prevsize = os.path.getsize(filename)
- self.to_stdout(u'\r[rtmpdump] %s bytes' % prevsize, skip_eol=True)
+ self.to_screen(u'\r[rtmpdump] %s bytes' % prevsize, skip_eol=True)
time.sleep(5.0) # This seems to be needed
retval = subprocess.call(basic_args + ['-e'] + [[], ['-k', '1']][retval == 1])
cursize = os.path.getsize(filename)
if prevsize == cursize and retval == 1:
break
if retval == 0:
- self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
+ self.to_screen(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
return True
else:
self.trouble(u'\nERROR: rtmpdump exited with code %d' % retval)
class YoutubeIE(InfoExtractor):
"""Information extractor for youtube.com."""
- _VALID_URL = r'^((?:http://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/(?:(?:v/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=))))?([0-9A-Za-z_-]+)(?(1).+)?$'
+ _VALID_URL = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/(?:(?:v/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=))))?([0-9A-Za-z_-]+)(?(1).+)?$'
_LANG_URL = r'http://www.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1'
- _LOGIN_URL = 'http://www.youtube.com/signup?next=/&gl=US&hl=en'
+ _LOGIN_URL = 'https://www.youtube.com/signup?next=/&gl=US&hl=en'
_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'
_NETRC_MACHINE = 'youtube'
# Listed in order of quality
def report_lang(self):
"""Report attempt to set language."""
- self._downloader.to_stdout(u'[youtube] Setting language')
+ self._downloader.to_screen(u'[youtube] Setting language')
def report_login(self):
"""Report attempt to log in."""
- self._downloader.to_stdout(u'[youtube] Logging in')
+ self._downloader.to_screen(u'[youtube] Logging in')
def report_age_confirmation(self):
"""Report attempt to confirm age."""
- self._downloader.to_stdout(u'[youtube] Confirming age')
+ self._downloader.to_screen(u'[youtube] Confirming age')
def report_video_webpage_download(self, video_id):
"""Report attempt to download video webpage."""
- self._downloader.to_stdout(u'[youtube] %s: Downloading video webpage' % video_id)
+ self._downloader.to_screen(u'[youtube] %s: Downloading video webpage' % video_id)
def report_video_info_webpage_download(self, video_id):
"""Report attempt to download video info webpage."""
- self._downloader.to_stdout(u'[youtube] %s: Downloading video info webpage' % video_id)
+ self._downloader.to_screen(u'[youtube] %s: Downloading video info webpage' % video_id)
def report_information_extraction(self, video_id):
"""Report attempt to extract video information."""
- self._downloader.to_stdout(u'[youtube] %s: Extracting video information' % video_id)
+ self._downloader.to_screen(u'[youtube] %s: Extracting video information' % video_id)
def report_unavailable_format(self, video_id, format):
"""Report extracted video URL."""
- self._downloader.to_stdout(u'[youtube] %s: Format %s not available' % (video_id, format))
+ self._downloader.to_screen(u'[youtube] %s: Format %s not available' % (video_id, format))
def report_rtmp_download(self):
"""Indicate the download will use the RTMP protocol."""
- self._downloader.to_stdout(u'[youtube] RTMP download detected')
+ self._downloader.to_screen(u'[youtube] RTMP download detected')
def _real_initialize(self):
if self._downloader is None:
def report_disclaimer(self):
"""Report disclaimer retrieval."""
- self._downloader.to_stdout(u'[metacafe] Retrieving disclaimer')
+ self._downloader.to_screen(u'[metacafe] Retrieving disclaimer')
def report_age_confirmation(self):
"""Report attempt to confirm age."""
- self._downloader.to_stdout(u'[metacafe] Confirming age')
+ self._downloader.to_screen(u'[metacafe] Confirming age')
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'[metacafe] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'[metacafe] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[metacafe] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[metacafe] %s: Extracting information' % video_id)
def _real_initialize(self):
# Retrieve disclaimer
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'[dailymotion] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'[dailymotion] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[dailymotion] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[dailymotion] %s: Extracting information' % video_id)
def _real_initialize(self):
return
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'[video.google] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'[video.google] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[video.google] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[video.google] %s: Extracting information' % video_id)
def _real_initialize(self):
return
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'[photobucket] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'[photobucket] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[photobucket] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[photobucket] %s: Extracting information' % video_id)
def _real_initialize(self):
return
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'[video.yahoo] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'[video.yahoo] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[video.yahoo] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[video.yahoo] %s: Extracting information' % video_id)
def _real_initialize(self):
return
def report_download_webpage(self, video_id):
"""Report webpage download."""
- self._downloader.to_stdout(u'WARNING: Falling back on generic information extractor.')
- self._downloader.to_stdout(u'[generic] %s: Downloading webpage' % video_id)
+ self._downloader.to_screen(u'WARNING: Falling back on generic information extractor.')
+ self._downloader.to_screen(u'[generic] %s: Downloading webpage' % video_id)
def report_extraction(self, video_id):
"""Report information extraction."""
- self._downloader.to_stdout(u'[generic] %s: Extracting information' % video_id)
+ self._downloader.to_screen(u'[generic] %s: Extracting information' % video_id)
def _real_initialize(self):
return
def report_download_page(self, query, pagenum):
"""Report attempt to download playlist page with given number."""
query = query.decode(preferredencoding())
- self._downloader.to_stdout(u'[youtube] query "%s": Downloading page %s' % (query, pagenum))
+ self._downloader.to_screen(u'[youtube] query "%s": Downloading page %s' % (query, pagenum))
def _real_initialize(self):
self._youtube_ie.initialize()
def report_download_page(self, query, pagenum):
"""Report attempt to download playlist page with given number."""
query = query.decode(preferredencoding())
- self._downloader.to_stdout(u'[video.google] query "%s": Downloading page %s' % (query, pagenum))
+ self._downloader.to_screen(u'[video.google] query "%s": Downloading page %s' % (query, pagenum))
def _real_initialize(self):
self._google_ie.initialize()
def report_download_page(self, query, pagenum):
"""Report attempt to download playlist page with given number."""
query = query.decode(preferredencoding())
- self._downloader.to_stdout(u'[video.yahoo] query "%s": Downloading page %s' % (query, pagenum))
+ self._downloader.to_screen(u'[video.yahoo] query "%s": Downloading page %s' % (query, pagenum))
def _real_initialize(self):
self._yahoo_ie.initialize()
def report_download_page(self, playlist_id, pagenum):
"""Report attempt to download playlist page with given number."""
- self._downloader.to_stdout(u'[youtube] PL %s: Downloading page #%s' % (playlist_id, pagenum))
+ self._downloader.to_screen(u'[youtube] PL %s: Downloading page #%s' % (playlist_id, pagenum))
def _real_initialize(self):
self._youtube_ie.initialize()
def report_download_page(self, username):
"""Report attempt to download user page."""
- self._downloader.to_stdout(u'[youtube] user %s: Downloading page ' % (username))
+ self._downloader.to_screen(u'[youtube] user %s: Downloading page ' % (username))
def _real_initialize(self):
self._youtube_ie.initialize()
if not os.access (filename, os.W_OK):
sys.exit('ERROR: no write permissions on %s' % filename)
- downloader.to_stdout('Updating to latest stable version...')
+ downloader.to_screen('Updating to latest stable version...')
latest_url = 'http://bitbucket.org/rg3/youtube-dl/raw/tip/LATEST_VERSION'
latest_version = urllib.urlopen(latest_url).read().strip()
prog_url = 'http://bitbucket.org/rg3/youtube-dl/raw/%s/youtube-dl' % latest_version
stream = open(filename, 'w')
stream.write(newcontent)
stream.close()
- downloader.to_stdout('Updated to version %s' % latest_version)
-
- # General configuration
- urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()))
- urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor()))
- socket.setdefaulttimeout(300) # 5 minutes should be enough (famous last words)
+ downloader.to_screen('Updated to version %s' % latest_version)
# Parse command line
parser = optparse.OptionParser(
usage='Usage: %prog [options] url...',
- version='2010.10.03',
+ version='2010.10.24',
conflict_handler='resolve',
)
action='store_true', dest='nooverwrites', help='do not overwrite files', default=False)
filesystem.add_option('-c', '--continue',
action='store_true', dest='continue_dl', help='resume partially downloaded files', default=False)
+ filesystem.add_option('--cookies',
+ dest='cookiefile', metavar='FILE', help='file to dump cookie jar to')
parser.add_option_group(filesystem)
(opts, args) = parser.parse_args()
+ # Open appropriate CookieJar
+ if opts.cookiefile is None:
+ jar = cookielib.CookieJar()
+ else:
+ try:
+ jar = cookielib.MozillaCookieJar(opts.cookiefile)
+ if os.path.isfile(opts.cookiefile) and os.access(opts.cookiefile, os.R_OK):
+ jar.load()
+ except (IOError, OSError), err:
+ sys.exit(u'ERROR: unable to open cookie file')
+
+ # General configuration
+ cookie_processor = urllib2.HTTPCookieProcessor(jar)
+ urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler()))
+ urllib2.install_opener(urllib2.build_opener(cookie_processor))
+ socket.setdefaulttimeout(300) # 5 minutes should be enough (famous last words)
+
# Batch file verification
batchurls = []
if opts.batchfile is not None:
'continuedl': opts.continue_dl,
'noprogress': opts.noprogress,
'playliststart': opts.playliststart,
+ 'logtostderr': opts.outtmpl == '-',
})
fd.add_info_extractor(youtube_search_ie)
fd.add_info_extractor(youtube_pl_ie)
else:
sys.exit()
retcode = fd.download(all_urls)
+
+ # Dump cookie jar if requested
+ if opts.cookiefile is not None:
+ try:
+ jar.save()
+ except (IOError, OSError), err:
+ sys.exit(u'ERROR: unable to save cookie jar')
+
sys.exit(retcode)
except DownloadError: