Skip to content

Commit

Permalink
Merge pull request xbmc#1539 from arsat/jarvis
Browse files Browse the repository at this point in the history
[plugin.video.odeon] 1.3.2
  • Loading branch information
MartijnKaijser authored Dec 7, 2017
2 parents 50ca8d4 + 83b015d commit a928578
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 63 deletions.
6 changes: 2 additions & 4 deletions plugin.video.odeon/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![CINE.AR](https://www.odeon.com.ar/favicon-96x96.png)

# odeon-kodi
Addon de CINE.AR PLAY / ODEON (www.odeon.com.ar) para Kodi.
Addon de CINE.AR PLAY / ODEON para Kodi.

### Description

Expand All @@ -14,8 +14,6 @@ CINE.AR PLAY is the free video on demand platform where you will find the best A
CINE.AR PLAY es la plataforma de video a demanda gratuita para ver todos los contenidos nacionales donde quieras, cuando quieras. Las películas y las series, los documentales y los cortos, las nuevas miradas y los clásicos de siempre para disfrutarlos desde cualquier dispositivo.

### Addtional information
- http://www.cine.ar/play
- https://www.odeon.com.ar
- https://www.cine.ar/play
- https://arsat.github.io/odeon-kodi/
- http://forum.kodi.tv/showthread.php?tid=296742
- Contact: [email protected]
8 changes: 4 additions & 4 deletions plugin.video.odeon/addon.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="plugin.video.odeon"
name="Odeon" version="1.3.1"
name="Odeon" version="1.3.2"
provider-name="ARSAT">
<requires>
<import addon="xbmc.python" version="2.24.0"/>
Expand All @@ -20,9 +20,9 @@
<license>GNU General Public License, Version 3</license>
<source>https://github.com/arsat/odeon-kodi</source>
<forum>http://forum.kodi.tv/showthread.php?tid=296742</forum>
<website>https://www.odeon.com.ar</website>
<email>[email protected].ar</email>
<news>v1.3.1 (2017-07-07)
<website>http://www.cine.ar/play</website>
<email>ayuda.play@cine.ar</email>
<news>v1.3.2 (2017-12-01)
- Rebranding to Cine.ar Play.
- Minor bug fix.</news>
</extension>
Expand Down
4 changes: 4 additions & 0 deletions plugin.video.odeon/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## [1.3.2] - 2017-12-01
### Changed
- My Rentals should not be shown.

## [1.3.1] - 2017-07-07
### Changed
- Minor bug fix.
Expand Down
11 changes: 4 additions & 7 deletions plugin.video.odeon/odeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
import os

from resources.lib import simplerequests as requests
from resources.lib import odeoncache
from resources.lib import utils
from resources.lib import odeoncache as utils

PLUGIN_NAME = 'plugin.video.odeon'
API_URL = 'https://www.odeon.com.ar/api/v1.6'
ID_URL = 'https://id.odeon.com.ar/v1.4'
API_URL = 'https://play.cine.ar/api/v1.6'
ID_URL = 'https://id.cine.ar/v1.5'

addon_url = sys.argv[0]
addon_handle = int(sys.argv[1])
Expand Down Expand Up @@ -134,8 +133,6 @@ def root_menu(params):
add_directory_item(translation(30011), 'list_generos', 'folder.png')
# Mi sala
add_directory_item(translation(30012), 'list_prods&url=%s' % quote('tira/misala'), 'folder-movies.png')
# Mis alquileres
add_directory_item(translation(30032), 'list_prods&url=%s' % quote('tvod/INCAA/rentals'), 'folder-movies.png')
# Búsqueda
add_directory_item(translation(30013), 'search', 'search.png')
# Cerrar sesión
Expand Down Expand Up @@ -532,7 +529,7 @@ def json_request(path, params=None):
""" Emula el comportamiento de un browser """
min_max_age = 300 # mínimo que valga la pena usar el cache
token = addon.getSetting('token')
cache = odeoncache.OdeonCache(PLUGIN_NAME)
cache = utils.OdeonCache(PLUGIN_NAME)
url = make_url(path, params)

fromCache = cache.get(url)
Expand Down
36 changes: 32 additions & 4 deletions plugin.video.odeon/resources/lib/odeoncache.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,36 @@
'''

import time
import StorageServer
import utils
import base64
import json
import zlib
import hashlib

try:
import StorageServer
except:
import storageserverdummy as StorageServer


def comp(js):
data = json.dumps(js, ensure_ascii=True, encoding='utf-8')
deflated = zlib.compress(data)
return base64.b64encode(deflated)


def decomp(b64):
try:
deflated = base64.b64decode(b64)
data = zlib.decompress(deflated)
return json.loads(data, encoding='utf-8')
except:
return None


def digest(data):
digest = hashlib.md5(data).digest()
return base64.b64encode(digest)


class OdeonCache():

Expand All @@ -40,7 +68,7 @@ def put(self, url, data, etag, ttl):
data.update({"etag": etag})

self.cache.table_name = self.plugin_name
self.cache.set(url, utils.comp(data))
self.cache.set(url, comp(data))
return


Expand All @@ -49,7 +77,7 @@ def get(self, url):
self.cache.table_name = self.plugin_name
b64 = self.cache.get(url)
if b64:
return utils.decomp(b64)
return decomp(b64)
else:
return None

Expand Down
44 changes: 0 additions & 44 deletions plugin.video.odeon/resources/lib/utils.py

This file was deleted.

0 comments on commit a928578

Please sign in to comment.