diff options
| author | Philipp Hagemeister <phihag@phihag.de> | 2013-08-28 18:22:28 +0200 | 
|---|---|---|
| committer | Philipp Hagemeister <phihag@phihag.de> | 2013-08-28 18:22:28 +0200 | 
| commit | c257baff858488728a23072674929288784add48 (patch) | |
| tree | 9558c59250a1794aa607772bc37010cbdc055c0e /youtube_dl/utils.py | |
| parent | ccf4b799df0f97df5f745f38af96666386766754 (diff) | |
| parent | 878e83c5a4c84c7abbf3484366e76fbe906c8947 (diff) | |
Merge remote-tracking branch 'rzhxeo/youporn-hd'
Conflicts:
	youtube_dl/utils.py
Diffstat (limited to 'youtube_dl/utils.py')
| -rw-r--r-- | youtube_dl/utils.py | 18 | 
1 files changed, 18 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 64ab30910..b3d0f64ea 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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)  | 
