Merge remote-tracking branch 'rzhxeo/youporn-hd'

Conflicts:
	youtube_dl/utils.py
This commit is contained in:
Philipp Hagemeister 2013-08-28 18:22:28 +02:00
commit c257baff85
3 changed files with 234 additions and 4 deletions

View file

@ -743,3 +743,21 @@ def platform_name():
assert isinstance(res, compat_str)
return res
def bytes_to_intlist(bs):
if not bs:
return []
if isinstance(bs[0], int): # Python 3
return list(bs)
else:
return [ord(c) for c in bs]
def intlist_to_bytes(xs):
if not xs:
return b''
if isinstance(chr(0), bytes): # Python 2
return ''.join([chr(x) for x in xs])
else:
return bytes(xs)