Skip to content

A feature-rich command-line audio/video downloader

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

Philipp Hagemeisterc257baff8584
diff --cc youtube_dl/utils.py
index 64ab309107,ee8df6a5b8..b3d0f64ea9
--- 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)