Griffith - media collection manager
May 23, 2012, 07:17:06 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: New mailing lists,
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Help wiht Plugin  (Read 1650 times)
clippi
Newbie
*
Offline Offline

Posts: 5



View Profile
« on: June 26, 2006, 12:01:49 AM »

here my plugin ....his wil not be going/doos not going :-( maybe someone can me help Place? sorry for my bad Inglis ....
------------------------------------------------------------

plugin_name = "adultcdmovies.us"
plugin_description = "ADULTCDMOVIES.US"
plugin_url = "www.adultcdmovies.us"
plugin_language = _("Englisch")
plugin_author = "Bart De Clippeleir"
plugin_author_email = "<clippi7@msn.com>"
plugin_version = "1.1"

class Plugin(movie.Movie):
        url_to_use = "http://www.adultcdmovies.us/"
        url_type = "K"
       
        def __init__(self, id):
                self.encode='iso-8859-1'
                self.elements = string.split(id, "_")
                self.movie_id = self.elements[1]
                if (self.elements[0] == "V"):
                        self.url_to_use = "http://www.adultcdmovies.us/"
                        self.url_type = "V"
                else:
                        self.url_to_use = "http://www.adultcdmovies.us/"
                        self.url_type = "K"
                self.url = self.url_to_use + "typ=film&NR=" + str(self.movie_id)
               
        def picture(self):
                if (gutils.trim(self.url, "typ=", "&") <> "film"):
                        self.url = self.url_to_use + "typ=film&NR=" + str(self.movie_id)
                        self.open_page(self.parent_window)
                self.tmp_page = gutils.trim(self.page, "<!-- PRINT-CONTENT-START-->", "<!-- PRINT-CONTENT-ENDE-->")
                if (self.url_type == "V"):
                        self.picture_url = "http://www.adultcdmovies.us/pix/MBBILDER/VIDEO/" + gutils.trim(self.tmp_page,"IMG SRC=\"/pix/MBBILDER/VIDEO/", "\"")
                else:
                        self.picture_url = gutils.trim(self.tmp_page,"IMG SRC=\"/pix/MBBILDER/KINOPLAK/", "\"")
                        if self.picture_url <> '':
                                self.picture_url = "http://www.adultcdmovies.us/pix/MBBILDER/KINOPLAK/" + self.picture_url
                        else:
                                self.picture_url = "http://www.adultcdmovies.us/pix/MBBILDER/KINO/" + gutils.trim(self.tmp_page,"IMG SRC=\"/pix/MBBILDER/KINO/", "\"")

        def original_title(self):
                self.original_title = gutils.trim(self.page,"span CLASS=\"standardsmall\"><br>(",")<")
       
        def title(self):
                if (self.url_type == "V"):
                        self.title = gutils.after(gutils.trim(self.page,"\"headline2\"><A HREF=\"/movies.php4?nr=", "</A>"), ">")
                else:
                        self.title = gutils.after(gutils.trim(self.page,"\"headline2\"><A HREF=\"/Adultcdmovies.php4?nr=", "</A>"), ">")
               
        def director(self):
                if (gutils.trim(self.url, "typ=", "&") <> "credits"):
                        self.url = self.url_to_use + "typ=credits&NR=" + str(self.movie_id)
                        self.open_page(self.parent_window)
                self.director = gutils.trim(self.page,"Regie","</a>")
                self.director = gutils.after(self.director,"mitwirk.php4")
                self.director = gutils.after(self.director,">")
               
        def plot(self):
                if (gutils.trim(self.url, "typ=", "&") <> "film"):
                        self.url = self.url_to_use + "typ=film&NR=" + str(self.movie_id)
                        self.open_page(self.parent_window)
                self.tmp_page = gutils.trim(self.page, "<!-- PRINT-CONTENT-START-->", "<!-- PRINT-CONTENT-ENDE-->")
                if (self.url_type == "V"):
                        self.plot = gutils.after(self.tmp_page,"IMG SRC=\"/pix/MBBILDER/VIDEO")
                        self.plot = gutils.trim(self.plot,"</TABLE>", "</TD>")
                else:
                        self.plot = gutils.after(self.tmp_page,"IMG SRC=\"/pix/MBBILDER/KINOPLAK")
                        self.plot = gutils.trim(self.plot,"</TABLE>", "</TD>")
                        if self.plot == '':
                                self.plot = gutils.trim(self.tmp_page, "BORDER=\"0\" align=\"left\" ><TR><TD>", "</TD>")
               
        def year(self):
                self.year = gutils.trim(self.page,"class=\"standardsmall\"><br><b>DVD</b> - <b>","<BR>")
                if self.year == "":
                        self.year = gutils.trim(self.page,"class=\"standardsmall\"><b>","<BR>")
                self.year = gutils.trim(self.year,"<b>","</b>")
                self.year = gutils.after(self.year," ")
               
        def running_time(self):
                self.running_time = gutils.trim(self.page,"Jahren</b> - <b>"," Min.")
                if (self.running_time == ''):
                        self.running_time = gutils.trim(self.page,"Jahren</b></b> - <b>"," Min.")
                if (self.running_time == ''):
                        self.running_time = gutils.trim(self.page,"</b><BR><b>"," Min.")
               
        def genre(self):
                self.genre = gutils.trim(self.page,"class=\"standardsmall\"><br><b>DVD</b> - <b>","</b>")
                if self.genre == "":
                        self.genre = gutils.trim(self.page,"class=\"standardsmall\"><b>","</b>")
               
        def with(self):
                if (gutils.trim(self.url, "typ=", "&") <> "credits"):
                        self.url = self.url_to_use + "typ=credits&NR=" + str(self.movie_id)
                        self.open_page(self.parent_window)
                self.with = gutils.trim(self.page,"</TD></TR><TR  CLASS=\"dbtreffer", "\n")
                self.with = gutils.after(self.with, "\">")
                self.with = self.with.replace("<TR  CLASS=\"dbtrefferlight\">", "\n")
                self.with = self.with.replace("<TR  CLASS=\"dbtrefferdark\">", "\n")
                self.with = self.with.replace("&nbsp;", "--flip--")
                self.with = gutils.clean(self.with)
                self.elements1 = self.with.split("\n")
                self.with = ''
                for element1 in self.elements1:
                        self.elements2 = element1.split("--flip--")
                        if len(self.elements2) > 1:
                                self.with += self.elements2[1] + "--flip--" + self.elements2[0] + "\n"
                        else:
                                self.with = element1
                self.with = self.with.replace("--flip--", _(" as "))

        def classification(self):
                self.classification = gutils.trim(self.page,"FSK: ","</b>")
               
        def studio(self):
                self.studio = gutils.trim(self.page,"Verleih: ", "</b>")
               
        def site(self):
                self.site = ""
               
        def imdb(self):
                self.imdb = self.url_to_use + "NR=" + self.movie_id;
               
        def trailer(self):
                self.trailer = ""
               
        def country(self):
                self.country = gutils.trim(self.page,"class=\"standardsmall\"><br><b>DVD</b> - <b>","<BR>")
                if self.country == "":
                        self.country = gutils.trim(self.page,"class=\"standardsmall\"><b>","<BR>")
                self.country = gutils.trim(self.country,"<b>","</b>")
                self.country = gutils.before(self.country," ")
               
        def rating(self):
                self.rating = 0
               
class SearchPlugin(movie.SearchMovie):

        def __init__(self):
                self.original_url_search    = "http://www.adultcdmovies.us/e-pmsearch.aspx?SearchTerm="
                self.translated_url_search    = "http://www.adultcdmovies.us/e-pmsearch.aspx?SearchTerm="
                self.encode='iso-8859-1'
               
        def search(self,parent_window):
                self.open_search(parent_window)
                self.page = gutils.trim(self.page,"align=center><B>Adultcdmovies 1", "<!-- PRINT-CONTENT-ENDE-->");
                self.page = self.page.decode('iso-8859-1')
                if (self.page<>''):
                        return self.page
                self.url = "http://www.adultcdmovies.us/e-pmsearch.aspx?SearchTerm="
                self.open_search(parent_window)
                self.page = gutils.trim(self.page,"align=center><B>Video/DVD 1", "<!-- PRINT-CONTENT-ENDE-->");
                self.page = self.page.decode('iso-8859-1')
                return self.page
               
        def get_searches(self):
                self.elements_tmp = string.split(self.page,"adultcdmovies.php4")
               
                if (self.elements_tmp[0]<>self.page):
                        self.elements = string.split(self.page,"headline3\"><A HREF=\"/adultcdmovies.php4?nr=")
                        if (self.elements[0]<>''):
                                self.elements[0] = ''
                                for element in self.elements:
                                        if (element <> ''):
                                                self.ids.append("K_" + gutils.before(element,"&"))
                                                self.titles.append(gutils.strip_tags(
                                                        gutils.trim(element,">","</A>") + " " +
                                                        gutils.trim(element, "<span CLASS=\"standardsmall\"><br>", "</SPAN>") + " (" +
                                                        string.replace(
                                                                gutils.trim(element, "<span class=\"standardsmall\"><b>", "</span>"), "<b>", ", ")
                                                        + ")"
                                                ))
                else:
                        self.elements_tmp2 = string.split(self.page, "videofilm.php4")
                        if (self.elements_tmp2[0]<>self.page):
                                self.elements = string.split(self.page,"headline3\"><A HREF=\"/videofilm.php4?nr=")
                                if (self.elements[0]<>''):
                                        self.elements[0] = ''
                                        for element in self.elements:
                                                if (element <> ''):
                                                        self.ids.append("V_" + gutils.before(element,"&"))
                                                        self.titles.append(gutils.strip_tags(
                                                                gutils.trim(element,">","</A>") + " " +
                                                                gutils.trim(element, "<span CLASS=\"standardsmall\"><br>", "</SPAN>") + " (" +
                                                                string.replace(
                                                                        gutils.trim(element, "<span class=\"standardsmall\"><b>", "</span>"), "<b>", ", ") + ")"
                                                        ))
                        else:
                                pass

Logged
clippi
Newbie
*
Offline Offline

Posts: 5



View Profile
« Reply #1 on: August 24, 2006, 11:48:28 AM »

 Cry nobody there waht can help me ?
Logged
mike
Global Moderator
Hero Member
*****
Offline Offline

Posts: 996


View Profile WWW
« Reply #2 on: August 24, 2006, 01:50:14 PM »

Please use the following lines of code as a starting point for your plugin.
In your version you used a complex plugin from me for a complex page.
It's to much for your website.
The following code IS NOT COMPLETED ! I wrote it some weeks ago and
I didn't test it again. As I wrote the plugin it showed the list of movies but
didn't extract the information of a selected movie.

# -*- coding: UTF-8 -*-

__revision__ = '$Id$'

# Copyright (c) 2006
#
# 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
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
import string

plugin_name = "adultcdmovies.us"
plugin_description = "ADULTCDMOVIES.US"
plugin_url = "www.adultcdmovies.us"
plugin_language = _("Englisch")
plugin_author = "Bart De Clippeleir"
plugin_author_email = "<clippi7@msn.com>"
plugin_version = "1.0"

class Plugin(movie.Movie):
       
        def __init__(self, id):
                self.encode='iso-8859-1'
                self.movie_id = id
                self.url = "http://www.adultcdmovies.us/" + gutils.before(str(self.movie_id), "?") + "?"
               
        def picture(self):
                self.picture_url = "http://www.adultcdmovies.us/" + gutils.trim(gutils.after(self.page,"ProductPic"), "src=\"", "\"");
      gutils.warning(self, msg=self.picture_url)

        def original_title(self):
                self.original_title = gutils.trim(self.page,"<h2>","</h2>")
       
        def title(self):
                self.title = gutils.trim(self.page,"<h2>","</h2>")
               
        def director(self):
                self.director = ""
               
        def plot(self):
                self.plot = gutils.trim(self.page, "<hr style=\"clear:both\" />", "<p")
               
        def year(self):
                self.year = gutils.trim(self.page,"Movie Year: ","<br />")
               
        def running_time(self):
                self.running_time = ""
               
        def genre(self):
                self.genre = gutils.trim(self.page,"Categories &amp; Genres:","<br />")
               
        def with(self):
                self.with = ""

        def classification(self):
                self.classification = ""
               
        def studio(self):
                self.studio = gutils.after(gutils.trim(self.page,"Studio: ", "<br />"), ">")
      if (self.studio == ''):
         self.studio = gutils.trim(self.page,"Studio: ", "<br />")
               
        def site(self):
                self.site = ""
               
        def imdb(self):
                self.imdb = self.url
               
        def trailer(self):
                self.trailer = ""
               
        def country(self):
                self.country = ""
               
        def rating(self):
                self.rating = 0

class SearchPlugin(movie.SearchMovie):

        def __init__(self):
                self.original_url_search   = "http://www.adultcdmovies.us/e-pmsearch.aspx?SearchType=0&SortBy=p.Name asc&SearchTerm="
                self.translated_url_search = "http://www.adultcdmovies.us/e-pmsearch.aspx?SearchType=0&SortBy=p.Name asc&SearchTerm="
                self.encode='iso-8859-1'

        def search(self,parent_window):
                self.open_search(parent_window)
                self.page = gutils.trim(self.page,"most expensive first", "<hr style=\"clear:both\"");
                self.page = self.page.decode('iso-8859-1')
                return self.page
               
        def get_searches(self):
                self.elements = string.split(self.page,"a href=\"")
                if (self.elements[0]<>''):
                        for element in self.elements:
                                self.ids.append(gutils.before(element,"\">"))
                                self.titles.append(gutils.strip_tags(
                                        gutils.trim(element,"\">","</a>")
                                ))
                else:
                        pass


-----
Regards
Logged
POX
Administrator
Hero Member
*****
Offline Offline

Posts: 512



View Profile WWW
« Reply #3 on: August 24, 2006, 03:21:23 PM »

Here you can download version with some changes I made (it still freezes very often, don't know why)
Logged

Please, feel free to correct my English.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!