projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[gamekings] Do not test md5 sum, precise file changes regularly
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 833f981f24ca7b9dc2b2fd6cd79a40fe83afd019..1d9785341ec685071ea8fcc4846029a3e889bc72 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-572,6
+572,11
@@
class ExtractorError(Exception):
return u''.join(traceback.format_tb(self.traceback))
return u''.join(traceback.format_tb(self.traceback))
+class RegexNotFoundError(ExtractorError):
+ """Error when a regex didn't match"""
+ pass
+
+
class DownloadError(Exception):
"""Download Error exception.
class DownloadError(Exception):
"""Download Error exception.
@@
-947,6
+952,15
@@
def shell_quote(args):
return ' '.join(map(pipes.quote, args))
return ' '.join(map(pipes.quote, args))
+def takewhile_inclusive(pred, seq):
+ """ Like itertools.takewhile, but include the latest evaluated element
+ (the first element so that Not pred(e)) """
+ for e in seq:
+ yield e
+ if not pred(e):
+ return
+
+
def smuggle_url(url, data):
""" Pass additional data in a URL for internal use. """
def smuggle_url(url, data):
""" Pass additional data in a URL for internal use. """