The branch, frodo has been updated
via 27dddc48e553449a9e011580b78c78b02fe9a20c (commit)
via 24370ed2b966a7c7f5ef995aec8f4fada5a2d958 (commit)
from 1d27a1979df88ed7d01de6843c505b52d0602445 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=27dddc48e553449a9e011580b78c78b02fe9a20c
commit 27dddc48e553449a9e011580b78c78b02fe9a20c
Author: Martijn Kaijser <[email protected]>
Date: Sun Sep 7 14:45:29 2014 +0200
[plugin.video.filmsforaction] 1.0.5
diff --git a/plugin.video.filmsforaction/addon.xml
b/plugin.video.filmsforaction/addon.xml
index 705f193..4a4d799 100644
--- a/plugin.video.filmsforaction/addon.xml
+++ b/plugin.video.filmsforaction/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.filmsforaction" name="Films For Action"
version="1.0.4" provider-name="Jose Antonio Montes (jamontes)">
+<addon id="plugin.video.filmsforaction" name="Films For Action"
version="1.0.5" provider-name="Jose Antonio Montes (jamontes)">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="plugin.video.youtube" version="4.4.8"/>
diff --git a/plugin.video.filmsforaction/changelog.txt
b/plugin.video.filmsforaction/changelog.txt
index 0ee706f..bc06d8a 100644
--- a/plugin.video.filmsforaction/changelog.txt
+++ b/plugin.video.filmsforaction/changelog.txt
@@ -1,3 +1,7 @@
+1.0.5
+- Added filter to show All/Best videos from add-on setings menu.
+- Included category menu into the Next/Previous Page title entries.
+- Fixed last page regexp for Next Page entry to allow explore beyond nine.
1.0.4
- Fixed Next/Previous Page entries due to website changes.
- Updated Dailymotion scraper to support more video formats.
diff --git a/plugin.video.filmsforaction/default.py
b/plugin.video.filmsforaction/default.py
index 453433a..6716aa6 100644
--- a/plugin.video.filmsforaction/default.py
+++ b/plugin.video.filmsforaction/default.py
@@ -47,6 +47,12 @@ debug_flag = settings.getSetting("debug") == "true"
p.set_debug_mode(debug_flag)
api.set_debug(debug_flag)
+# By default, both, the website and the add-on are setup to show only the best
videos.
+all_filter = '?c=all' if settings.getSetting("show_best") == "false" else ''
+
+if all_filter:
+ p.log("ffa.main: 'all videos' filter is explicit setup.")
+
def get_located_string(string_name):
return translation(localized_strings.get(string_name)).encode('utf-8') or
string_name if string_name in localized_strings else string_name
@@ -73,23 +79,25 @@ def create_index(params):
category_list = api.get_categories()
+ menu_entry = get_located_string('All videos')
all_videos_item = {
'thumbnail': '',
'info': {
- 'title': get_located_string('All videos'),
- 'genre': get_located_string('All videos'),
+ 'title': menu_entry,
+ 'genre': menu_entry,
},
- 'path': p.get_plugin_path(url =
'http://www.filmsforaction.org/films/', action = action),
+ 'path': p.get_plugin_path(url =
'http://www.filmsforaction.org/films/' + all_filter, action = action, category
= menu_entry),
'IsPlayable' : False
}
+ menu_entry = get_located_string('Search')
search_videos_item = {
'thumbnail': '',
'info': {
- 'title': get_located_string('Search'),
- 'genre': get_located_string('Search'),
+ 'title': menu_entry,
+ 'genre': menu_entry,
},
- 'path': p.get_plugin_path(action = 'search_videos'),
+ 'path': p.get_plugin_path(action = 'search_videos', category =
menu_entry),
'IsPlayable' : False
}
@@ -99,7 +107,7 @@ def create_index(params):
'title': category_title,
'genre': category_title
},
- 'path': p.get_plugin_path(url = category_url, action = action),
+ 'path': p.get_plugin_path(url = category_url + all_filter, action =
action, category = category_title),
'IsPlayable' : False
} for category_url, category_title in category_list]
@@ -111,21 +119,30 @@ def create_index(params):
def main_list(params):
p.log("ffa.main_list "+repr(params))
- videos = api.get_videolist(params.get("url"), get_located_string)
+ category = params.get("category", "")
+ videos = api.get_videolist(params.get("url"), category)
reset_cache = 'yes' if params.get('reset_cache') == 'yes' or
videos['reset_cache'] else 'no'
video_list = [ {
- 'thumbnail': video_entry.get('thumbnail') or '',
+ 'thumbnail' : video_entry.get('thumbnail') or '',
'info': {
- 'title': video_entry.get('title'),
- 'plot': video_entry.get('plot') or '',
- 'studio': video_entry.get('credits') or '',
- 'genre': video_entry.get('genre') or '',
- 'rating': video_entry.get('rating') or '',
- 'duration': video_entry.get('duration') or 1
+ 'title' : video_entry.get('title'),
+ 'plot' : video_entry.get('plot') or '',
+ 'studio' : video_entry.get('credits') or '',
+ 'genre' : video_entry.get('genre') or '',
+ 'rating' : video_entry.get('rating') or '',
+ 'duration': video_entry.get('duration') or 1,
},
- 'path': p.get_plugin_path(url = video_entry['url'], action =
'play_video') if video_entry['IsPlayable'] else p.get_plugin_path(url =
video_entry['url'], action = 'main_list', reset_cache = reset_cache),
- 'IsPlayable': video_entry['IsPlayable']
+ 'path' : p.get_plugin_path(
+ url = video_entry['url'],
+ action = 'play_video',
+ ) if video_entry['IsPlayable'] else p.get_plugin_path(
+ url = video_entry['url'],
+ action = 'main_list',
+ reset_cache = reset_cache,
+ category = category,
+ ),
+ 'IsPlayable' : video_entry['IsPlayable']
} for video_entry in videos['video_list']]
p.add_items(video_list, reset_cache == 'yes')
@@ -136,7 +153,7 @@ def search_videos(params):
search_string = p.get_keyboard_text(get_located_string('Search'))
if search_string:
- params['url'] = api.get_search_url(search_string)
+ params['url'] = api.get_search_url(search_string) +
all_filter.replace('?', '&')
p.log("ffa.search Value of search url: %s" % params['url'])
return main_list(params)
diff --git a/plugin.video.filmsforaction/resources/language/English/strings.xml
b/plugin.video.filmsforaction/resources/language/English/strings.xml
index ad43b29..0ae3d83 100644
--- a/plugin.video.filmsforaction/resources/language/English/strings.xml
+++ b/plugin.video.filmsforaction/resources/language/English/strings.xml
@@ -7,4 +7,5 @@
<string id="30014">All videos</string>
<string id="30015">Search</string>
<string id="30101">Debug (enable logs)</string>
+ <string id="30102">Show only the best videos (default)</string>
</strings>
diff --git a/plugin.video.filmsforaction/resources/language/French/strings.xml
b/plugin.video.filmsforaction/resources/language/French/strings.xml
index 549d3e6..36f7079 100644
--- a/plugin.video.filmsforaction/resources/language/French/strings.xml
+++ b/plugin.video.filmsforaction/resources/language/French/strings.xml
@@ -7,4 +7,5 @@
<string id="30014">Toutes les vidéos</string>
<string id="30015">Recherchez</string>
<string id="30101">Debug (logs)</string>
+ <string id="30102">Afficher uniquement les meilleures vidéos (par
défaut)</string>
</strings>
diff --git a/plugin.video.filmsforaction/resources/language/German/strings.xml
b/plugin.video.filmsforaction/resources/language/German/strings.xml
index 02042b8..644e413 100644
--- a/plugin.video.filmsforaction/resources/language/German/strings.xml
+++ b/plugin.video.filmsforaction/resources/language/German/strings.xml
@@ -7,4 +7,5 @@
<string id="30014">Alle videos</string>
<string id="30015">Suchen</string>
<string id="30101">Debug (logs)</string>
+ <string id="30102">Nur die besten videos anzeigen</string>
</strings>
diff --git a/plugin.video.filmsforaction/resources/language/Spanish/strings.xml
b/plugin.video.filmsforaction/resources/language/Spanish/strings.xml
index ccfec56..c459302 100644
--- a/plugin.video.filmsforaction/resources/language/Spanish/strings.xml
+++ b/plugin.video.filmsforaction/resources/language/Spanish/strings.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="30010">Siguiente página</string>
- <string id="30011">Tipo de video no soportado</string>
- <string id="30012">No se ha podido localizar la url de video</string>
+ <string id="30011">Tipo de vÃdeo no soportado</string>
+ <string id="30012">No se ha podido localizar la url de vÃdeo</string>
<string id="30013">Página anterior</string>
<string id="30014">Todos los vÃdeos</string>
<string id="30015">Buscar</string>
<string id="30101">Debug (activa los logs)</string>
+ <string id="30102">Mostrar sólo los mejores vÃdeos (por defecto)</string>
</strings>
diff --git a/plugin.video.filmsforaction/resources/lib/ffa_api.py
b/plugin.video.filmsforaction/resources/lib/ffa_api.py
index 3f32ca2..6abd594 100644
--- a/plugin.video.filmsforaction/resources/lib/ffa_api.py
+++ b/plugin.video.filmsforaction/resources/lib/ffa_api.py
@@ -48,7 +48,7 @@ def get_categories():
return category_list
-def get_videolist(url, localized=lambda x: x):
+def get_videolist(url, cat_menu=""):
"""This function gets the video list from the FFA website and returns them
in a pretty data format."""
video_entry_sep = 'view-horizontal'
video_url_pattern = '["\'](/watch/[^/]*?/)'
@@ -56,13 +56,13 @@ def get_videolist(url, localized=lambda x: x):
video_title_pattern = '<a href=["\']/watch/[^/]*?/["\'][
]*?>([^<]+?)</a>'
video_plot_pattern = '<div class="content-text">([^<]*?)</div>'
video_cat_pattern = '>(Video|Short
Film|Trailer|Documentary|Presentation)<'
- video_duration_pattern = '([0-9]+?[ ]+?[Mm]in)'
- video_rating_pattern = '([0-9.]+?[ ]+?[Ss]tars)'
- video_views_pattern = '([0-9,]+?[ ]+?[Vv]iews)'
+ video_duration_pattern = '([0-9]+[ ]+[Mm]in)'
+ video_rating_pattern = '([0-9.]+[ ]+[Ss]tars)'
+ video_views_pattern = '([0-9,]+[ ]+[Vv]iews)'
video_author_pattern = '([Aa]dded by).*?<a href=["\']/[^/]*?/["\'][
]*?>([^<]*?)</a>'
- page_num_pattern = 'href=["\']http[^"\']*?p=([0-9]+?)'
+ page_num_pattern = 'href=["\']http[^"\']*?p=([0-9]+)'
page_num_url_pattern = 'href=["\'](http[^"\']*?p=%d[^"\']*?)["\']'
- page_num_cur_pattern = 'p=([0-9]+?)'
+ page_num_cur_pattern = 'p=([0-9]+)'
buffer_url = l.carga_web(url)
@@ -75,7 +75,7 @@ def get_videolist(url, localized=lambda x: x):
if current_page_num != 1:
prev_page_num = current_page_num - 1
previous_page_url = l.find_first(buffer_url, page_num_url_pattern %
prev_page_num)
- video_entry = { 'url': previous_page_url, 'title': '<< %s (%d)' %
(localized('Previous page'), prev_page_num), 'IsPlayable': False }
+ video_entry = { 'url': previous_page_url, 'title': '<< %s (%d)' %
(cat_menu, prev_page_num), 'IsPlayable': False }
video_list.append(video_entry)
reset_cache = True
@@ -116,7 +116,7 @@ def get_videolist(url, localized=lambda x: x):
if current_page_num < last_page_num:
next_page_num = current_page_num + 1
next_page_url = l.find_first(buffer_url, page_num_url_pattern %
next_page_num)
- video_entry = { 'url': next_page_url, 'title': '>> %s (%d/%d)' %
(localized('Next page'), next_page_num, last_page_num), 'IsPlayable': False }
+ video_entry = { 'url': next_page_url, 'title': '>> %s (%d/%d)' %
(cat_menu, next_page_num, last_page_num), 'IsPlayable': False }
video_list.append(video_entry)
return { 'video_list': video_list, 'reset_cache': reset_cache }
diff --git a/plugin.video.filmsforaction/resources/settings.xml
b/plugin.video.filmsforaction/resources/settings.xml
index 4fa72df..e970ebe 100644
--- a/plugin.video.filmsforaction/resources/settings.xml
+++ b/plugin.video.filmsforaction/resources/settings.xml
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="debug" type="bool" label="30101" default="false"/>
+ <setting id="show_best" type="bool" label="30102" default="true"/>
</settings>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=24370ed2b966a7c7f5ef995aec8f4fada5a2d958
commit 24370ed2b966a7c7f5ef995aec8f4fada5a2d958
Author: Martijn Kaijser <[email protected]>
Date: Sun Sep 7 14:44:08 2014 +0200
[plugin.image.flickr] 1.0.6
diff --git a/plugin.image.flickr/addon.xml b/plugin.image.flickr/addon.xml
index f5f9a72..3093d23 100644
--- a/plugin.image.flickr/addon.xml
+++ b/plugin.image.flickr/addon.xml
@@ -1,29 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.image.flickr"
- name="flickr"
- version="1.0.0"
- provider-name="Rick Phillips (ruuk)">
- <requires>
- <import addon="xbmc.python" version="2.1.0"/>
- <import addon="script.module.elementtree" version="1.2.7"/>
- </requires>
+<addon id="plugin.image.flickr" name="flickr" version="1.0.6"
provider-name="Rick Phillips (ruuk)">
+ <requires>
+ <import addon="xbmc.python" version="2.1.0" />
+ <import addon="script.module.elementtree" version="1.2.7" />
+ </requires>
- <extension point="xbmc.python.pluginsource"
- library="default.py">
- <provides>image</provides>
- </extension>
- <extension point="xbmc.addon.metadata">
- <summary lang="en">flickrXBMC: flickr on XBMC</summary>
- <summary lang="de">flickrXBMC: flickr in XBMC</summary>
- <summary lang="es">flickrXBMC: flickr en XBMC</summary>
- <summary lang="nl">flickrXBMC: Flickr op XBMC</summary>
- <description>flickrXBMC allows you to: Browse your photostream,
collections, sets, galleries, tags, places, and favorites. Browse your contacts
and their content. Search you or your contacts photostream, or search
flickr.</description>
- <description lang="de">flickrXBMC ermöglicht Fotostreams, Sammlungen,
Sets, Gallerien, Tags, Orte und Favoriten zu dursuchen. Durchsuche deine
Freunde und deren Fotos. Durchsuche deine Fotos oder die deiner Freunde, oder
durchsuche flickr allgemein.</description>
- <description lang="es">flickrXBMC le permite: Busca en tu galerÃa de
fotos, colecciones, conjuntos, galerÃas, etiquetas, lugares, y favoritos.
Busque sus contactos y su contenido. Buscar contactos que usted o su galerÃa
de fotos, o flickr de búsqueda.</description>
- <description lang="nl">flickrXBMC geeft u de mogelijkheid om te bladeren
door uw photostreams, verzamelingen, sets, galerijen, tags, plaatsen en
favorieten. Bekijk uw contacten en hun foto's. Zoek door uw eigen of van uw
contacts de photostreams of door geheel Flickr.</description>
- <platform>all</platform>
- <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
- <forum>http://forum.xbmc.org/showthread.php?tid=81593</forum>
- <source>http://github.com/ruuk/plugin.image.flickr</source>
- </extension>
+ <extension point="xbmc.python.pluginsource" library="default.py">
+ <provides>image</provides>
+ </extension>
+ <extension point="xbmc.addon.metadata">
+ <summary lang="en">flickrXBMC: flickr on XBMC</summary>
+ <summary lang="de">flickrXBMC: flickr in XBMC</summary>
+ <summary lang="es">flickrXBMC: flickr en XBMC</summary>
+ <summary lang="nl">flickrXBMC: Flickr op XBMC</summary>
+ <description>flickrXBMC allows you to: Browse your photostream,
collections, sets, galleries, tags, places, and favorites. Browse your contacts
and their content. Search you or your contacts photostream, or search
flickr.</description>
+ <description lang="de">flickrXBMC ermöglicht Fotostreams,
Sammlungen, Sets, Gallerien, Tags, Orte und Favoriten zu dursuchen. Durchsuche
deine Freunde und deren Fotos. Durchsuche deine Fotos oder die deiner Freunde,
oder durchsuche flickr allgemein.</description>
+ <description lang="es">flickrXBMC le permite: Busca en tu
galerÃa de fotos, colecciones, conjuntos, galerÃas, etiquetas, lugares, y
favoritos. Busque sus contactos y su contenido. Buscar contactos que usted o su
galerÃa de fotos, o flickr de búsqueda.</description>
+ <description lang="nl">flickrXBMC geeft u de mogelijkheid om te
bladeren door uw photostreams, verzamelingen, sets, galerijen, tags, plaatsen
en favorieten. Bekijk uw contacten en hun foto's. Zoek door uw eigen of van uw
contacts de photostreams of door geheel Flickr.</description>
+ <platform>all</platform>
+ <license>GNU GENERAL PUBLIC LICENSE. Version 2, June
1991</license>
+ <forum>http://forum.xbmc.org/showthread.php?tid=81593</forum>
+ <source>http://github.com/ruuk/plugin.image.flickr</source>
+ </extension>
</addon>
diff --git a/plugin.image.flickr/changelog.txt
b/plugin.image.flickr/changelog.txt
index 936e88d..ae44e04 100644
--- a/plugin.image.flickr/changelog.txt
+++ b/plugin.image.flickr/changelog.txt
@@ -1,106 +1,131 @@
flickrXBMC Changelog
-Current Version : 1.0.0
+Current Version : 1.0.6
-** 1.0.0 ***
+*** 1.0.6 ***
+
+Fix for next page item not displaying in some situations
+
+*** 1.0.5 ***
+
+Fixed 403 forbidden errors due to new SSL requirement
+
+*** 1.0.4 ***
+
+Network token cache is now backed by the local token cache
+
+*** 1.0.3 ***
+
+Added setting: Network Token Save Path
+
+*** 1.0.2 ***
+
+Username option in settings is now disabled when access as user is enabled
+Username setting is no longer used when user is authenticated
+
+*** 1.0.1 ***
+
+Added a settings option for preferred video quality
+
+*** 1.0.0 ***
Fix some authentication issues and remove WebViewer option (now has unreadable
captchas)
Update addon.xml for Gotham
Converted strings.xml files to strings.po files
-** 0.9.104 ***
+*** 0.9.104 ***
Added 'Search flickr Groups'
-** 0.9.103 ***
+*** 0.9.103 ***
Fix images
-** 0.9.102 ***
+*** 0.9.102 ***
Added 'Groups' icon, set Contacts '[Recent Photos]' icon to 'Photostream' icon
Made 'Re-authorize' settings option only enabled when 'Access As User' is set
Fixed issue when authorizing via the 'Re-authorize' button
-** 0.9.101 ***
+*** 0.9.101 ***
Added 'Groups' which will list your groups. Selecting a group will show the
group's photo pool
Under 'Contacts' added '[Recent Photos]' which will show up to 50 photos (5
for each contact) from your contacts' photostreams.
Added 'Re-authorize' option in settings to fix a broken auth (ie Bad Auth
Token errors)
-** 0.9.100 ***
+*** 0.9.100 ***
Now when 'plugin_slideshow_ss=true' is passed to the plugin, plugin will show
up to 500 photos per page. Added to work with the Plugin Slideshow Screensaver
addon
-** 0.9.99 ***
+*** 0.9.99 ***
Added option to photo context menu: 'Save Photo'
-** 0.9.98 ***
+*** 0.9.98 ***
Added option in settings: 'Access as user (Requires Authentication)'
Added the ability to browse flickr without authorization. If username is not
set in settings, only 'Search flickr' and 'Interesting Today' will be available
Now when asking for token entry after external browser authorization, clicking
done on a blank entry will exit the dialog loop (ie for ATV2)
-** 0.9.97 ***
+*** 0.9.97 ***
Fixed a bug where initial authorization via external web browser fails, but
succeeds on second attempt
-** 0.9.96 ***
+*** 0.9.96 ***
Fix for photos with no title set. Will now try title, then date taken, then
date uploaded and finally photo id
-** 0.9.95 ***
+*** 0.9.95 ***
Added handling of of empty photostream when proividing feed
-** 0.9.94 ***
+*** 0.9.94 ***
Videos are now playable
Videos playable from external source via plugin:// url
-** 0.9.93 ***
+*** 0.9.93 ***
Added feeds and sharing in the context menu for ShareSocial
-** 0.9.92 ***
+*** 0.9.92 ***
Changes for Eden
Better error handling
-** 0.9.91 ***
+*** 0.9.91 ***
Removed Web Viewer requirement.
Added option to authorize via external browser.
-** 0.9.9 ***
+*** 0.9.9 ***
Authorization now handled in XBMC with Web Viewer
-** 0.9.8 ***
+*** 0.9.8 ***
Added Language Translation: Chinese (Traditional) - thanks to Ramius
-** 0.9.7 ***
+*** 0.9.7 ***
Changed default map to google
Added Dutch language - thanks to Michel de Bokx
-** 0.9.6 ***
+*** 0.9.6 ***
Improved directory load cancelling
-** 0.9.5 ***
+*** 0.9.5 ***
Fixed a bug with handling non-ascii characters
-** 0.9.4 ***
+*** 0.9.4 ***
Improved settings interface
Fixed bug with authorization (works with all versions)
Changed icon (thanks Jeroen) as suggested by freezy
-** 0.9.3 ***
+*** 0.9.3 ***
Added strings to language files
Add more (probably bad) spanish translations
@@ -110,17 +135,17 @@ Added settings for map zooms
Added ability to disable map thumbnails
Moved map funtions into a class
-** 0.9.2 ***
+*** 0.9.2 ***
German language translation - thanks to Max Auer
Spanish language translation
Maps for Place thumbnails
Added 'Show Map' option on photo context menu to display a map with marker
-** 0.9.1 ***
+*** 0.9.1 ***
Bug fix: Was incorrectly adding the cache dir
-** 0.9.0 ***
+*** 0.9.0 ***
Initial Release
\ No newline at end of file
diff --git a/plugin.image.flickr/default.py b/plugin.image.flickr/default.py
index 9088eda..c2c0090 100644
--- a/plugin.image.flickr/default.py
+++ b/plugin.image.flickr/default.py
@@ -39,7 +39,78 @@ def ERROR(message,caption=''):
if not os.path.exists(CACHE_PATH): os.makedirs(CACHE_PATH)
+class NetworkTokenCache(flickrapi.tokencache.TokenCache):
+ def __init__(self, api_key, username=None):
+ flickrapi.tokencache.TokenCache.__init__(self,api_key, username)
+ self.path = __settings__.getSetting('network_token_path')
+ self.localBackup =
flickrapi.tokencache.TokenCache(api_key,username)
+
+ def get_cached_token_path(self,filename=''):
+ if os.path.exists(self.path): return os.path.join(self.path,
self.api_key, filename)
+ path = self.path.rstrip('/') + '/' + self.api_key
+ if filename: path += '/' + filename
+ return path
+
+ def get_cached_token_filename(self):
+ if self.username:
+ filename = 'auth-%s.token' % self.username
+ else:
+ filename = 'auth.token'
+
+ return self.get_cached_token_path(filename)
+
+ def set_cached_token(self, token):
+ self.localBackup.set_cached_token(token)
+ self.memory[self.username] = token
+ if not token: return
+ import xbmcvfs
+ path = self.get_cached_token_path()
+ if not xbmcvfs.exists(path):
+ xbmcvfs.mkdirs(path)
+
+ f = xbmcvfs.File(self.get_cached_token_filename(), "w")
+ f.write(str(token))
+ f.close()
+
+ def get_cached_token(self):
+ backup = self.localBackup.get_cached_token()
+ if self.username in self.memory: return
self.memory[self.username]
+ import xbmcvfs
+ filename = self.get_cached_token_filename()
+ if xbmcvfs.exists(filename):
+ try:
+ f = xbmcvfs.File(filename)
+ token = f.read()
+ f.close()
+ return token.strip()
+ except:
+ pass
+ return backup
+
+ def forget(self):
+ self.localBackup.forget()
+ if self.username in self.memory:
+ del self.memory[self.username]
+
+ import xbmcvfs
+ filename = self.get_cached_token_filename()
+ if xbmcvfs.exists(filename):
+ xbmcvfs.delete(filename)
+
+ @staticmethod
+ def isValid():
+ import xbmcvfs
+ path = __settings__.getSetting('network_token_path')
+ return path and xbmcvfs.exists(path)
+
+ token = property(get_cached_token, set_cached_token, forget, "The
cached token")
+
class flickrPLUS(flickrapi.FlickrAPI):
+ def __init__(self, api_key, secret=None, username=None, token=None,
format='etree', store_token=True, cache=False):
+ flickrapi.FlickrAPI.__init__(self, api_key, secret, username,
token, format, store_token, cache)
+ if NetworkTokenCache.isValid():
+ self.token_cache = NetworkTokenCache(api_key, username)
+
def walk_photos_by_page(self, method, **params):
rsp = method(**params)
@@ -219,20 +290,20 @@ class FlickrSession:
return self.API_KEY,self.API_SECRET
def doTokenDialog(self,frob,perms):
- if False:
- try:
- from webviewer import webviewer
#@UnresolvedImport @UnusedImport
- yes =
xbmcgui.Dialog().yesno('Authenticate','Press \'Yes\' to authenticate in any
browser','Press \'No\' to use Web Viewer (If Installed)')
- if not yes:
- self.isMobile(False)
- self.doNormalTokenDialog(frob, perms)
- return
- except ImportError:
- LOG("Web Viewer Not Installed - Using Mobile
Method")
- pass
- except:
- ERROR('')
- return
+# if False:
+# try:
+# from webviewer import webviewer
#@UnresolvedImport @UnusedImport
+# yes =
xbmcgui.Dialog().yesno('Authenticate','Press \'Yes\' to authenticate in any
browser','Press \'No\' to use Web Viewer (If Installed)')
+# if not yes:
+# self.isMobile(False)
+# self.doNormalTokenDialog(frob, perms)
+# return
+# except ImportError:
+# LOG("Web Viewer Not Installed - Using Mobile
Method")
+# pass
+# except:
+# ERROR('')
+# return
self.isMobile(True)
self.doMiniTokenDialog(frob, perms)
@@ -274,7 +345,7 @@ class FlickrSession:
if not keyboard.isConfirmed(): return
mini_token = keyboard.getText().replace('-','')
if not mini_token: return
- token = self.flickr.get_full_token(mini_token) #@UnusedVariable
+ self.flickr.get_full_token(mini_token) #@UnusedVariable
def authenticate(self,force=False):
key,secret = self.getKeys()
@@ -313,15 +384,19 @@ class FlickrSession:
def finishAuthenticate(self,token):
self.flickr.token_cache.token = token
- if self.username:
- user =
self.flickr.people_findByUsername(username=self.username)
- self.user_id = user.findall('*')[0].get('id')
- else:
- rsp =
self.flickr.auth_checkToken(auth_token=token,format='xmlnode')
- user = rsp.auth[0].user[0]
- self.user_id = user.attrib.get('nsid')
- self.username = user.attrib.get('username')
- if self.username:
__settings__.setSetting('flickr_username',self.username)
+# if self.username:
+# try:
+# user =
self.flickr.people_findByUsername(username=self.username)
+# self.user_id = user.findall('*')[0].get('id')
+# return True
+# except:
+# ERROR('Failed to authenticate with username in
settings')
+
+ rsp =
self.flickr.auth_checkToken(auth_token=token,format='xmlnode')
+ user = rsp.auth[0].user[0]
+ self.user_id = user.attrib.get('nsid')
+ self.username = user.attrib.get('username')
+ if self.username:
__settings__.setSetting('flickr_username',self.username)
return True
def getCollectionsInfoList(self,userid=None,cid='0'):
@@ -441,7 +516,7 @@ class FlickrSession:
def
addPhotos(self,method,mode,url='BLANK',page='1',mapOption=True,with_username=False,**kwargs):
global ShareSocial
try:
- import ShareSocial #@UnresolvedImport
+ import ShareSocial #analysis:ignore
except:
pass
@@ -458,18 +533,19 @@ class FlickrSession:
if mapOption: extras += ',geo'
#Walk photos
- ct=1
+ ct=0
mpp = self.max_per_page
if self.isSlideshow: mpp = 500
for photo in
self.flickr.walk_photos_by_page(method,page=page,per_page=mpp,extras=extras,**kwargs):
- ct+=1
ok = self.addPhoto(photo,
mapOption=mapOption,with_username=with_username)
if not ok: break
+ ct+=1
#Add Next Footer if necessary
- #print "PAGES: " + str(page) + " " +
str(self.flickr.TOTAL_PAGES) + " " + self.flickr.TOTAL_ON_LAST_PAGE
- if ct >= self.max_per_page:
- nextp =
'('+str(page*self.max_per_page)+'/'+str(self.flickr.TOTAL)+') '
+ #print "PAGES: " + str(page) + " " +
str(self.flickr.TOTAL_PAGES) + " " + str(self.flickr.TOTAL_ON_LAST_PAGE)
+ if ct >= self.max_per_page or page < self.flickr.TOTAL_PAGES:
+ sofar = (max(0,page - 1) * self.max_per_page) + ct
+ nextp = '({0}/{1}) '.format(sofar,self.flickr.TOTAL)
replace = ''
if page + 1 == self.flickr.TOTAL_PAGES:
nextp += __language__(30513)
@@ -511,7 +587,7 @@ class FlickrSession:
sizes = {}
if ptype == 'video':
sizes = self.getImageUrl(pid,'all')
- display = sizes.get('Site MP4',photo.get('Video
Original',''))
+ display = selectVideoURL(sizes)
#display = 'plugin://plugin.image.flickr/?play_video&'
+ pid
contextMenu = []
if mapOption:
@@ -892,6 +968,16 @@ def doPlugin():
if mode != 9999:
xbmcplugin.endOfDirectory(int(sys.argv[1]),succeeded=success,updateListing=update_dir,cacheToDisc=cache)
+def selectVideoURL(sizes):
+ sizeIDX = int(__settings__.getSetting('video_display_size') or '1')
+ sizeNames = ('Mobile MP4','Site MP4','HD MP4','Video Original')
+ size = sizeNames[sizeIDX]
+ if size in sizes: return sizes[size]
+ for size in sizeNames[:sizeIDX]:
+ if size in sizes: return sizes[size]
+ return ''
+
+
def playVideo():
fsession = FlickrSession()
if not fsession.authenticate():
@@ -899,7 +985,7 @@ def playVideo():
vid = sys.argv[2].split('=')[-1]
LOG('Playing video with ID: ' + vid)
sizes = fsession.getImageUrl(vid, 'all')
- url = sizes.get('Site MP4',sizes.get('Video Original',''))
+ url = selectVideoURL(sizes)
listitem = xbmcgui.ListItem(label='flickr Video', path=url)
listitem.setInfo(type='Video',infoLabels={"Title": 'flickr
Video'})
xbmcplugin.setResolvedUrl(handle=int(sys.argv[1]),
succeeded=True, listitem=listitem)
diff --git a/plugin.image.flickr/flickrapi/__init__.py
b/plugin.image.flickr/flickrapi/__init__.py
index b05fc84..aff6e9d 100644
--- a/plugin.image.flickr/flickrapi/__init__.py
+++ b/plugin.image.flickr/flickrapi/__init__.py
@@ -398,7 +398,7 @@ class FlickrAPI(object):
if self.cache and self.cache.get(post_data):
return self.cache.get(post_data)
- url = "http://" + self.flickr_host + self.flickr_rest_form
+ url = "https://" + self.flickr_host + self.flickr_rest_form
flicksocket = urllib2.urlopen(url, post_data)
reply = flicksocket.read()
flicksocket.close()
@@ -452,7 +452,7 @@ class FlickrAPI(object):
"frob": frob,
"perms": perms})
- return "http://%s%s?%s" % (self.flickr_host, \
+ return "https://%s%s?%s" % (self.flickr_host, \
self.flickr_auth_form, encoded)
def web_login_url(self, perms):
@@ -466,7 +466,7 @@ class FlickrAPI(object):
"api_key": self.api_key,
"perms": perms})
- return "http://%s%s?%s" % (self.flickr_host, \
+ return "https://%s%s?%s" % (self.flickr_host, \
self.flickr_auth_form, encoded)
def __extract_upload_response_format(self, kwargs):
@@ -590,7 +590,7 @@ class FlickrAPI(object):
if self.secret:
kwargs["api_sig"] = self.sign(kwargs)
- url = "http://%s%s" % (self.flickr_host, form_url)
+ url = "https://%s%s" % (self.flickr_host, form_url)
# construct POST data
body = Multipart()
diff --git a/plugin.image.flickr/resources/language/English/strings.po
b/plugin.image.flickr/resources/language/English/strings.po
index 81b5026..93a7cba 100644
--- a/plugin.image.flickr/resources/language/English/strings.po
+++ b/plugin.image.flickr/resources/language/English/strings.po
@@ -324,3 +324,23 @@ msgstr ""
msgctxt "#30523"
msgid "Error getting token."
msgstr ""
+
+msgctxt "#30524"
+msgid "Preferred Video Quality"
+msgstr ""
+
+msgctxt "#30525"
+msgid "Mobile MP4 (Lowest)"
+msgstr ""
+
+msgctxt "#30526"
+msgid "Site MP4 (Normal)"
+msgstr ""
+
+msgctxt "#30527"
+msgid "HD MP4 (Better)"
+msgstr ""
+
+msgctxt "#30528"
+msgid "Video Original (Best)"
+msgstr ""
diff --git a/plugin.image.flickr/resources/language/German/strings.po
b/plugin.image.flickr/resources/language/German/strings.po
index 1837ff8..11e7f95 100644
--- a/plugin.image.flickr/resources/language/German/strings.po
+++ b/plugin.image.flickr/resources/language/German/strings.po
@@ -19,7 +19,7 @@ msgstr "Flickr User Name"
msgctxt "#30002"
msgid "Default Thumb Size"
-msgstr "DStandard ThumbgröÃe"
+msgstr "Standard ThumbgröÃe"
msgctxt "#30003"
msgid "Default Display Size"
@@ -151,7 +151,7 @@ msgstr "Suche Fotostream"
msgctxt "#30309"
msgid "Search flickr"
-msgstr "Dursuche flickr"
+msgstr "Durchsuche flickr"
msgctxt "#30310"
msgid "Interesting Today"
@@ -159,19 +159,19 @@ msgstr "Intressantes von heute"
msgctxt "#30311"
msgid "Groups"
-msgstr ""
+msgstr "Gruppen"
msgctxt "#30312"
msgid "Search flickr Groups"
-msgstr ""
+msgstr "flickr Gruppen durchsuchen"
msgctxt "#30400"
msgid "Save Path"
-msgstr ""
+msgstr "Speichern-Pfad"
msgctxt "#30412"
msgid "Saved"
-msgstr ""
+msgstr "Gespeichert"
msgctxt "#30413"
msgid "Saved as: @REPLACE@"
@@ -183,19 +183,19 @@ msgstr ""
msgctxt "#30415"
msgid "Saving"
-msgstr ""
+msgstr "Speichern"
msgctxt "#30416"
msgid "Saving..."
-msgstr ""
+msgstr "Speichern..."
msgctxt "#30417"
msgid "Invalid Path"
-msgstr ""
+msgstr "Ungültiger Pfad"
msgctxt "#30418"
msgid "Please set save path in settings"
-msgstr ""
+msgstr "Bitte einen Speichern-Pfad in den Einstellungen angeben"
msgctxt "#30419"
msgid "Fail"
@@ -203,7 +203,7 @@ msgstr ""
msgctxt "#30420"
msgid "Failed to save image."
-msgstr ""
+msgstr "Bild speichern fehlgeschlagen"
msgctxt "#30500"
msgid "Show All In @REPLACE@"
@@ -275,7 +275,7 @@ msgstr "Suche @NAMEREPLACE@'s Fotostream"
msgctxt "#30517"
msgid "Save Photo"
-msgstr ""
+msgstr "Bild speichern"
msgctxt "#30518"
msgid "Recent Photos"
@@ -287,11 +287,11 @@ msgstr ""
msgctxt "#30521"
msgid "Authorization Failed."
-msgstr ""
+msgstr "Login fehlgeschlagen"
msgctxt "#30522"
msgid "Authorization Error"
-msgstr ""
+msgstr "Anmeldefehler"
msgctxt "#30523"
msgid "Error getting token."
diff --git a/plugin.image.flickr/resources/settings.xml
b/plugin.image.flickr/resources/settings.xml
index fc4ebcf..df20295 100644
--- a/plugin.image.flickr/resources/settings.xml
+++ b/plugin.image.flickr/resources/settings.xml
@@ -3,13 +3,15 @@
<!-- General -->
<category label="30200">
- <setting id="flickr_username" type="text" label="30001" default="" />
+ <setting id="flickr_username" type="text" label="30001" default=""
enable="eq(1,false)"/>
<setting id="authenticate" type="bool" label="30013" default="false" />
- <setting label="30014" type="action"
action="RunScript(plugin.image.flickr,reset_auth)" option="close"
enable="eq(-1,true)"/>
+ <setting label="30014" type="action" subsetting="true"
action="RunScript(plugin.image.flickr,reset_auth)" option="close"
enable="eq(-1,true)" />
+ <setting id="network_token_path" type="folder" option="writeable"
subsetting="true" label="Network Token Save Path (Optional)"
enable="eq(-2,true)" />
<setting type="sep" />
<setting id="max_per_page" type="enum" label="30004"
values="10|20|30|40|50|75|100|200|500" default="4" />
<setting id="default_thumb_size" type="enum" label="30002"
lvalues="30100|30101|30102|30103|30104|30105|30106" default="1" />
<setting id="default_display_size" type="enum" label="30003"
lvalues="30100|30101|30102|30103|30104|30105|30106" default="5" />
+ <setting id="video_display_size" type="enum" label="30524"
lvalues="30525|30526|30527|30528" default="1" />
<setting id="save_path" type="folder" source="local" label="30400" />
</category>
<category label="30201">
-----------------------------------------------------------------------
Summary of changes:
plugin.image.flickr/README.md | 29 ++++
plugin.image.flickr/addon.xml | 48 +++----
plugin.image.flickr/changelog.txt | 77 +++++++----
plugin.image.flickr/default.py | 150 +++++++++++++++----
plugin.image.flickr/flickrapi/__init__.py | 8 +-
.../resources/language/English/strings.po | 20 +++
.../resources/language/German/strings.po | 28 ++--
plugin.image.flickr/resources/settings.xml | 6 +-
plugin.video.filmsforaction/.travis.yml | 4 -
plugin.video.filmsforaction/addon.xml | 2 +-
plugin.video.filmsforaction/changelog.txt | 4 +
plugin.video.filmsforaction/default.py | 53 +++++---
.../resources/language/English/strings.xml | 1 +
.../resources/language/French/strings.xml | 1 +
.../resources/language/German/strings.xml | 1 +
.../resources/language/Spanish/strings.xml | 5 +-
.../resources/lib/ffa_api.py | 16 +-
plugin.video.filmsforaction/resources/settings.xml | 1 +
18 files changed, 317 insertions(+), 137 deletions(-)
create mode 100644 plugin.image.flickr/README.md
delete mode 100644 plugin.video.filmsforaction/.travis.yml
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons