projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03879ff
)
[extractor/common] add update_url_params helper method to add or update query string...
author
remitamine
<remitamine@gmail.com>
Thu, 3 Mar 2016 09:27:22 +0000
(10:27 +0100)
committer
remitamine
<remitamine@gmail.com>
Thu, 3 Mar 2016 09:27:22 +0000
(10:27 +0100)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 402f2f436dcd59bf00821166625eb72144b16a07..282559597292baca897b8629f45d34da49b21ac0 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-517,6
+517,13
@@
class InfoExtractor(object):
else:
self.report_warning(errmsg + str(ve))
+ def update_url_params(self, url, params):
+ parsed_url = compat_urlparse.urlparse(url)
+ qs = compat_urlparse.parse_qs(parsed_url.query)
+ qs.update(params)
+ return compat_urlparse.urlunparse(
+ parsed_url._replace(query=compat_urllib_parse.urlencode(qs, True)))
+
def report_warning(self, msg, video_id=None):
idstr = '' if video_id is None else '%s: ' % video_id
self._downloader.report_warning(