X-Git-Url: https://git.ao2.it/smooth-dl.git/blobdiff_plain/7df1a640fc22bda104d419e9a20a4ca46665792d..1437199b7a501d9052e0be91f9834a4b609499f2:/smooth-dl.py?ds=inline diff --git a/smooth-dl.py b/smooth-dl.py index 85a0d2e..4fdbca1 100755 --- a/smooth-dl.py +++ b/smooth-dl.py @@ -30,11 +30,6 @@ # basically, write a proper implementation of manifest parsing and chunk # downloading - -__description = "Download videos served using Smooth Streaming technology" -__version = "0.x" -__author_info = "Written by Antonio Ospite http://ao2.it" - import os import re import sys @@ -45,6 +40,10 @@ import tempfile from optparse import OptionParser from urlparse import urlparse, urlunparse +__description__ = "Download videos served using Smooth Streaming technology" +__version__ = "0.x" +__author_info__ = "Written by Antonio Ospite http://ao2.it" + def get_chunk_data(data): @@ -54,10 +53,10 @@ def get_chunk_data(data): data_start = moof_size + 4 + len('mdat') data_size = mdat_size - 4 - len('mdat') - #print len(data[data_start:]), \ + # print len(data[data_start:]), \ # len(data[data_start:data_start + data_size]), data_size - assert(len(data[data_start:]) == data_size) + assert len(data[data_start:]) == data_size return data[data_start:data_start + data_size] @@ -65,7 +64,7 @@ def get_chunk_data(data): def hexstring_to_bytes(hex_string): res = "" for i in range(0, len(hex_string), 2): - res += chr(int(hex_string[i:i + 2], 16)) + res += chr(int(hex_string[i:i + 2], 16)) return res @@ -93,11 +92,12 @@ def write_wav_header(out_file, fmt, codec_private_data, data_len): out_file.write("data") out_file.write(struct.pack('