Пример #1
0
def update_service():
    # this read the settings
    settings = subscription.Settings()
    # define the browser
    browser = subscription.Browser()
    #Begin Service
    if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon,
                                                            settings.time_noti)
    list_url_search = []
    path = translatePath('special://temp')
    database = shelve.open(path + 'SUBSCRIPTION-PULSAR-RSS.db')
    rep = 0
    Dict_RSS = {}
    if database.has_key('dict'):
        Dict_RSS = database['dict']
    database.close()
    list_url_search = Dict_RSS.values()
    if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon,
                                                            settings.time_noti)
    # Begin reading
    for url_search in list_url_search:
        if url_search is not '':
            title_movie = []
            movie_ID = []
            title_show = []
            if settings.time_noti > 0: settings.dialog.notification(settings.name_provider,
                                        'Checking %s...' % url_search, settings.icon, settings.time_noti)
            acum = 0
            settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
            if browser.open(url_search):
                items = re.findall('<item>(.*?)</item>', browser.content, re.S)
                for item in items:
                    s_title = re.findall('title>(.*?)<', item)
                    s_link = re.findall('link>(.*?)<', item)
                    IMDB = re.search('TT[0-9]+', s_link[0] + ' #TT00', re.I).group(0)
                    if s_title[0] != '':
                        info = subscription.format_title(s_title[0])
                        if 'MOVIE' in info['type'] and 'TV Series' not in s_title[0]:
                            title_movie.append(s_title[0])
                            if 'TT00' not in IMDB:
                                movie_ID.append(IMDB)
                            acum += 1
                        if 'SHOW' in info['type'] or 'TV Series' in s_title[0]:
                            title_show.append(s_title[0].replace('TV Series', ''))
                            acum += 1
                if acum == 0:
                    if settings.time_noti > 0: settings.dialog.notification(settings.name_provider,
                                                                            'No Movies nor Shows!!', settings.icon,
                                                                            settings.time_noti)
                if len(title_movie) > 0:
                    subscription.integration(listing=title_movie, ID=movie_ID, type_list='MOVIE', silence=True,
                                             folder=settings.movie_folder, name_provider=settings.name_provider)
                if len(title_show) > 0:
                    subscription.integration(listing=title_show, ID=[], type_list='SHOW', folder=settings.show_folder,
                                             silence=True, name_provider=settings.name_provider)
            else:
                settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
                settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    del settings
    del browser
Пример #2
0
def update_service():
    # this read the settings
    settings = subscription.Settings()
    # define the browser
    browser = subscription.Browser()

    url_search = "http://www.filmaffinity.com/en/topcat_DVD_VID_US.html"
    listing = []
    ID = []  # IMDB_ID or thetvdb ID
    if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon,
                                                            settings.time_noti)
    settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
    if browser.open(url_search):
        data = browser.content.replace('</a>', '')
        listing = [item[1] for item in re.findall('<div class="mc-title">(.*?)>(.*?)<', data)]
        subscription.integration(listing, ID, 'MOVIE', settings.movie_folder, silence=True, name_provider=settings.name_provider)
    else:
        settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
        settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    del settings
    del browser
Пример #3
0
def update_service():
    # this read the settings
    settings = subscription.Settings()
    # define the browser
    browser = subscription.Browser()

    url_search = "http://www.flixster.com"
    listing = []
    ID = []  # IMDB_ID or thetvdb ID
    if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon,
                                                            settings.time_noti)
    settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
    if browser.open(url_search):
        data = browser.content
        data = data[data.find('Top DVD Rentals'):]  # narrow the file
        listing = re.findall('<div class="movie-title">(.*?)</div>', data)
        subscription.integration(listing, ID, 'MOVIE', settings.movie_folder, silence=True, name_provider=settings.name_provider)
    else:
        settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
        settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    del settings
    del browser
Пример #4
0
def update_service():
    # this read the settings
    settings = subscription.Settings()
    # define the browser
    browser = subscription.Browser()

    list = Addon().getSetting('list')
    if list != '':
        url_search = "http://www.listal.com/list/%s" % list
        listing = []
        ID = []  # IMDB_ID or thetvdb ID
        settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
        if browser.open(url_search):
            data = browser.content
            data = data.replace('</a></span>', '')
            for line in re.findall("style='font-weight:bold;font-size:110%;'>(.*?)>(.*?)</div>", data, re.S):
                listing.append(line[1].replace('\r', '').replace('\n', '').replace('\t', ''))
            subscription.integration(listing, ID, 'MOVIE', settings.movie_folder, silence=True, name_provider=settings.name_provider)
        else:
            settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
            settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    del settings
    del browser
                'Western Comedy': 'http://www.imdb.com/search/title?count=100&genres=western,comedy&num_votes=10000,&title_type=feature&ref_=gnr_mn_we_3',
                }
    options = genre.keys()
    options.sort()
    ret = settings.dialog.select('Choose a playlist', options)
    url_search = genre[options[ret]]
    listing = []
    ID = []  # IMDB_ID or thetvdb ID
    if browser.open(url_search):
        data = browser.content
        for line in re.findall('<span class="wlb_wrapper"(.*?)</div>',data, re.S):
            items = re.search('/title/(.*?)/(.*?)>(.*?)<', line)
            year = re.search('<span class="year_type">(.*?)<', line)
            ID.append(items.group(1))
            listing.append(items.group(3).replace('&#x27;', "'").replace('&#x26;', '&') + ' ' + year.group(1))
        subscription.integration(listing, ID, 'MOVIE', settings.movie_folder)
    else:
        print '[script.subscription.pulsar] %s' % browser.status
        settings.dialog.notification('Pulsar List integration',browser.status, settings.icon, 5000)

elif option == 1:
    #language
    language = {'Arabic': 'ar', 'Bulgarian': 'bg', 'Chinese': 'zh', 'Croatian': 'hr',
                'Dutch': 'nl', 'English': 'en', 'Finnish': 'fi', 'French': 'fr',
                'German': 'de','Greek': 'el', 'Hebrew': 'he', 'Hindi': 'hi',
                'Hungarian': 'hu', 'Icelandic': 'is', 'Italian': 'it', 'Japanese': 'ja',
                'Korean': 'ko', 'Norwegian': 'no', 'Persian': 'fa', 'Polish': 'pl',
                'Portuguese': 'pt', 'Punjabi': 'pa', 'Romanian': 'ro', 'Russian': 'ru',
                'Spanish': 'es', 'Swedish': 'sv', 'Turkish': 'tr', 'Ukrainian': 'uk',
                }
    options = language.keys()
Пример #6
0
# coding: utf-8
import re
import subscription

# this read the settings
settings = subscription.Settings()
# define the browser
browser = subscription.Browser()

url_search = "http://www.filmaffinity.com/en/topcat_DVD_VID_US.html"
listing = []
ID = []  # IMDB_ID or thetvdb ID
if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'Checking Online...', settings.icon, settings.time_noti)
settings.log('[%s]%s' % (settings.name_provider_clean, url_search))
if browser.open(url_search):
    data = browser.content.replace('</a>', '')
    listing =[item[1] for item in re.findall('<div class="mc-title">(.*?)>(.*?)<',data)]
    subscription.integration(listing, ID, 'MOVIE', settings.movie_folder, name_provider=settings.name_provider)
else:
    settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
    settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
del settings
del browser
    options.sort()
    ret = settings.dialog.select('Choose a playlist', options)
    url_search = genre[options[ret]]
    listing = []
    ID = []  # IMDB_ID or thetvdb ID
    if browser.open(url_search):
        data = browser.content
        for line in re.findall('<span class="wlb_wrapper"(.*?)</div>', data,
                               re.S):
            items = re.search('/title/(.*?)/(.*?)>(.*?)<', line)
            year = re.search('<span class="year_type">(.*?)<', line)
            ID.append(items.group(1))
            listing.append(
                items.group(3).replace('&#x27;', "'").replace('&#x26;', '&') +
                ' ' + year.group(1))
        subscription.integration(listing, ID, 'MOVIE', settings.movie_folder)
    else:
        print '[script.subscription.pulsar] %s' % browser.status
        settings.dialog.notification('Pulsar List integration', browser.status,
                                     settings.icon, 5000)

elif option == 1:
    #language
    language = {
        'Arabic': 'ar',
        'Bulgarian': 'bg',
        'Chinese': 'zh',
        'Croatian': 'hr',
        'Dutch': 'nl',
        'English': 'en',
        'Finnish': 'fi',
Пример #8
0
settings = subscription.Settings()
path = xbmc.translatePath('special://userdata')
if os.path.exists("%sfavourites.xml" % path):
    tree = ET.parse("%sfavourites.xml" % path)
    root = tree.getroot()

    # check movies
    listing = []
    ID = []
    for child in root:
        data = child.text
        if 'plugin://plugin.video.pulsar/movie/' in data:
            listing.append(child.attrib['name'])
            ID.append(re.search('plugin://plugin.video.pulsar/movie/(.*?)/', data).group(1))
    if len(listing) > 0:
        subscription.integration(listing, ID,'MOVIE', settings.movie_folder, True, name_provider=settings.name_provider, message='Single Movie List')

    # check movies sections
    cont = 0
    listing = []
    ID = []
    browser = subscription.Browser()
    for child in root:
        data = child.text.replace('"plugin://plugin.video.pulsar/movies/"', '')  # remove movies root
        if 'plugin://plugin.video.pulsar/movies/' in data:
            section = re.search('plugin://plugin.video.pulsar/movies/(.*?)"', data).group(1)
            # get the list of movies
            time.sleep(0.002)
            browser.open('http://localhost:65251/movies/%s' % section)
            data = json.loads(browser.content)
            for item in data['items']:
Пример #9
0
                        s_link = re.findall('link>(.*?)<', item)
                        IMDB = re.search('TT[0-9]+', s_link[0] + ' #TT00', re.I).group(0)
                        if s_title[0] != '':
                            info = subscription.format_title(s_title[0])
                            if 'MOVIE' in info['type'] and 'TV Series' not in s_title[0]:
                                title_movie.append(s_title[0])
                                if 'TT00' not in IMDB:
                                    movie_ID.append(IMDB)
                                acum += 1
                            if 'SHOW' in info['type'] or 'TV Series' in s_title[0]:
                                title_show.append(s_title[0].replace('TV Series', ''))
                                acum += 1
                    if acum == 0:
                        if settings.time_noti > 0: settings.dialog.notification(settings.name_provider, 'No Movies nor Shows!!', settings.icon, settings.time_noti)
                    if len(title_movie) > 0:
                        subscription.integration(listing=title_movie, ID=movie_ID, type_list='MOVIE', folder=settings.movie_folder, name_provider=settings.name_provider)
                    if len(title_show) > 0:
                        print title_show
                        subscription.integration(listing=title_show, ID=[], type_list='SHOW', folder=settings.show_folder, name_provider=settings.name_provider)
                else:
                    settings.log('[%s]>>>>>>>%s<<<<<<<' % (settings.name_provider_clean, browser.status))
                    settings.dialog.notification(settings.name_provider, browser.status, settings.icon, 1000)
    if rep == 5:  # Settings
        settings.settings.openSettings()
    if rep == 6:  # Help
        settings.dialog.ok("Help",
                           "Please, check this address to find the user's operation:\n[B]http://goo.gl/8nYU6R[/B]")

database.close()
del browser
del settings