projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
944d65c
)
Some pep8 style fixes
author
Jaime Marquínez Ferrándiz
<jaime.marquinez.ferrandiz@gmail.com>
Sat, 25 Jan 2014 11:02:43 +0000
(12:02 +0100)
committer
Jaime Marquínez Ferrándiz
<jaime.marquinez.ferrandiz@gmail.com>
Sat, 25 Jan 2014 14:33:23 +0000
(15:33 +0100)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
youtube_dl/downloader/__init__.py
patch
|
blob
|
history
youtube_dl/downloader/common.py
patch
|
blob
|
history
youtube_dl/downloader/http.py
patch
|
blob
|
history
youtube_dl/downloader/mplayer.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 1e94d8ac66f82e96cbbfecd6b2e6bba55c8ec1f8..42cbcf6994567e09b3f35eec3f3f0a71494eb4f5 100644
(file)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-331,7
+331,7
@@
class YoutubeDL(object):
def __exit__(self, *args):
self.restore_console_title()
def __exit__(self, *args):
self.restore_console_title()
-
+
if self.params.get('cookiefile') is not None:
self.cookiejar.save()
if self.params.get('cookiefile') is not None:
self.cookiejar.save()
@@
-710,10
+710,10
@@
class YoutubeDL(object):
# TODO Central sorting goes here
# TODO Central sorting goes here
- if formats[0] is not info_dict:
+ if formats[0] is not info_dict:
# only set the 'formats' fields if the original info_dict list them
# otherwise we end up with a circular reference, the first (and unique)
# only set the 'formats' fields if the original info_dict list them
# otherwise we end up with a circular reference, the first (and unique)
- # element in the 'formats' field in info_dict is info_dict itself,
+ # element in the 'formats' field in info_dict is info_dict itself,
# wich can't be exported to json
info_dict['formats'] = formats
if self.params.get('listformats', None):
# wich can't be exported to json
info_dict['formats'] = formats
if self.params.get('listformats', None):
diff --git
a/youtube_dl/downloader/__init__.py
b/youtube_dl/downloader/__init__.py
index f19b490f186a73f50bdc385661ebecd9b72aec4e..0d9eb0001e774bdf75ccdf31c636947dfeecd330 100644
(file)
--- a/
youtube_dl/downloader/__init__.py
+++ b/
youtube_dl/downloader/__init__.py
@@
-8,6
+8,7
@@
from ..utils import (
determine_ext,
)
determine_ext,
)
+
def get_suitable_downloader(info_dict):
"""Get the downloader class that can handle the info dict."""
url = info_dict['url']
def get_suitable_downloader(info_dict):
"""Get the downloader class that can handle the info dict."""
url = info_dict['url']
@@
-20,4
+21,3
@@
def get_suitable_downloader(info_dict):
return MplayerFD
else:
return HttpFD
return MplayerFD
else:
return HttpFD
-
diff --git
a/youtube_dl/downloader/common.py
b/youtube_dl/downloader/common.py
index 10143d56a201ca9d7b9b919ab38880adea0c1cf6..5a068aa8b8063c8503eb4dc8170fd19303779a02 100644
(file)
--- a/
youtube_dl/downloader/common.py
+++ b/
youtube_dl/downloader/common.py
@@
-314,4
+314,3
@@
class FileDownloader(object):
if the download is successful.
"""
self._progress_hooks.append(ph)
if the download is successful.
"""
self._progress_hooks.append(ph)
-
diff --git
a/youtube_dl/downloader/http.py
b/youtube_dl/downloader/http.py
index 8407727ba43df75a31a53d073cbd430877157b29..748f9f3adfe0555024cce272b8eb872c55558d6c 100644
(file)
--- a/
youtube_dl/downloader/http.py
+++ b/
youtube_dl/downloader/http.py
@@
-27,7
+27,7
@@
class HttpFD(FileDownloader):
request = compat_urllib_request.Request(url, None, headers)
if self.params.get('test', False):
request = compat_urllib_request.Request(url, None, headers)
if self.params.get('test', False):
- request.add_header('Range','bytes=0-10240')
+ request.add_header('Range',
'bytes=0-10240')
# Establish possible resume length
if os.path.isfile(encodeFilename(tmpfilename)):
# Establish possible resume length
if os.path.isfile(encodeFilename(tmpfilename)):
@@
-39,7
+39,7
@@
class HttpFD(FileDownloader):
if resume_len != 0:
if self.params.get('continuedl', False):
self.report_resuming_byte(resume_len)
if resume_len != 0:
if self.params.get('continuedl', False):
self.report_resuming_byte(resume_len)
- request.add_header('Range','bytes=%d-' % resume_len)
+ request.add_header('Range',
'bytes=%d-' % resume_len)
open_mode = 'ab'
else:
resume_len = 0
open_mode = 'ab'
else:
resume_len = 0
@@
-100,7
+100,7
@@
class HttpFD(FileDownloader):
if data_len is not None:
data_len = int(data_len) + resume_len
min_data_len = self.params.get("min_filesize", None)
if data_len is not None:
data_len = int(data_len) + resume_len
min_data_len = self.params.get("min_filesize", None)
- max_data_len =
self.params.get("max_filesize", None)
+ max_data_len = self.params.get("max_filesize", None)
if min_data_len is not None and data_len < min_data_len:
self.to_screen(u'\r[download] File is smaller than min-filesize (%s bytes < %s bytes). Aborting.' % (data_len, min_data_len))
return False
if min_data_len is not None and data_len < min_data_len:
self.to_screen(u'\r[download] File is smaller than min-filesize (%s bytes < %s bytes). Aborting.' % (data_len, min_data_len))
return False
diff --git
a/youtube_dl/downloader/mplayer.py
b/youtube_dl/downloader/mplayer.py
index 67e0e418991af1b6a7960a54052319385aa6a6c7..4de7f15f4ee3dd11b51afbb9c0e1e221b12d0784 100644
(file)
--- a/
youtube_dl/downloader/mplayer.py
+++ b/
youtube_dl/downloader/mplayer.py
@@
-18,10
+18,10
@@
class MplayerFD(FileDownloader):
try:
subprocess.call(['mplayer', '-h'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
except (OSError, IOError):
try:
subprocess.call(['mplayer', '-h'], stdout=(open(os.path.devnull, 'w')), stderr=subprocess.STDOUT)
except (OSError, IOError):
- self.report_error(u'MMS or RTSP download detected but "%s" could not be run' % args[0]
)
+ self.report_error(u'MMS or RTSP download detected but "%s" could not be run' % args[0])
return False
return False
- # Download using mplayer.
+ # Download using mplayer.
retval = subprocess.call(args)
if retval == 0:
fsize = os.path.getsize(encodeFilename(tmpfilename))
retval = subprocess.call(args)
if retval == 0:
fsize = os.path.getsize(encodeFilename(tmpfilename))