X-Git-Url: https://git.ao2.it/smooth-dl.git/blobdiff_plain/671bc7755936cc430340a953bc726f112f42d57a..5823e17e70b2fe749ce6d5998b8f01cc0db1537e:/smooth-dl.py diff --git a/smooth-dl.py b/smooth-dl.py index 3297102..60c3e00 100755 --- a/smooth-dl.py +++ b/smooth-dl.py @@ -2,7 +2,7 @@ # # smooth-dl - download videos served using Smooth Streaming technology # -# Copyright (C) 2010 Antonio Ospite +# Copyright (C) 2010-2016 Antonio Ospite # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -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 @@ -94,11 +93,30 @@ def write_wav_header(out_file, fmt, codec_private_data, data_len): out_file.write(struct.pack('