[teamcoco] Rewrite preload data extraction
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 14 May 2015 18:17:22 +0000 (02:17 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 14 May 2015 18:28:40 +0000 (02:28 +0800)
commit3a105f7b20e8a3f742ac86cc1a6b02935b831778
treef2d1fe12cd33625a9b25034ab1538c5520c77ce0
parent1ae72fb23df709687091133602fd715ab6cb7b2b
[teamcoco] Rewrite preload data extraction

Idea: "puncture" some consecutive fragments and check whether the
b64decode result of a punctured string is a valid JSON or not.

It's a O(N^3) algorithm, but should be fast for a small N (less than 30
fragments in all test cases)
youtube_dl/extractor/teamcoco.py