Conversation
|
@mf2199 @sangramql Please review. |
|
|
||
| def __init__(self, media_url, stream=None, | ||
| start=None, end=None, headers=None): | ||
| start=None, end=None, user_agent=None, headers=None): |
There was a problem hiding this comment.
Is there any particular reason to put user_agent before headers?
There was a problem hiding this comment.
Nothing as such, i thought of having str argument(user_agent) before a dict(headers) looks good.
| """ | ||
| method, url, payload, headers = self._prepare_request() | ||
| if self.user_agent is not None: | ||
| headers[u'User-Agent'] = self.user_agent |
There was a problem hiding this comment.
Not sure which way is better, to have the if check here or simply allow headers[u'User-Agent'] have a None value.
There was a problem hiding this comment.
We should not set user_agent as None if api caller doesnt provide user-agent. In that case, user_agent would be 'python-requests/2.18.' which is set by the underlying requests lib.
| self, stream=None, end=65536, headers=None, chunks=(), | ||
| response_headers=None): | ||
| self, stream=None, end=65536, user_agent=None, headers=None, | ||
| chunks=(), response_headers=None): |
There was a problem hiding this comment.
Same as comment in first.
| download = download_mod.Download( | ||
| EXAMPLE_URL, stream=stream, end=end, headers=headers) | ||
| EXAMPLE_URL, stream=stream, end=end, user_agent=user_agent, | ||
| headers=headers) |
|
@mf2199 @sangramql Can i go for a public PR? |
5b9132e to
1e6c468
Compare
Feature request [17]