From: Philipp Hagemeister Date: Wed, 28 Aug 2013 16:22:28 +0000 (+0200) Subject: Merge remote-tracking branch 'rzhxeo/youporn-hd' X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=c257baff858488728a23072674929288784add48;p=youtube-dl Merge remote-tracking branch 'rzhxeo/youporn-hd' Conflicts: youtube_dl/utils.py --- c257baff858488728a23072674929288784add48 diff --cc youtube_dl/utils.py index 64ab30910,ee8df6a5b..b3d0f64ea --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@@ -735,11 -710,18 +735,29 @@@ class DateRange(object) return '%s - %s' % ( self.start.isoformat(), self.end.isoformat()) +def platform_name(): + """ Returns the platform name as a compat_str """ + res = platform.platform() + if isinstance(res, bytes): + res = res.decode(preferredencoding()) + + 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)