# -*- coding: utf-8 -*- __revision__ = '$Id: PluginMovieOnet.py 571 2006-12-17 01:11:53Z piotrek $' # Copyright (c) 2005-2006 Piotr Ożarowski # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # You may use and distribute this software under the terms of the # GNU General Public License, version 2 or later from gettext import gettext as _ import gutils import movie,string plugin_name = 'Onet' plugin_description = 'Onet Film' plugin_url = 'film.onet.pl' plugin_language = _('Polish') plugin_author = 'Piotr Ożarowski' plugin_author_email = '' plugin_version = '1.7' class Plugin(movie.Movie): def __init__(self, id): self.encode = 'iso-8859-2' self.movie_id = id self.url = "http://film.onet.pl/%s" % str(self.movie_id) def get_image(self): self.movie_id = '' # problems with decoding polish characters in UTF8 => forget ID self.image_url = '' pos = string.find(self.page, 'alt="Galeria" border=1 src="') if pos > 0: self.image_url = "http://film.onet.pl/%s" % gutils.trim(self.page[pos:], 'src="', '"') return pos = string.find(self.page, 'IMG class=pic alt=\"Plakat"') if pos > 0: self.image_url = "http://film.onet.pl/%s" % gutils.trim(self.page[pos:], 'src="', '">') def get_o_title(self): self.o_title = gutils.trim(self.page, 'class=a2 valign=top width="100%">', '') if self.o_title == '': self.o_title = self.get_title(True) def get_title(self, ret=False): data = gutils.trim(self.page, '', ' - Onet.pl Film') if ret is True: return data else: self.title = data def get_director(self): self.director = gutils.trim(self.page, '
Re\xbfyseria:  ', '
') if string.find(self.director, '-->') <> -1: self.director = gutils.after(self.director, '-->') self.director = gutils.before(self.director,"