gdcvault: Implement searching; partial download fix

* Implement search functionality, using POST to get JSON data
* Fix download for most items even for non-free ones.
For now only missing are non-free mp3 files it seems (like 769),
/mediaProxy.php returns 2bytes html crap.
This commit is contained in:
François Revol 2013-03-22 06:32:37 +01:00 committed by Romain Bignon
commit 38b80491f1
4 changed files with 177 additions and 23 deletions

View file

@ -66,9 +66,9 @@ class GDCVaultBackend(BaseBackend, ICapVideo, ICapCollection):
SORTBY = ['relevance', 'rating', 'views', 'time']
# def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
# with self.browser:
# return self.browser.search_videos(pattern, self.SORTBY[sortby])
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
with self.browser:
return self.browser.search_videos(pattern, self.SORTBY[sortby])
def fill_video(self, video, fields):
if fields != ['thumbnail']: