remove parameter max_results from all capabilities
This commit is contained in:
parent
c108ca3fc5
commit
b99d599aa9
30 changed files with 84 additions and 80 deletions
|
|
@ -43,7 +43,7 @@ class ArretSurImagesBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['login'].get(), self.config['password'].get())
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
# raise UserError('Search does not work on ASI website, use ls latest command')
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class ArteBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
else:
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class CanalplusBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
def create_default_browser(self):
|
||||
return self.create_browser(quality=self.config['quality'].get())
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class CappedBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
with self.browser:
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=None, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=None):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class DailymotionBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
|
||||
SORTBY = ['relevance', 'rated', 'visited', None]
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern, self.SORTBY[sortby])
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class EHentaiBackend(BaseBackend, ICapGallery, ICapCollection):
|
|||
password = None
|
||||
return self.create_browser(self.config['domain'].get(), username, password)
|
||||
|
||||
def search_gallery(self, pattern, sortby=None, max_results=None):
|
||||
def search_gallery(self, pattern, sortby=None):
|
||||
with self.browser:
|
||||
return self.browser.search_gallery(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class EuroparlBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
|
||||
SORTBY = ['relevance', 'rating', 'views', 'time']
|
||||
|
||||
# def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
# def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
# with self.browser:
|
||||
# return self.browser.search_videos(pattern, self.SORTBY[sortby])
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class PluzzBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
with self.browser:
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class GDCVaultBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
|
||||
SORTBY = ['relevance', 'rating', 'views', 'time']
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern, self.SORTBY[sortby])
|
||||
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@ class GroovesharkBackend(BaseBackend, ICapVideo):
|
|||
with self.browser:
|
||||
video.thumbnail.data = self.browser.readurl(video.thumbnail.url)
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=10):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
for video in self.browser.search_videos(pattern, max_results):
|
||||
yield video
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
def get_video(self, _id):
|
||||
with self.browser:
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class GroovesharkBrowser(BaseBrowser):
|
|||
def home(self):
|
||||
self.get_communication_token()
|
||||
|
||||
def search_videos(self, pattern, max_results):
|
||||
def search_videos(self, pattern):
|
||||
method = 'getResultsFromSearch'
|
||||
|
||||
parameters = {}
|
||||
|
|
@ -75,16 +75,14 @@ class GroovesharkBrowser(BaseBrowser):
|
|||
|
||||
response = self.API_post(method, parameters, self.create_token(method))
|
||||
|
||||
songs = self.create_video_from_songs_result(response['result']['result']['Songs'], max_results)
|
||||
songs = self.create_video_from_songs_result(response['result']['result']['Songs'])
|
||||
#playlists = self.create_video_from_playlist_result(response['result']['result']['Playlists'])
|
||||
#albums = self.create_video_from_albums_result(response['result']['result']['Albums'])
|
||||
|
||||
return songs
|
||||
|
||||
def create_video_from_songs_result(self, songs, max_results):
|
||||
def create_video_from_songs_result(self, songs):
|
||||
self.VIDEOS_FROM_SONG_RESULTS = []
|
||||
if max_results:
|
||||
songs = songs[0:max_results]
|
||||
|
||||
for song in songs:
|
||||
video = BaseVideo(song['SongID'])
|
||||
|
|
@ -99,7 +97,8 @@ class GroovesharkBrowser(BaseBrowser):
|
|||
except ValueError:
|
||||
video.date = NotAvailable
|
||||
self.VIDEOS_FROM_SONG_RESULTS.append(video)
|
||||
return self.VIDEOS_FROM_SONG_RESULTS
|
||||
|
||||
yield video
|
||||
|
||||
def create_video_from_playlist_result(self, playlists):
|
||||
videos = []
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class InaBackend(BaseBackend, ICapVideo):
|
|||
def get_video(self, _id):
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -65,9 +65,8 @@ class MediawikiBackend(BaseBackend, ICapContent):
|
|||
content.content = data
|
||||
return content
|
||||
|
||||
def iter_revisions(self, _id, max_results=10):
|
||||
for rev in self.browser.iter_wiki_revisions(_id, max_results):
|
||||
yield rev
|
||||
def iter_revisions(self, _id):
|
||||
return self.browser.iter_wiki_revisions(_id)
|
||||
|
||||
def push_content(self, content, message=None, minor=False):
|
||||
self.browser.set_wiki_source(content, message, minor)
|
||||
|
|
|
|||
|
|
@ -148,30 +148,43 @@ class MediawikiBrowser(BaseBrowser):
|
|||
data['lgtoken'] = result['login']['token']
|
||||
self.API_post(data)
|
||||
|
||||
def iter_wiki_revisions(self, page, nb_entries):
|
||||
def iter_wiki_revisions(self, page):
|
||||
"""
|
||||
Yield 'Revision' objects for the last <nb_entries> revisions of the specified page.
|
||||
Yield 'Revision' objects.
|
||||
"""
|
||||
if len(self.username) > 0 and not self.is_logged():
|
||||
self.login()
|
||||
data = {'action': 'query',
|
||||
'titles': page,
|
||||
'prop': 'revisions',
|
||||
'rvprop': 'ids|timestamp|comment|user|flags',
|
||||
'rvlimit': str(nb_entries),
|
||||
}
|
||||
|
||||
result = self.API_get(data)
|
||||
pageid = str(result['query']['pages'].keys()[0])
|
||||
MAX_RESULTS = 50
|
||||
results = MAX_RESULTS
|
||||
last_id = None
|
||||
|
||||
if pageid != "-1":
|
||||
for rev in result['query']['pages'][pageid]['revisions']:
|
||||
rev_content = Revision(str(rev['revid']))
|
||||
rev_content.comment = rev['comment']
|
||||
rev_content.author = rev['user']
|
||||
rev_content.timestamp = datetime.datetime.strptime(rev['timestamp'], '%Y-%m-%dT%H:%M:%SZ')
|
||||
rev_content.minor = 'minor' in rev
|
||||
yield rev_content
|
||||
while results == MAX_RESULTS:
|
||||
data = {'action': 'query',
|
||||
'titles': page,
|
||||
'prop': 'revisions',
|
||||
'rvprop': 'ids|timestamp|comment|user|flags',
|
||||
'rvlimit': str(MAX_RESULTS),
|
||||
}
|
||||
|
||||
if last_id is not None:
|
||||
data['rvstartid'] = last_id
|
||||
|
||||
result = self.API_get(data)
|
||||
pageid = str(result['query']['pages'].keys()[0])
|
||||
|
||||
results = 0
|
||||
if pageid != "-1":
|
||||
for rev in result['query']['pages'][pageid]['revisions']:
|
||||
rev_content = Revision(str(rev['revid']))
|
||||
rev_content.comment = rev['comment']
|
||||
rev_content.author = rev['user']
|
||||
rev_content.timestamp = datetime.datetime.strptime(rev['timestamp'], '%Y-%m-%dT%H:%M:%SZ')
|
||||
rev_content.minor = 'minor' in rev
|
||||
yield rev_content
|
||||
|
||||
last_id = rev_content.id
|
||||
results += 1
|
||||
|
||||
def home(self):
|
||||
# We don't need to change location, we're using the JSON API here.
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class NolifeTVBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
video = self.browser.get_video(_id)
|
||||
return video
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class TricTracTVBackend(BaseBackend, ICapVideo):
|
|||
with self.browser:
|
||||
return self.browser.get_video(_id)
|
||||
|
||||
def search_videos(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern=None, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
with self.browser:
|
||||
return self.browser.search_videos(pattern)
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class VimeoBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
|
||||
SORTBY = ['relevance', 'rating', 'views', 'time']
|
||||
|
||||
# def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
# def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
# with self.browser:
|
||||
# return self.browser.search_videos(pattern, self.SORTBY[sortby])
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class YoujizzBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
video = self.browser.get_video(_id)
|
||||
return video
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
if not nsfw:
|
||||
return set()
|
||||
with self.browser:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class YoupornBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
|
||||
SORTBY = ['relevance', 'rating', 'views', 'time']
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
if not nsfw:
|
||||
return set()
|
||||
with self.browser:
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class YoutubeBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
video.set_empty_fields(NotAvailable)
|
||||
return video
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=ICapVideo.SEARCH_RELEVANCE, nsfw=False):
|
||||
YOUTUBE_MAX_RESULTS = 50
|
||||
YOUTUBE_MAX_START_INDEX = 1000
|
||||
yt_service = gdata.youtube.service.YouTubeService()
|
||||
|
|
@ -133,27 +133,22 @@ class YoutubeBackend(BaseBackend, ICapVideo, ICapCollection):
|
|||
query.orderby = ('relevance', 'rating', 'viewCount', 'published')[sortby]
|
||||
query.racy = 'include' if nsfw else 'exclude'
|
||||
|
||||
if max_results is None or max_results > YOUTUBE_MAX_RESULTS:
|
||||
query_max_results = YOUTUBE_MAX_RESULTS
|
||||
else:
|
||||
query_max_results = max_results
|
||||
query.max_results = query_max_results
|
||||
query.max_results = YOUTUBE_MAX_RESULTS
|
||||
|
||||
if start_index > YOUTUBE_MAX_START_INDEX:
|
||||
return
|
||||
query.start_index = start_index
|
||||
start_index += query_max_results
|
||||
start_index += YOUTUBE_MAX_RESULTS
|
||||
|
||||
feed = yt_service.YouTubeQuery(query)
|
||||
for entry in feed.entry:
|
||||
yield self._entry2video(entry)
|
||||
nb_yielded += 1
|
||||
if nb_yielded == max_results:
|
||||
return
|
||||
|
||||
if nb_yielded < query_max_results:
|
||||
if nb_yielded < YOUTUBE_MAX_RESULTS:
|
||||
return
|
||||
|
||||
|
||||
def latest_videos(self):
|
||||
return self.search_videos(None, ICapVideo.SEARCH_DATE)
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ class Galleroob(ReplApplication):
|
|||
return 2
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, gallery in self.do('search_gallery', pattern=pattern,
|
||||
max_results=self.options.count):
|
||||
for backend, gallery in self.do('search_gallery', pattern=pattern):
|
||||
self.cached_format(gallery)
|
||||
|
||||
def do_download(self, line):
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ from .minivideo import MiniVideo
|
|||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
def __init__(self, config, weboob, app, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
|
@ -39,6 +39,7 @@ class MainWindow(QtMainWindow):
|
|||
self.config = config
|
||||
self.weboob = weboob
|
||||
self.minivideos = []
|
||||
self.app = app
|
||||
|
||||
self.ui.sortbyEdit.setCurrentIndex(int(self.config.get('settings', 'sortby')))
|
||||
self.ui.nsfwCheckBox.setChecked(int(self.config.get('settings', 'nsfw')))
|
||||
|
|
@ -109,7 +110,7 @@ class MainWindow(QtMainWindow):
|
|||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addVideo)
|
||||
self.process.do('search_videos', pattern, self.ui.sortbyEdit.currentIndex(), nsfw=True, max_results=20, backends=backend_name)
|
||||
self.process.do(self.app._do_complete, 20, (), 'search_videos', pattern, self.ui.sortbyEdit.currentIndex(), nsfw=True, backends=backend_name)
|
||||
|
||||
def addVideo(self, backend, video):
|
||||
if not backend:
|
||||
|
|
|
|||
|
|
@ -42,6 +42,6 @@ class QVideoob(QtApplication):
|
|||
self.load_backends(ICapVideo)
|
||||
self.load_config()
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob)
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
self.main_window.show()
|
||||
return self.weboob.loop()
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from PyQt4.QtCore import SIGNAL
|
|||
from PyQt4.QtGui import QMessageBox, QTableWidgetItem
|
||||
from PyQt4.QtCore import Qt
|
||||
|
||||
from weboob.tools.application.base import MoreResultsAvailable
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.content import ICapContent
|
||||
|
|
@ -32,7 +33,7 @@ from .ui.main_window_ui import Ui_MainWindow
|
|||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
def __init__(self, config, weboob, app, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
|
|
@ -40,6 +41,7 @@ class MainWindow(QtMainWindow):
|
|||
self.config = config
|
||||
self.weboob = weboob
|
||||
self.backend = None
|
||||
self.app = app
|
||||
|
||||
self.connect(self.ui.idEdit,
|
||||
SIGNAL("returnPressed()"),
|
||||
|
|
@ -217,9 +219,11 @@ class MainWindow(QtMainWindow):
|
|||
self.process = QtDo(self.weboob,
|
||||
self._gotRevision,
|
||||
self._errorHistory)
|
||||
self.process.do('iter_revisions',
|
||||
self.process.do(self.app._do_complete,
|
||||
self.ui.nbRevBox.value(),
|
||||
(),
|
||||
'iter_revisions',
|
||||
self.content.id,
|
||||
max_results=self.ui.nbRevBox.value(),
|
||||
backends=(self.backend,))
|
||||
|
||||
def _gotRevision(self, backend, revision):
|
||||
|
|
@ -256,6 +260,9 @@ class MainWindow(QtMainWindow):
|
|||
|
||||
def _errorHistory(self, backend, error, backtrace):
|
||||
""" Loading the history has failed """
|
||||
if isinstance(error, MoreResultsAvailable):
|
||||
return
|
||||
|
||||
content = unicode(self.tr('Unable to load history:\n%s\n')) % to_unicode(error)
|
||||
if logging.root.level == logging.DEBUG:
|
||||
content += '\n%s\n' % to_unicode(backtrace)
|
||||
|
|
|
|||
|
|
@ -33,6 +33,6 @@ class QWebContentEdit(QtApplication):
|
|||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapContent, storage=self.create_storage())
|
||||
self.main_window = MainWindow(self.config, self.weboob)
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
self.main_window.show()
|
||||
return self.weboob.loop()
|
||||
|
|
|
|||
|
|
@ -216,6 +216,5 @@ class Videoob(ReplApplication):
|
|||
|
||||
self.change_path([u'search'])
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, video in self.do('search_videos', pattern=pattern, nsfw=self.nsfw,
|
||||
max_results=self.options.count):
|
||||
for backend, video in self.do('search_videos', pattern=pattern, nsfw=self.nsfw):
|
||||
self.cached_format(video)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import codecs
|
|||
|
||||
from weboob.core.bcall import CallErrors
|
||||
from weboob.capabilities.content import ICapContent, Revision
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
|
||||
|
||||
__all__ = ['WebContentEdit']
|
||||
|
|
@ -144,6 +144,7 @@ class WebContentEdit(ReplApplication):
|
|||
if len(errors.errors) > 0:
|
||||
raise errors
|
||||
|
||||
@defaultcount(10)
|
||||
def do_log(self, line):
|
||||
"""
|
||||
log ID
|
||||
|
|
@ -160,7 +161,7 @@ class WebContentEdit(ReplApplication):
|
|||
_id = _id.encode('utf-8')
|
||||
|
||||
self.start_format()
|
||||
for backend, revision in self.do('iter_revisions', _id, max_results=self.options.count, backends=backend_names):
|
||||
for backend, revision in self.do('iter_revisions', _id, backends=backend_names):
|
||||
self.format(revision)
|
||||
|
||||
def do_get(self, line):
|
||||
|
|
|
|||
|
|
@ -57,14 +57,12 @@ class ICapContent(IBaseCap):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def iter_revisions(self, id, max_results=10):
|
||||
def iter_revisions(self, id):
|
||||
"""
|
||||
Iter revisions of a content.
|
||||
|
||||
:param id: id of content
|
||||
:type id: str
|
||||
:param max_results: maximum results
|
||||
:type max_results: int
|
||||
:rtype: iter[:class:`Revision`]
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class ICapGallery(IBaseCap):
|
|||
SEARCH_VIEWS,
|
||||
SEARCH_DATE) = range(4)
|
||||
|
||||
def search_gallery(self, pattern, sortby=SEARCH_RELEVANCE, max_results=None):
|
||||
def search_gallery(self, pattern, sortby=SEARCH_RELEVANCE):
|
||||
"""
|
||||
Iter results of a search on a pattern.
|
||||
|
||||
|
|
@ -119,10 +119,6 @@ class ICapGallery(IBaseCap):
|
|||
:type pattern: str
|
||||
:param sortby: sort by...
|
||||
:type sortby: SEARCH_*
|
||||
:param nsfw: include non-suitable for work videos if True
|
||||
:type nsfw: bool
|
||||
:param max_results: maximum number of results to return
|
||||
:type max_results: int
|
||||
:rtype: :class:`BaseGallery`
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class ICapVideo(IBaseCap):
|
|||
SEARCH_VIEWS,
|
||||
SEARCH_DATE) = range(4)
|
||||
|
||||
def search_videos(self, pattern, sortby=SEARCH_RELEVANCE, nsfw=False, max_results=None):
|
||||
def search_videos(self, pattern, sortby=SEARCH_RELEVANCE, nsfw=False):
|
||||
"""
|
||||
Iter results of a search on a pattern.
|
||||
|
||||
|
|
@ -77,8 +77,6 @@ class ICapVideo(IBaseCap):
|
|||
:param sortby: sort by... (use SEARCH_* constants)
|
||||
:param nsfw: include non-suitable for work videos if True
|
||||
:type nsfw: bool
|
||||
:param max_results: maximum number of results to return
|
||||
:type max_results: int
|
||||
:rtype: iter[:class:`BaseVideo`]
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue