]> jfr.im git - yt-dlp.git/blobdiff - youtube_dl/utils.py
[generic] Support Wordpress "YouTube Video Importer" plugin
[yt-dlp.git] / youtube_dl / utils.py
index de66cb482730b564375e227da64b4240566ea3f5..a2cfb48a6da9236be636fa474de834af2cf525d2 100644 (file)
@@ -1660,6 +1660,10 @@ def float_or_none(v, scale=1, invscale=1, default=None):
         return default
 
 
+def strip_or_none(v):
+    return None if v is None else v.strip()
+
+
 def parse_duration(s):
     if not isinstance(s, compat_basestring):
         return None
@@ -2895,3 +2899,7 @@ def parse_m3u8_attributes(attrib):
             val = val[1:-1]
         info[key] = val
     return info
+
+
+def urshift(val, n):
+    return val >> n if val >= 0 else (val + 0x100000000) >> n