s/preview_url/thumbnail_url/
This commit is contained in:
parent
cbf7480603
commit
aa1a2a2921
5 changed files with 9 additions and 9 deletions
|
|
@ -42,7 +42,7 @@ class IndexPage(BasePage):
|
|||
url = a.attrib['href']
|
||||
_id = re.sub(r'/videos/(.+)\.html', r'\1', url)
|
||||
|
||||
preview_url = span.find('.//img').attrib['src']
|
||||
thumbnail_url = span.find('.//img').attrib['src']
|
||||
|
||||
title1 = span.cssselect('span#title1')
|
||||
if title1 is None:
|
||||
|
|
@ -60,6 +60,6 @@ class IndexPage(BasePage):
|
|||
yield Video(_id,
|
||||
title=title,
|
||||
duration=duration,
|
||||
preview_url=preview_url,
|
||||
thumbnail_url=thumbnail_url,
|
||||
nsfw=True,
|
||||
id2url=tools.id2url)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class IndexPage(PornPage):
|
|||
if a is None or a.find('img') is None:
|
||||
continue
|
||||
|
||||
preview_url = a.find('img').attrib['src']
|
||||
thumbnail_url = a.find('img').attrib['src']
|
||||
|
||||
h1 = li.find('h1')
|
||||
a = h1.find('a')
|
||||
|
|
@ -71,6 +71,6 @@ class IndexPage(PornPage):
|
|||
rating=rating,
|
||||
rating_max=rating_max,
|
||||
duration=duration,
|
||||
preview_url=preview_url,
|
||||
thumbnail_url=thumbnail_url,
|
||||
nsfw=True,
|
||||
id2url=tools.id2url)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class YoutubeBackend(BaseBackend, ICapVideoProvider):
|
|||
title=entry.media.title.text.decode('utf-8').strip(),
|
||||
author=author,
|
||||
duration=int(entry.media.duration.seconds.decode('utf-8').strip()),
|
||||
preview_url=entry.media.thumbnail[0].url.decode('utf-8').strip(),
|
||||
thumbnail_url=entry.media.thumbnail[0].url.decode('utf-8').strip(),
|
||||
id2url=tools.id2url)
|
||||
|
||||
def iter_page_urls(self, mozaic_url):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ __all__ = ['ICapVideoProvider', 'Video']
|
|||
|
||||
class Video(object):
|
||||
def __init__(self, _id, title=None, url=None, author=None, duration=0, date=None,
|
||||
rating=0.0, rating_max=0.0, preview_url=None, nsfw=False, id2url=None):
|
||||
rating=0.0, rating_max=0.0, thumbnail_url=None, nsfw=False, id2url=None):
|
||||
self.id = _id
|
||||
self.title = title
|
||||
self.url = url
|
||||
|
|
@ -35,7 +35,7 @@ class Video(object):
|
|||
self.date = date
|
||||
self.rating = float(rating)
|
||||
self.rating_max = float(rating_max)
|
||||
self.preview_url = preview_url
|
||||
self.thumbnail_url = thumbnail_url
|
||||
self.nsfw = nsfw
|
||||
self.id2url = id2url
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class MiniVideo(QFrame):
|
|||
else:
|
||||
self.ui.ratingLabel.setText('%s' % video.rating)
|
||||
|
||||
if video.preview_url:
|
||||
data = urllib2.urlopen(video.preview_url).read()
|
||||
if video.thumbnail_url:
|
||||
data = urllib2.urlopen(video.thumbnail_url).read()
|
||||
img = QImage.fromData(data)
|
||||
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue