The branch, eden has been updated
via a346919f6b3bb1dd571f31fd3f4bf014a68568f4 (commit)
from 0928ed4024257db87a4d4cb8c8957c7b4390fd1d (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=a346919f6b3bb1dd571f31fd3f4bf014a68568f4
commit a346919f6b3bb1dd571f31fd3f4bf014a68568f4
Author: Martijn Kaijser <[email protected]>
Date: Wed Jul 4 00:29:11 2012 +0200
[plugin.video.the.trailers] -v0.9.0
diff --git a/plugin.video.the.trailers/addon.py
b/plugin.video.the.trailers/addon.py
index c74337a..1bde826 100644
--- a/plugin.video.the.trailers/addon.py
+++ b/plugin.video.the.trailers/addon.py
@@ -1,43 +1,485 @@
-# main imports
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012 Tristan Fischer
+#
+# 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 3 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# system imports
import os
-import sys
-import xbmc
-import xbmcaddon
-__addon__ = xbmcaddon.Addon()
-__addonid__ = __addon__.getAddonInfo('id')
-__addonname__ = __addon__.getAddonInfo('name')
-__author__ = __addon__.getAddonInfo('author')
-__version__ = __addon__.getAddonInfo('version')
-__localize__ = __addon__.getLocalizedString
-__addonpath__ = __addon__.getAddonInfo('path')
-#Thanks to Nuka1195 for the original Apple Trailer plug-in
-
-# plugin constants
-__useragent__ = "QuickTime/7.6.5 (qtver=7.6.5;os=Windows NT 5.1Service Pack 3)"
-#__useragent__ = "iTunes/9.0.2 (Windows; Microsoft Windows XP Professional
Service Pack 3 (Build 2600)) AppleWebKit/531.21.8"
-
-
-
-
-if ( __name__ == "__main__" ):
- if ( not sys.argv[ 2 ] ):
- import resources.lib.trailers as plugin
- plugin.Main()
- elif ( sys.argv[ 2 ].startswith( "?category=" ) ):
- import resources.lib.trailers as plugin
- plugin.Main()
- elif ( sys.argv[ 2 ].startswith( "?showtimes=" ) ):
- import resources.lib.showtimes as showtimes
- s = showtimes.GUI( "plugin-AMTII-showtimes.xml",
xbmc.translatePath(__addonpath__), "default" )
- del s
- elif ( sys.argv[ 2 ].startswith( "?couchpotato=" ) ):
- import resources.lib.couchpotato as couchpotato
- couchpotato.Main()
- elif ( sys.argv[ 2 ].startswith( "?download=" ) ):
- import resources.lib.download as download
- download.Main()
- elif ( sys.argv[ 2 ].startswith( "?settings=" ) ):
- # open settings
- __addon__.openSettings()
- # refresh listing in case settings changed
- xbmc.executebuiltin( "Container.Refresh" )
+import urllib
+
+# xbmc imports
+from xbmcswift import Plugin, xbmc, xbmcplugin, xbmcgui, clean_dict, xbmcaddon
+import xbmcvfs
+import SimpleDownloader
+
+# addon imports
+from resources.lib.exceptions import *
+import resources.lib.apple_trailers as apple_trailers
+
+
+__addon_name__ = 'The Trailers'
+__id__ = 'plugin.video.the.trailers'
+
+THUMBNAIL_VIEW_IDS = {'skin.confluence': 500,
+ 'skin.aeon.nox': 551,
+ 'skin.confluence-vertical': 500,
+ 'skin.jx720': 52,
+ 'skin.pm3-hd': 53,
+ 'skin.rapier': 50,
+ 'skin.simplicity': 500,
+ 'skin.slik': 53,
+ 'skin.touched': 500,
+ 'skin.transparency': 53,
+ 'skin.xeebo': 55}
+
+SOURCES = [{'title': 'Apple Movie Trailers',
+ 'id': 'apple'}, ]
+
+STRINGS = {'show_movie_info': 30000,
+ 'open_settings': 30001,
+ 'browse_by': 30002,
+ 'genre': 30003,
+ 'download_trailer': 30004,
+ 'show_downloads': 30006,
+ 'add_to_cp': 30007,
+ 'neterror_title': 30100,
+ 'neterror_line1': 30101,
+ 'neterror_line2': 30102,
+ 'choose_trailer_type': 30120,
+ 'choose_trailer_quality': 30121,
+ 'no_download_path': 30130,
+ 'please_set_path': 30131,
+ 'downloading_trailer': 30061}
+
+
+class Plugin_mod(Plugin):
+
+ def add_items(self, iterable, is_update=False, sort_method_ids=[],
+ override_view_mode=False):
+ items = []
+ urls = []
+ for i, li_info in enumerate(iterable):
+ items.append(self._make_listitem(**li_info))
+ if self._mode in ['crawl', 'interactive', 'test']:
+ print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'),
+ '', li_info.get('url'))
+ urls.append(li_info.get('url'))
+ if self._mode is 'xbmc':
+ if override_view_mode:
+ skin = xbmc.getSkinDir()
+ thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin)
+ if thumbnail_view:
+ cmd = 'Container.SetViewMode(%s)' % thumbnail_view
+ xbmc.executebuiltin(cmd)
+ xbmcplugin.addDirectoryItems(self.handle, items, len(items))
+ for id in sort_method_ids:
+ xbmcplugin.addSortMethod(self.handle, id)
+ xbmcplugin.endOfDirectory(self.handle, updateListing=is_update)
+ return urls
+
+ def _make_listitem(self, label, label2='', iconImage='', thumbnail='',
+ path='', **options):
+ li = xbmcgui.ListItem(label, label2=label2, iconImage=iconImage,
+ thumbnailImage=thumbnail, path=path)
+ cleaned_info = clean_dict(options.get('info'))
+ if cleaned_info:
+ li.setInfo('video', cleaned_info)
+ if options.get('is_playable'):
+ li.setProperty('IsPlayable', 'true')
+ if options.get('context_menu'):
+ li.addContextMenuItems(options['context_menu'], replaceItems=True)
+ return options['url'], li, options.get('is_folder', True)
+
+plugin = Plugin_mod(__addon_name__, __id__, __file__)
+
+
[email protected]('/', default=True)
+def show_sources():
+ __log('show_sources')
+ if len(SOURCES) == 1:
+ __log('show_sources redirecting to show_all_movies')
+ url = plugin.url_for('show_all_movies',
+ source_id=SOURCES[0]['id'])
+ return plugin.redirect(url)
+ else:
+ items = [{'label': i['title'],
+ 'url': plugin.url_for('show_all_movies',
+ source_id=i['id'])}
+ for i in SOURCES]
+ return plugin.add_items(items)
+
+
[email protected]('/<source_id>/movies/')
+def show_all_movies(source_id):
+ __log('show_all_movies started with source_id=%s' % source_id)
+ source = __get_source(source_id)
+ items = source.get_movies()
+ return __add_movies(source_id, items)
+
+
[email protected]('/<source_id>/movies/<filter_criteria>/')
+def show_filter_content(source_id, filter_criteria):
+ __log('show_filter_content started with source_id=%s filter_criteria=%s'
+ % (source_id, filter_criteria))
+ source = __get_source(source_id)
+ items = [{'label': i['title'],
+ 'url': plugin.url_for('show_filtered_movies',
+ source_id=source_id,
+ filter_criteria=filter_criteria,
+ filter_content=i['id'])}
+ for i in source.get_filter_content(filter_criteria)]
+ return plugin.add_items(items)
+
+
[email protected]('/<source_id>/movies/<filter_criteria>/<filter_content>/')
+def show_filtered_movies(source_id, filter_criteria, filter_content):
+ __log(('show_filtered_movies started with source_id=%s '
+ 'filter_criteria=%s filter_content=%s')
+ % (source_id, filter_criteria, filter_content))
+ source = __get_source(source_id)
+ if filter_criteria != 'all' and filter_content != 'all':
+ items = source.get_movies(filters={filter_criteria: filter_content})
+ else:
+ items = source.get_movies()
+ return __add_movies(source_id, items)
+
+
[email protected]('/<source_id>/trailer/<movie_title>/play',
+ mode='play', name='play_trailer')
[email protected]('/<source_id>/trailer/<movie_title>/download',
+ mode='download', name='download_trailer')
+def get_trailer(source_id, movie_title, mode):
+ __log('get_trailer started with mode=%s source_id=%s movie_title=%s '
+ % (mode, source_id, movie_title))
+ is_download = mode == 'download'
+ try:
+ local_path, remote_url, trailer_id = __select_check_trailer(
+ source_id, movie_title, is_download=is_download,
+ )
+ except NoDownloadPath:
+ xbmcgui.Dialog().ok(_('no_download_path'),
+ _('no_download_path'))
+ except (NoQualitySelected, NoTrailerSelected):
+ return
+
+ if mode == 'play':
+ if plugin.get_setting('playback_mode') == '0':
+ # stream
+ return play_trailer(local_path, remote_url)
+ elif plugin.get_setting('playback_mode') == '1':
+ # download+play
+ return download_play_trailer(local_path, remote_url, trailer_id)
+
+ elif mode == 'download':
+ # download in background
+ return download_trailer(local_path, remote_url, trailer_id)
+
+
+def ask_trailer_type(source, movie_title):
+ # if the user wants to be asked, show the select dialog
+ if plugin.get_setting('ask_trailer') == 'true':
+ trailer_types = source.get_trailer_types(movie_title)
+ # is there more than one trailer_types, ask
+ if len(trailer_types) > 1:
+ dialog = xbmcgui.Dialog()
+ selected = dialog.select(_('choose_trailer_type'),
+ [t['title'] for t in trailer_types])
+ # if the user canceled the dialog, raise
+ if selected == -1:
+ raise NoTrailerSelected
+ # there is only one trailer_type, don't ask and choose it
+ else:
+ selected = 0
+ return trailer_types[selected]['id']
+ # the user doesnt want to be asked, let the scraper choose the most recent
+ else:
+ return 'trailer'
+
+
+def ask_trailer_quality(source, movie_title):
+ trailer_qualities = source.get_trailer_qualities(movie_title)
+ # if the user wants to be asked the quality, show the dialog
+ if plugin.get_setting('ask_quality') == 'true':
+ # if there are more than one trailer qualities, ask
+ if len(trailer_qualities) > 1:
+ dialog = xbmcgui.Dialog()
+ selected = dialog.select(_('choose_trailer_quality'),
+ [t['title'] for t in trailer_qualities])
+ # if the user canceled the dialog, raise
+ if selected == -1:
+ raise NoQualitySelected
+ # there is only one trailer quality, don't ask and choose it
+ else:
+ selected = 0
+ # the user doesnt want to be asked, choose from settings
+ else:
+ selected = int(plugin.get_setting('trailer_quality'))
+ return trailer_qualities[selected]['id']
+
+
+def play_trailer(local_path, remote_url):
+ # if remote_url is None, trailer is already downloaded - play local one
+ trailer_url = remote_url or local_path
+ return plugin.set_resolved_url(trailer_url)
+
+
+def download_play_trailer(local_path, remote_url, trailer_id):
+ # if remote_url is None, trailer is already downloaded - play it
+ if not remote_url:
+ return plugin.set_resolved_url(local_path)
+
+ # we need to sleep before creating progress dialog
+ xbmc.sleep(500)
+ # create progress dialog
+ pDialog = xbmcgui.DialogProgress()
+ pDialog.create(__addon_name__)
+ pDialog.update(0)
+
+ # if there is a useragent set in the url, split it for urllib downloading
+ if '?|User-Agent=' in remote_url:
+ remote_url, useragent = remote_url.split('?|User-Agent=')
+ __log('detected useragent:"%s"' % useragent)
+
+ class _urlopener(urllib.URLopener):
+ version = useragent
+ urllib._urlopener = _urlopener()
+
+
+ # split filename from local_path for dialog line
+ download_path, filename = os.path.split(local_path)
+ tmppath = os.path.join(
+ xbmc.translatePath(plugin._plugin.getAddonInfo('profile')),
+ filename,
+ ).decode('utf-8')
+
+ # TODO: change text to downloading and add the amt download speed/time?
+ def _report_hook(count, blocksize, totalsize):
+ percent = int(float(count * blocksize * 100) / totalsize)
+ msg1 = _('downloading_trailer')
+ msg2 = filename
+ if pDialog.iscanceled():
+ # raise KeyboardInterrupt to stop download in progress
+ raise KeyboardInterrupt
+ pDialog.update(percent, msg1, msg2)
+
+ __log('start downloading: %s to path: %s' % (filename, download_path))
+ try:
+ if not urllib.urlretrieve(remote_url, tmppath, _report_hook):
+ __log('downloading failed')
+ xbmcvfs.delete(tmppath)
+ pDialog.close()
+ return
+ # catch KeyboardInterrupt which was rised to stop the dl silently
+ except KeyboardInterrupt:
+ __log('downloading canceled')
+ xbmcvfs.delete(tmppath)
+ pDialog.close()
+ return
+ xbmc.sleep(100)
+ __log('downloading successfully completed, start moving')
+ xbmcvfs.copy(tmppath, local_path)
+ xbmcvfs.delete(tmppath)
+ __log('moving completed')
+ pDialog.close()
+ plugin.set_setting(trailer_id, local_path)
+ __log('start playback')
+ return plugin.set_resolved_url(local_path)
+
+
+def download_trailer(local_path, remote_url, trailer_id):
+ # if remote_url is None, trailer is already downloaded, do nothing
+ if not remote_url:
+ return
+ sd = SimpleDownloader.SimpleDownloader()
+ if '?|User-Agent=' in remote_url:
+ remote_url, useragent = remote_url.split('?|User-Agent=')
+ # Override User-Agent because SimpleDownloader doesn't support that
+ # native. Downloading from apple requires QT User-Agent
+ sd.common.USERAGENT = useragent
+ download_path, filename = os.path.split(local_path)
+ params = {'url': remote_url,
+ 'download_path': download_path}
+ # start the download in background
+ sd.download(filename, params)
+ # set the setting - if the download is not finished but playback is tried,
+ # the check isfile will fail and it won't be there before finish
+ plugin.set_setting(trailer_id, local_path)
+ __log('start downloading: %s to path: %s' % (filename, download_path))
+
+
[email protected]('/add_to_couchpotato/<movie_title>')
+def add_to_couchpotato(movie_title):
+ __log('add_to_couchpotato started with movie_title=%s' % movie_title)
+ import resources.lib.couchpotato as couchpotato
+ couchpotato.Main()
+ return
+
+
[email protected]('/settings/')
+def open_settings():
+ __log('open_settings started')
+ plugin.open_settings()
+
+
+def __add_movies(source_id, entries):
+ __log('__add_movies start')
+ items = []
+ filter_criteria = __get_source(source_id).get_filter_criteria()
+ for e in entries:
+ movie = __format_movie(e)
+ movie['context_menu'] = __movie_cm_entries(source_id,
+ e['title'],
+ filter_criteria)
+ movie['url'] = plugin.url_for('play_trailer',
+ source_id=source_id,
+ movie_title=movie['label'])
+ items.append(movie)
+ sort_methods = [xbmcplugin.SORT_METHOD_DATE,
+ xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE]
+ force_viewmode = plugin.get_setting('force_viewmode') == 'true'
+ __log('__add_movies end')
+ return plugin.add_items(items, sort_method_ids=sort_methods,
+ override_view_mode=force_viewmode)
+
+
+def __format_movie(m):
+ return {'label': m['title'],
+ 'is_playable': True,
+ 'is_folder': False,
+ 'iconImage': m.get('thumb', 'DefaultVideo.png'),
+ 'info': {'title': m.get('title'),
+ 'duration': m.get('duration', '0:00'),
+ 'size': int(m.get('size', 0)),
+ 'mpaa': m.get('mpaa', ''),
+ 'plot': m.get('plot', ''),
+ 'cast': m.get('cast', []),
+ 'genre': ', '.join(m.get('genre', [])),
+ 'studio': m.get('studio', ''),
+ 'date': m.get('post_date', ''),
+ 'premiered': m.get('release_date', ''),
+ 'year': int(m.get('year', 0)),
+ 'rating': float(m.get('rating', 0.0)),
+ 'director': m.get('director', ''),
+ },
+ }
+
+
+def __get_source(source_id):
+ cache_path = os.path.join(
+ xbmc.translatePath(plugin._plugin.getAddonInfo('profile')),
+ 'cache',
+ )
+ if not os.path.isdir(cache_path):
+ os.makedirs(cache_path)
+ if source_id == 'apple':
+ __log('__get_source using: %s' % source_id)
+ source = apple_trailers.AppleTrailers(cache_path)
+ return source
+ else:
+ raise Exception('UNKNOWN SOURCE: %s' % source_id)
+
+
+def __movie_cm_entries(source_id, movie_title, filter_criteria):
+ download_url = plugin.url_for('download_trailer',
+ source_id=source_id,
+ movie_title=movie_title)
+ show_settings_url = plugin.url_for('open_settings')
+ cm_entries = [
+ (_('show_movie_info'), 'XBMC.Action(Info)'),
+ (_('download_trailer'), 'XBMC.RunPlugin(%s)' % download_url),
+ ]
+ if plugin.get_setting('cp_enable') == 'true':
+ couchpotato_url = plugin.url_for('add_to_couchpotato',
+ movie_title=movie_title)
+ cm_entries.append(
+ (_('add_to_cp'), 'XBMC.RunPlugin(%s)' % couchpotato_url),
+ )
+ for fc in filter_criteria:
+ url = plugin.url_for('show_filter_content',
+ source_id=source_id,
+ filter_criteria=fc['id'])
+ cm_entries.append(
+ (_('browse_by') % fc['title'], 'XBMC.Container.Update(%s)' % url),
+ )
+ cm_entries.extend((
+ (_('show_downloads'), 'XBMC.Container.Update(%s)' % ''), # fixme
+ (_('open_settings'), 'XBMC.Container.Update(%s)' % show_settings_url),
+ ))
+ return cm_entries
+
+
+def __select_check_trailer(source_id, movie_title, is_download):
+ __log(('__select_check_trailer started with source_id=%s movie_title=%s '
+ 'is_download=%s') % (source_id, movie_title, is_download))
+ source = __get_source(source_id)
+ trailer_type = ask_trailer_type(source, movie_title)
+
+ # check if there is already a downloaded trailer in download_quality
+ q_id = int(plugin.get_setting('trailer_quality_download'))
+ trailer_quality = source.get_trailer_qualities(movie_title)[q_id]['id']
+ download_trailer_id = '|'.join(
+ (source_id, movie_title, trailer_type, trailer_quality),
+ )
+ local_path = plugin.get_setting(download_trailer_id)
+ if local_path and xbmcvfs.exists(local_path):
+ # there is a already downloaded trailer, signal with empty remote_url
+ __log('trailer already downloaded, using downloaded version')
+ remote_url = None
+ else:
+ # there is no already downloaded trailer
+ if not is_download:
+ # on play (and not download) the quality may differ
+ trailer_quality = ask_trailer_quality(source, movie_title)
+ if not plugin.get_setting('trailer_download_path'):
+ xbmcgui.Dialog().ok(_('no_download_path'),
+ _('please_set_path'))
+ plugin.open_settings()
+ download_path = plugin.get_setting('trailer_download_path')
+ if not download_path:
+ __log('still no download_path set - aborting')
+ raise NoDownloadPath
+ safe_chars = ('-_. abcdefghijklmnopqrstuvwxyz'
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
+ safe_title = ''.join([c for c in movie_title if c in safe_chars])
+ filename = '%s-%s-%s' % (safe_title, trailer_type, trailer_quality)
+ local_path = os.path.join(download_path, filename)
+ remote_url = source.get_trailer(movie_title, trailer_quality,
+ trailer_type)
+ return (local_path, remote_url, download_trailer_id)
+
+
+def _(s):
+ s_id = STRINGS.get(s)
+ if s_id:
+ return plugin.get_string(s_id)
+ else:
+ return s
+
+
+def __log(text):
+ xbmc.log('%s addon: %s' % (__addon_name__, text))
+
+
+if __name__ == '__main__':
+ try:
+ plugin.set_content('movies')
+ plugin.run()
+ except NetworkError as e:
+ __log('NetworkError: %s' % e)
+ xbmcgui.Dialog().ok(_('neterror_title'),
+ _('neterror_line1'),
+ _('neterror_line2'))
\ No newline at end of file
diff --git a/plugin.video.the.trailers/addon.xml
b/plugin.video.the.trailers/addon.xml
index 5a5536e..617ff65 100644
--- a/plugin.video.the.trailers/addon.xml
+++ b/plugin.video.the.trailers/addon.xml
@@ -2,17 +2,19 @@
<addon
id="plugin.video.the.trailers"
name="The Trailers"
- version="0.1.2"
- provider-name="Martijn (orginal: nuka1195)">
- <!-- Code taken from AMT-L and original creator ="nuka1195" -->
+ version="0.9.0"
+ provider-name="Martijn, Sphere">
<requires>
- <import addon="xbmc.python" version="2.0"/>
- <import addon="script.module.elementtree" version="1.2.7"/>
+ <import addon="xbmc.python" version="2.0"/>
+ <import addon="script.module.xbmcswift" version="0.2.0"/>
+ <import addon="script.module.beautifulsoup" version="3.0.8"/>
+ <import addon="script.module.simple.downloader" version="0.9.2"/>
</requires>
- <extension point="xbmc.python.pluginsource" library="addon.py">
+ <extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
+ <language></language>
<platform>all</platform>
<summary lang="en">Watch movie trailers</summary>
<description lang="en">Watch current movie trailers from[CR]-
http://trailers.apple.com[CR]</description>
diff --git a/plugin.video.the.trailers/changelog.txt
b/plugin.video.the.trailers/changelog.txt
index 372cb3d..956ba0f 100644
--- a/plugin.video.the.trailers/changelog.txt
+++ b/plugin.video.the.trailers/changelog.txt
@@ -1,12 +1 @@
-[B]0.1.2[/B]
-- Fixed: Removed redundant print statement which caused problems
-
-[B]0.1.1[/B]
-- Changed: Better looking icon.png (thx Jeroen)
-- Changed: Matching background
-- Changed: Make password field 'hidden'
-
-[B]0.1.0[/B]
-- Fixed: Now scrape latest movies again
-- Fixed: Download and save works again
-- Orginal plug-in by nuka1195
\ No newline at end of file
+unreleased
\ No newline at end of file
diff --git a/plugin.video.the.trailers/resources/__init__.py
b/plugin.video.the.trailers/resources/__init__.py
index b93054b..e69de29 100644
--- a/plugin.video.the.trailers/resources/__init__.py
+++ b/plugin.video.the.trailers/resources/__init__.py
@@ -1 +0,0 @@
-# Dummy file to make this directory a package.
diff --git a/plugin.video.the.trailers/resources/language/English/strings.xml
b/plugin.video.the.trailers/resources/language/English/strings.xml
index f76e125..09fd226 100644
--- a/plugin.video.the.trailers/resources/language/English/strings.xml
+++ b/plugin.video.the.trailers/resources/language/English/strings.xml
@@ -1,39 +1,44 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
- <!-- settings labels -->
- <string id="30100">Preferred trailer resolution</string>
- <string id="30101">Standard</string>
- <string id="30102">480p</string>
- <string id="30103">720p</string>
- <string id="30104">1080p</string>
- <string id="30110">Use large poster</string>
- <string id="30120">MPAA rating limit for trailers</string>
- <string id="30130">Play mode</string>
- <string id="30131">Stream</string>
- <string id="30132">Download</string>
- <string id="30133">Download & Save</string>
- <string id="30140">Save folder</string>
- <string id="30150">Zip/Post Code or City, State</string>
- <string id="30160">Scraper</string>
- <string id="30170">Day to list movies for</string>
- <string id="30171">Today</string>
- <string id="30172">Tomorrow</string>
- <string id="30173">Day 3</string>
- <string id="30174">Day 4</string>
- <string id="30175">Day 5</string>
- <string id="30176">Day 6</string>
- <string id="30177">Day 7</string>
- <string id="30178">Day 8</string>
- <string id="30180">Use trailer title for filename</string>
- <string id="30190">Fanart image</string>
- <string id="30200">Always play saved trailers</string>
- <string id="30210">Add '-trailer' to filename</string>
- <string id="30220">Create NFO files for saved trailers</string>
- <string id="30230">MPAA rating for unrated trailers</string>
- <string id="30240">Only 720p/1080p trailers</string>
- <string id="30250">Copy thumb with saved trailer</string>
-
- <!-- couchpotato integration settings -->
+ <!-- Context menu entries -->
+ <string id="30000">Show Movie Info</string>
+ <string id="30001">Add-on settings</string>
+ <string id="30002">Browse by %s</string>
+ <string id="30003">genre</string>
+ <string id="30004">Download</string>
+ <string id="30006">Show Downloads</string>
+ <string id="30007">Add to CouchPotato</string>
+ <!-- Settings -->
+ <string id="30010">Ask for trailer quality (stream)</string>
+ <string id="30011">Ask for trailer type (Trailer, Teaser, Clip)</string>
+ <string id="30012">General</string>
+ <string id="30013">Playback Mode</string>
+ <string id="30014">Stream</string>
+ <string id="30015">Download & Play</string>
+ <string id="30016">Playback</string>
+ <string id="30017">Download</string>
+ <string id="30018">Download & Play uses stream quality</string>
+ <string id="30020">Force ViewMode to Thumbnail</string>
+ <string id="30030">Trailer quality (stream)</string>
+ <string id="30031">iPod</string>
+ <string id="30035">HD480p</string>
+ <string id="30036">HD720p</string>
+ <string id="30037">HD1080p</string>
+ <string id="30040">Trailer quality (download)</string>
+ <string id="30050">Trailer download path</string>
+ <!-- Message Dialogs -->
+ <string id="30061">Downloading Trailer</string>
+ <!-- Network Error -->
+ <string id="30100">Network Error</string>
+ <string id="30101">Please check your internet connection</string>
+ <string id="30102">and proxy Settings</string>
+ <!-- Select Dialogs -->
+ <string id="30120">Choose Trailer Type</string>
+ <string id="30121">Choose Trailer Quality</string>
+ <!-- OK Dialogs -->
+ <string id="30130">No download path</string>
+ <string id="30131">Please set download path</string>
+ <!-- Couch Potato -->
<string id="30260">Enable Couch Potato integration</string>
<string id="30261">User name</string>
<string id="30262">Password</string>
@@ -41,51 +46,4 @@
<string id="30264">Port</string>
<string id="30265">Use HTTPS</string>
<string id="30266">Couch Potato</string>
- <string id="30267">Add to Couch Potato</string>
-
- <!-- category & label separators -->
- <string id="30300">General</string>
- <string id="30301">Showtimes</string>
- <string id="30302">Skinning</string>
-
- <string id="30320">Resolution</string>
- <string id="30321">Location</string>
- <string id="30322">Fanart Preferences</string>
- <string id="30323">Rating Limit</string>
- <string id="30324">Playback</string>
- <string id="30325">Scraper</string>
-
- <!-- mpaa ratings -->
- <string id="30400">G</string>
- <string id="30401">PG</string>
- <string id="30402">PG-13</string>
- <string id="30403">R</string>
- <string id="30404">NC-17</string>
- <string id="30405">No Limit</string>
-
- <!-- messages -->
- <string id="30500">Downloading: %s</string>
- <string id="30501">Saving: %s</string>
- <string id="30502">To: %s</string>
- <string id="30503">Copying: %s</string>
-
- <!-- showtimes -->
- <string id="30600">No showtimes found!</string>
- <string id="30601">Finding showtimes, please wait...</string>
- <string id="30602">Date</string>
- <string id="30603">Location</string>
- <string id="30604">ERROR: No theater list found! [I](Possible site
changes)[/I]</string>
-
- <!-- PluginCategory infolabel -->
- <string id="30800">Standard videos</string>
- <string id="30801">480p videos</string>
- <string id="30802">720p videos</string>
- <string id="30803">1080p videos</string>
-
- <!-- context menu labels -->
- <string id="30900">Theater Showtimes</string>
- <string id="30910">Download & Play Trailer</string>
- <string id="30920">Play Trailer</string>
- <string id="30930">Movie Information</string>
-
</strings>
\ No newline at end of file
diff --git a/plugin.video.the.trailers/resources/lib/__init__.py
b/plugin.video.the.trailers/resources/lib/__init__.py
index b93054b..e69de29 100644
--- a/plugin.video.the.trailers/resources/lib/__init__.py
+++ b/plugin.video.the.trailers/resources/lib/__init__.py
@@ -1 +0,0 @@
-# Dummy file to make this directory a package.
diff --git a/plugin.video.the.trailers/resources/lib/couchpotato.py
b/plugin.video.the.trailers/resources/lib/couchpotato.py
index 55b9252..b54008e 100644
--- a/plugin.video.the.trailers/resources/lib/couchpotato.py
+++ b/plugin.video.the.trailers/resources/lib/couchpotato.py
@@ -133,6 +133,7 @@ class Main:
postdata = urllib.urlencode( values )
cp_search_url = self.cp_url + "search/"
request = urllib2.Request( cp_search_url, postdata )
+ self.movies = ''
try:
response = urllib2.urlopen( request )
parser=self._cp_search_result_parser()
diff --git a/plugin.video.the.trailers/resources/settings.xml
b/plugin.video.the.trailers/resources/settings.xml
index 70505c3..8439718 100644
--- a/plugin.video.the.trailers/resources/settings.xml
+++ b/plugin.video.the.trailers/resources/settings.xml
@@ -1,38 +1,27 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
- <category label="30300" id="section_general">
- <setting label="30320" type="lsep" />
- <setting label="30100" type="enum" id="trailer_quality" default="0"
lvalues="30101|30102|30103|30104" />
- <setting label="30240" type="bool" id="trailer_hd_only"
default="false" enable="gt(-1,1)" subsetting="true"/>
- <setting label="30323" type="lsep" />
- <setting label="30120" type="enum" id="rating" default="5"
lvalues="30400|30401|30402|30403|30404|30405" subsetting="true"/>
- <setting label="30230" type="enum" id="not_rated_rating" default="2"
lvalues="30400|30401|30402|30403|30404" enable="!eq(-1,5)" subsetting="true"/>
- <setting label="30190" type="image" id="fanart_image" default=""
source="auto" visible="false"/>
+ <category label="30012" id="section_general">
+ <setting id="force_viewmode" type="bool" label="30020"
default="false"/>
</category>
- <category label="30324" id="section_playback">
- <setting label="30130" type="enum" id="play_mode" default="0"
lvalues="30131|30132|30133" />
- <setting label="30140" type="folder" id="download_path" default=""
source="auto" option="writeable" enable="eq(-1,2)" subsetting="true"/>
- <setting label="30180" type="bool" id="use_title" default="true"
enable="eq(-2,2) + !eq(-1,)" subsetting="true"/>
- <setting label="30210" type="bool" id="use_trailer" default="true"
enable="eq(-3,2) + !eq(-2,)" subsetting="true"/>
- <setting label="30220" type="bool" id="create_nfo" default="true"
enable="eq(-4,2) + !eq(-3,)" subsetting="true"/>
- <setting label="30250" type="bool" id="copy_thumb" default="true"
enable="eq(-5,2) + !eq(-4,)" subsetting="true"/>
- <setting label="30200" type="bool" id="play_existing" default="true"
enable="eq(-6,2) + !eq(-5,)" subsetting="true"/>
+ <category label="30016" id="playback">
+ <setting id="ask_trailer" type="bool" label="30011" default="true"/>
+ <setting id="ask_quality" type="bool" label="30010" default="false"/>
+ <setting id="trailer_quality" type="enum" label="30030"
enable="!eq(-1,true)" default="1" lvalues="30031|30035|30036|30037"/>
+ <setting type="lsep" />
+ <setting id="playback_mode" type="enum" label="30013" default="0"
lvalues="30014|30015"/>
+ <setting id="trailer_download_path" type="folder" label="30050"
source="auto" option="writeable" visible="eq(-1,1)" subsetting="true"/>
+ <setting type="lsep" label="30018" subsetting="true"
visible="eq(-2,1)"/>
</category>
- <!--
- <category label="30301" id="section_showtimes">
- <setting label="30321" type="lsep" />
- <setting label="30150" type="text" id="local" default="90210" />
- <setting label="30325" type="lsep" />
- <setting label="30160" type="fileenum" id="scraper" default="Google"
mask="/" values="/resources/scrapers/" enable="!eq(-2,)" />
- <setting label="30170" type="enum" id="day" default="0"
lvalues="30171|30172|30173|30174|30175|30176|30177|30178" enable="!eq(-3,)" />
+ <category label="30017" id="download">
+ <setting id="trailer_quality_download" type="enum" label="30040"
default="3" lvalues="30031|30035|30036|30037"/>
+ <setting id="trailer_download_path" type="folder" label="30050"
source="auto" option="writeable"/>
</category>
- -->
<category label="30266" id="section_couchpotato">
<setting label="30260" type="bool" id="cp_enable" default="false" />
- <setting label="30263" type="text" id="cp_server" default="localhost"
enable="eq(-1,true)" />
- <setting label="30264" type="text" id="cp_port" default="5000"
enable="eq(-2,true)" />
- <setting label="30265" type="bool" id="cp_use_https" default="false"
enable="eq(-3,true)" />
- <setting label="30261" type="text" id="cp_user" default=""
enable="eq(-4,true)" />
- <setting label="30262" type="text" id="cp_password" default=""
enable="eq(-5,true) + !eq(-1,)" option="hidden"/>
+ <setting label="30263" type="text" id="cp_server" default="localhost"
visible="eq(-1,true)"/>
+ <setting label="30264" type="text" id="cp_port" default="5000"
visible="eq(-2,true)"/>
+ <setting label="30265" type="bool" id="cp_use_https" default="false"
visible="eq(-3,true)"/>
+ <setting label="30261" type="text" id="cp_user" default=""
visible="eq(-4,true)"/>
+ <setting label="30262" type="text" id="cp_password" default=""
enable="!eq(-1,)" visible="eq(-5,true)" option="hidden"/>
</category>
-</settings>
+</settings>
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
plugin.video.the.trailers/addon.py | 526 ++++++++++++++++++--
plugin.video.the.trailers/addon.xml | 14 +-
plugin.video.the.trailers/changelog.txt | 13 +-
plugin.video.the.trailers/resources/__init__.py | 1 -
.../resources/images/cp_add.png | Bin 1101 -> 0 bytes
.../resources/language/English/strings.xml | 120 ++---
.../resources/language/German/strings.xml | 90 ----
.../resources/language/Hungarian/strings.xml | 91 ----
.../resources/lib/MediaWindow.py | 132 -----
.../resources/lib/__init__.py | 1 -
.../resources/lib/apple_trailers.py | 234 +++++++++
.../resources/lib/couchpotato.py | 1 +
.../resources/lib/download.py | 238 ---------
.../resources/lib/exceptions.py | 21 +
.../resources/lib/script_exceptions.py | 18 -
.../resources/lib/showtimes.py | 188 -------
.../resources/lib/trailers.py | 420 ----------------
plugin.video.the.trailers/resources/lib/utils.py | 212 --------
.../resources/scrapers/Google/__init__.py | 1 -
.../resources/scrapers/Google/showtimesScraper.py | 267 ----------
.../resources/scrapers/__init__.py | 1 -
plugin.video.the.trailers/resources/settings.xml | 49 +--
.../skins/default/720p/plugin-AMTII-showtimes.xml | 263 ----------
.../skins/default/media/Showtimes-DialogBack.png | Bin 35982 -> 0 bytes
.../default/media/Showtimes-GlassTitleBar.png | Bin 8023 -> 0 bytes
.../skins/default/media/Showtimes-MenuItemFO.png | Bin 24951 -> 0 bytes
.../skins/default/media/Showtimes-MenuItemNF.png | Bin 3173 -> 0 bytes
.../skins/default/media/Showtimes-Poster.png | Bin 42536 -> 0 bytes
.../skins/default/media/showtimes-ticket.png | Bin 4012 -> 0 bytes
29 files changed, 807 insertions(+), 2094 deletions(-)
delete mode 100644 plugin.video.the.trailers/resources/images/cp_add.png
delete mode 100644
plugin.video.the.trailers/resources/language/German/strings.xml
delete mode 100644
plugin.video.the.trailers/resources/language/Hungarian/strings.xml
delete mode 100644 plugin.video.the.trailers/resources/lib/MediaWindow.py
create mode 100644 plugin.video.the.trailers/resources/lib/apple_trailers.py
delete mode 100644 plugin.video.the.trailers/resources/lib/download.py
create mode 100644 plugin.video.the.trailers/resources/lib/exceptions.py
delete mode 100644 plugin.video.the.trailers/resources/lib/script_exceptions.py
delete mode 100644 plugin.video.the.trailers/resources/lib/showtimes.py
delete mode 100644 plugin.video.the.trailers/resources/lib/trailers.py
delete mode 100644 plugin.video.the.trailers/resources/lib/utils.py
delete mode 100644
plugin.video.the.trailers/resources/scrapers/Google/__init__.py
delete mode 100644
plugin.video.the.trailers/resources/scrapers/Google/showtimesScraper.py
delete mode 100644 plugin.video.the.trailers/resources/scrapers/__init__.py
delete mode 100644
plugin.video.the.trailers/resources/skins/default/720p/plugin-AMTII-showtimes.xml
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/Showtimes-DialogBack.png
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/Showtimes-GlassTitleBar.png
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/Showtimes-MenuItemFO.png
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/Showtimes-MenuItemNF.png
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/Showtimes-Poster.png
delete mode 100644
plugin.video.the.trailers/resources/skins/default/media/showtimes-ticket.png
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons