Video contains 'rating_max' information
This commit is contained in:
parent
a03f98ff3e
commit
ba2f1cf99a
3 changed files with 9 additions and 3 deletions
|
|
@ -79,7 +79,9 @@ class VideoPage(PornPage):
|
||||||
elif name == 'Submitted:':
|
elif name == 'Submitted:':
|
||||||
v.author = li.find('i').text
|
v.author = li.find('i').text
|
||||||
elif name == 'Rating:':
|
elif name == 'Rating:':
|
||||||
v.rating = float(value[:value.find(' ')])
|
r = value.split()
|
||||||
|
v.rating = float(r[0])
|
||||||
|
v.rating_max = float(r[2])
|
||||||
elif name == 'Date:':
|
elif name == 'Date:':
|
||||||
m = self.DATE_REGEXP.match(value)
|
m = self.DATE_REGEXP.match(value)
|
||||||
if m:
|
if m:
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
from .cap import ICap
|
from .cap import ICap
|
||||||
|
|
||||||
class Video(object):
|
class Video(object):
|
||||||
def __init__(self, _id, title=u'', url=u'', author=u'', duration=0, date=None, rating=0):
|
def __init__(self, _id, title=u'', url=u'', author=u'', duration=0, date=None, rating=0, rating_max=0):
|
||||||
self.id = _id
|
self.id = _id
|
||||||
self.title = title
|
self.title = title
|
||||||
self.url = url
|
self.url = url
|
||||||
|
|
@ -29,6 +29,7 @@ class Video(object):
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
self.date = date
|
self.date = date
|
||||||
self.rating = rating
|
self.rating = rating
|
||||||
|
self.rating_max = rating_max
|
||||||
|
|
||||||
class ICapVideoProvider(ICap):
|
class ICapVideoProvider(ICap):
|
||||||
def iter_page_urls(self, mozaic_url):
|
def iter_page_urls(self, mozaic_url):
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,9 @@ class Videoob(ConsoleApplication):
|
||||||
print u"| URL | %s" % video.url
|
print u"| URL | %s" % video.url
|
||||||
print u"| Author | %s" % video.author
|
print u"| Author | %s" % video.author
|
||||||
print u"| Date | %s" % video.date
|
print u"| Date | %s" % video.date
|
||||||
|
if video.rating_max:
|
||||||
|
print u"| Rating | %s / %s" % (video.rating, video.rating_max)
|
||||||
|
elif video.rating:
|
||||||
print u"| Rating | %s" % video.rating
|
print u"| Rating | %s" % video.rating
|
||||||
print u"'-----------------' "
|
print u"'-----------------' "
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue