[letv] Fix extraction

Using data URIs for passing the decrypted M3U8 manifest, which is
supported by ffmpeg only.
This commit is contained in:
Yen Chi Hsuan 2015-07-22 20:03:05 +08:00
parent 2ccb37beb9
commit 1e399778ee
2 changed files with 57 additions and 18 deletions

View file

@ -3,6 +3,7 @@
from __future__ import unicode_literals
import base64
import calendar
import codecs
import contextlib
@ -1795,6 +1796,10 @@ def urlhandle_detect_ext(url_handle):
return mimetype2ext(getheader('Content-Type'))
def encode_data_uri(data, mime_type):
return 'data:%s;base64,%s' % (mime_type, base64.b64encode(data).decode('ascii'))
def age_restricted(content_limit, age_limit):
""" Returns True iff the content should be blocked """