Browse Source
[utils] Rename try_multipart_encode to _multipart_encode_impl
To state that this is an internal function and people should be careful
when using it outside youtube-dl.
master
Yen Chi Hsuan
7 years ago
No known key found for this signature in database
GPG Key ID: 7F902A182457CA23
1 changed files with
2 additions and
2 deletions
-
youtube_dl/utils.py
|
@ -2098,7 +2098,7 @@ def update_Request(req, url=None, data=None, headers={}, query={}): |
|
|
return new_req |
|
|
return new_req |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def try_multipart_encode(data, boundary): |
|
|
|
|
|
|
|
|
def _multipart_encode_impl(data, boundary): |
|
|
content_type = 'multipart/form-data; boundary=%s' % boundary |
|
|
content_type = 'multipart/form-data; boundary=%s' % boundary |
|
|
|
|
|
|
|
|
out = b'' |
|
|
out = b'' |
|
@ -2140,7 +2140,7 @@ def multipart_encode(data, boundary=None): |
|
|
boundary = '---------------' + str(random.randrange(0x0fffffff, 0xffffffff)) |
|
|
boundary = '---------------' + str(random.randrange(0x0fffffff, 0xffffffff)) |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
out, content_type = try_multipart_encode(data, boundary) |
|
|
|
|
|
|
|
|
out, content_type = _multipart_encode_impl(data, boundary) |
|
|
break |
|
|
break |
|
|
except ValueError: |
|
|
except ValueError: |
|
|
if has_specified_boundary: |
|
|
if has_specified_boundary: |
|
|