Exemple #1
0
    def start(self, hidden=False):
        if FIRST_RUN:
            global LANG_MPAA
            langs = ["us", "de", "nl", "au"]
            LANG_MPAA = langs[util.dialogSelect(l("Choose_your_MPAA_system"), langs)]
            util.setting("mpaaLang", LANG_MPAA)
            util.settingBool("firstMpaaRun", False)

        if hidden:
            global HIDE_MPAA
            HIDE_MPAA = True

        movies = util.getMoviesWith('imdbnumber', 'mpaa')
        total = len(movies)

        if total > 0:
            self.startProcess(movies, total)
        else:
            util.dialogOk(l("Info"), l("The_video_library_is_empty_or_the_IMDb_id_doesn't_exist!"))

        return HIDE_MPAA
Exemple #2
0
    def start(self, hidden=False):
        if FIRST_RUN:
            global LANG_MPAA
            langs = ["us", "de", "nl", "au"]
            LANG_MPAA = langs[util.dialogSelect(l("Choose_your_MPAA_system"),
                                                langs)]
            util.setting("mpaaLang", LANG_MPAA)
            util.settingBool("firstMpaaRun", False)

        if hidden:
            global HIDE_MPAA
            HIDE_MPAA = True

        movies = util.getMoviesWith('imdbnumber', 'mpaa')
        total = len(movies)

        if total > 0:
            self.startProcess(movies, total)
        else:
            util.dialogOk(
                l("Info"),
                l("The_video_library_is_empty_or_the_IMDb_id_doesn't_exist!"))

        return HIDE_MPAA
Exemple #3
0
################
# MPAA Update  #
# by semool    #
################

from util import l
from imdbmpaa import imdbMpaa
import util, httplib

HIDE_MPAA       = util.settingBool("hideMpaa")
LANG_MPAA       = util.setting("mpaaLang")
FORM_MPAA       = util.setting("mpaaPrefix")
CHANGED_PREFIX  = util.settingBool("enableMpaaPrefix")
FIRST_RUN       = util.settingBool("firstMpaaRun")

class Mpaa:
    def start(self, hidden=False):
        if FIRST_RUN:
            global LANG_MPAA
            langs = ["us", "de", "nl", "au"]
            LANG_MPAA = langs[util.dialogSelect(l("Choose_your_MPAA_system"), langs)]
            util.setting("mpaaLang", LANG_MPAA)
            util.settingBool("firstMpaaRun", False)

        if hidden:
            global HIDE_MPAA
            HIDE_MPAA = True

        movies = util.getMoviesWith('imdbnumber', 'mpaa')
        total = len(movies)
Exemple #4
0
################
# IMDB Update  #
# by Jandalf   #
################

import re, util
from BeautifulSoup import BeautifulSoup
from util import l

HIDE_TOP250  = util.settingBool("hideTop250")
OPEN_MISSING = util.settingBool("openMissingFile")

class Top250:
    def start(self, hidden=False):
        if hidden:
            global HIDE_TOP250
            HIDE_TOP250 = True

        if HIDE_TOP250:
            util.notification(l("Importing_current_IMDb_Top250"))
        else:
            self.progress = util.dialogProgress()
            self.progress.update(0, l("Importing_current_IMDb_Top250"))

        self.top250 = self.getTop250()
        self.notMissing = set()

        if self.top250 == {}:
            util.dialogOk(l("Top250"), l("There_was_a_problem_with_the_IMDb_site!"))
        else:
            movies = util.getMoviesWith('imdbnumber', 'top250')
################
# IMDB Update  #
# by Jandalf   #
################

import httplib, socket, json, util

RATING_DIFF = 0.001
ENABLE_DIFF = util.settingBool("enableDiff")
SEPARATOR = util.setting("separator").strip()

class imdbMovie(object):
    
    def __init__(self, imdbID, httphandler):
        self.__rating = ""
        self.__votes = ""
        self.__error = False
        self.__imdbID = imdbID
        
        self.getData(httphandler)

    def getData(self, httphandler):
        try:
            httphandler.request("GET", "/?i=%s" % self.__imdbID)
            response = httphandler.getresponse()
        except (httplib.HTTPException, socket.timeout, socket.gaierror, socket.error):
            self.__error = True
        else:
            if response.status == 200:
                try:
                    data = json.loads(response.read().decode('utf8'))
Exemple #6
0
################
# IMDB Update  #
# by Jandalf   #
################

from imdbMovie import imdbMovie
import util

HIDE_MOVIES = util.settingBool("hideMovies")
ENABLE_RESUME = util.settingBool("enableResume") and not(HIDE_MOVIES)

class Movies:
    def start(self, hidden=False):
        if hidden:
            global HIDE_MOVIES
            HIDE_MOVIES = True

        movies = util.getMoviesWith('imdbnumber', 'votes', 'rating')
        total = len(movies)

        if total > 0:
            self.startProcess(movies, total)
        else:
            util.dialogOk(util.l("Info"), util.l("The_video_library_is_empty_or_the_IMDb_id_doesn't_exist!"))

        return HIDE_MOVIES

    def getResume(self):
        wantResume = False
        if ENABLE_RESUME:
            try:
################
# IMDB Update  #
# by Jandalf   #
################

import urllib2, socket, json, util

RATING_DIFF = 0.001
ENABLE_DIFF = util.settingBool("enableDiff")
SEPARATOR = util.setting("separator").strip()


class imdbMovie(object):
    def __init__(self, imdbID):
        self.__rating = ""
        self.__votes = ""
        self.__error = False
        self.__imdbID = imdbID

        self.getData()

    def getData(self):
        try:
            url = "http://omdbapi.com/?i=%s" % self.__imdbID
            request = urllib2.Request(url)
            req = urllib2.urlopen(request)
        except:
            log('error response from github')
            self.__error = True
        else:
            try:
Exemple #8
0
################
# IMDB Update  #
# by Jandalf   #
################

import re, util
from BeautifulSoup import BeautifulSoup
from util import l

HIDE_TOP250 = util.settingBool("hideTop250")
OPEN_MISSING = util.settingBool("openMissingFile")


class Top250:
    def start(self, hidden=False):
        if hidden:
            global HIDE_TOP250
            HIDE_TOP250 = True

        if HIDE_TOP250:
            util.notification(l("Importing_current_IMDb_Top250"))
        else:
            self.progress = util.dialogProgress()
            self.progress.update(0, l("Importing_current_IMDb_Top250"))

        self.top250 = self.getTop250()
        self.notMissing = set()

        if self.top250 == {}:
            util.dialogOk(l("Top250"),
                          l("There_was_a_problem_with_the_IMDb_site!"))
################
# IMDB Update  #
# by Jandalf   #
################

import re, util
from BeautifulSoup import BeautifulSoup
from util import l

HIDE_TOP250 = util.settingBool("hideTop250")

class Top250:
    def start(self, hidden=False):
        if hidden:
            global HIDE_TOP250
            HIDE_TOP250 = True

        if HIDE_TOP250:
            util.notification(l("Importing_current_IMDb_Top250"))
        else:
            self.progress = util.dialogProgress()
            self.progress.update(0, l("Importing_current_IMDb_Top250"))

        self.top250 = self.getTop250()

        if self.top250 == {}:
            util.dialogOk(l("Top250"), l("There_was_a_problem_with_the_IMDb_site!"))
        else:
            movies = util.getMoviesWith('imdbnumber', 'top250')
            length = len(movies)
            if length > 0:
Exemple #10
0
################
# MPAA Update  #
# by semool    #
################

from util import l
from imdbmpaa import imdbMpaa
import util, httplib

HIDE_MPAA = util.settingBool("hideMpaa")
LANG_MPAA = util.setting("mpaaLang")
FORM_MPAA = util.setting("mpaaPrefix")
CHANGED_PREFIX = util.settingBool("enableMpaaPrefix")
FIRST_RUN = util.settingBool("firstMpaaRun")


class Mpaa:
    def start(self, hidden=False):
        if FIRST_RUN:
            global LANG_MPAA
            langs = ["us", "de", "nl", "au"]
            LANG_MPAA = langs[util.dialogSelect(l("Choose_your_MPAA_system"),
                                                langs)]
            util.setting("mpaaLang", LANG_MPAA)
            util.settingBool("firstMpaaRun", False)

        if hidden:
            global HIDE_MPAA
            HIDE_MPAA = True

        movies = util.getMoviesWith('imdbnumber', 'mpaa')