From: Philipp Hagemeister Date: Sun, 20 Jul 2014 21:20:15 +0000 (+0200) Subject: [swfinterp] Use helper function struct_unpack for old Python 2.x releases (#3270) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=c13bf7c836e1befb28070fe393e474566a43409a;p=youtube-dl [swfinterp] Use helper function struct_unpack for old Python 2.x releases (#3270) --- diff --git a/youtube_dl/swfinterp.py b/youtube_dl/swfinterp.py index 79d86152d..87ec7bcff 100644 --- a/youtube_dl/swfinterp.py +++ b/youtube_dl/swfinterp.py @@ -2,12 +2,12 @@ from __future__ import unicode_literals import collections import io -import struct import zlib from .utils import ( compat_str, ExtractorError, + struct_unpack, ) @@ -23,17 +23,17 @@ def _extract_tags(file_contents): file_contents[:1]) # Determine number of bits in framesize rectangle - framesize_nbits = struct.unpack('!B', content[:1])[0] >> 3 + framesize_nbits = struct_unpack('!B', content[:1])[0] >> 3 framesize_len = (5 + 4 * framesize_nbits + 7) // 8 pos = framesize_len + 2 + 2 while pos < len(content): - header16 = struct.unpack('> 6 tag_len = header16 & 0x3f if tag_len == 0x3f: - tag_len = struct.unpack('= 0x80) else b'\x00' - return struct.unpack('