nsfw is handled in video subclasses
nsfw
This commit is contained in:
parent
c999c68459
commit
d427f0a899
5 changed files with 10 additions and 6 deletions
|
|
@ -37,7 +37,6 @@ class YoujizzBackend(BaseBackend, ICapVideo):
|
|||
|
||||
def get_video(self, _id):
|
||||
video = self.browser.get_video(_id)
|
||||
video.nsfw = True
|
||||
return video
|
||||
|
||||
def iter_page_urls(self, mozaic_url):
|
||||
|
|
@ -47,5 +46,4 @@ class YoujizzBackend(BaseBackend, ICapVideo):
|
|||
if not nsfw:
|
||||
yield iter(set())
|
||||
for video in self.browser.iter_search_results(pattern, required_fields=required_fields):
|
||||
video.nsfw = True
|
||||
yield video
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ __all__ = ['YoujizzVideo']
|
|||
|
||||
|
||||
class YoujizzVideo(BaseVideo):
|
||||
def __init__(self, *args, **kwargs):
|
||||
BaseVideo.__init__(self, *args, **kwargs)
|
||||
self.nsfw = True
|
||||
|
||||
@classmethod
|
||||
def id2url(cls, _id):
|
||||
return 'http://www.youjizz.com/videos/%s.html' % _id
|
||||
|
|
|
|||
|
|
@ -68,4 +68,4 @@ class IndexPage(PornPage):
|
|||
rating_max=rating_max,
|
||||
duration=duration,
|
||||
thumbnail_url=thumbnail_url,
|
||||
nsfw=True)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -29,12 +29,10 @@ class VideoPage(PornPage):
|
|||
def on_loaded(self):
|
||||
if not PornPage.on_loaded(self):
|
||||
return
|
||||
|
||||
self.video = YoupornVideo(self.get_id(),
|
||||
self.get_title(),
|
||||
self.get_url(),
|
||||
nsfw=True)
|
||||
|
||||
)
|
||||
self.set_details(self.video)
|
||||
|
||||
def get_id(self):
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ __all__ = ['YoupornVideo']
|
|||
|
||||
|
||||
class YoupornVideo(BaseVideo):
|
||||
def __init__(self, *args, **kwargs):
|
||||
BaseVideo.__init__(self, *args, **kwargs)
|
||||
self.nsfw = True
|
||||
|
||||
@classmethod
|
||||
def id2url(cls, _id):
|
||||
if _id.isdigit():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue