youtube backend doesn't load anymore if python-gdata is missing
This commit is contained in:
parent
4f73e8535e
commit
706c59a9a2
1 changed files with 4 additions and 2 deletions
|
|
@ -19,6 +19,10 @@
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
try:
|
||||||
|
import gdata.youtube.service
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Missing dependence: python-gdata")
|
||||||
|
|
||||||
from weboob.capabilities.video import ICapVideo
|
from weboob.capabilities.video import ICapVideo
|
||||||
from weboob.tools.backend import BaseBackend, ObjectNotAvailable
|
from weboob.tools.backend import BaseBackend, ObjectNotAvailable
|
||||||
|
|
@ -49,8 +53,6 @@ class YoutubeBackend(BaseBackend, ICapVideo):
|
||||||
raise ObjectNotAvailable(e)
|
raise ObjectNotAvailable(e)
|
||||||
|
|
||||||
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
def iter_search_results(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||||
import gdata.youtube.service
|
|
||||||
|
|
||||||
YOUTUBE_MAX_RESULTS = 50
|
YOUTUBE_MAX_RESULTS = 50
|
||||||
YOUTUBE_MAX_START_INDEX = 1000
|
YOUTUBE_MAX_START_INDEX = 1000
|
||||||
yt_service = gdata.youtube.service.YouTubeService()
|
yt_service = gdata.youtube.service.YouTubeService()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue