Skip to content

Commit

Permalink
[plugin.video.orange.fr] 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
f-lawe committed Jul 21, 2024
1 parent 0e221c0 commit ae622d7
Show file tree
Hide file tree
Showing 26 changed files with 756 additions and 558 deletions.
18 changes: 18 additions & 0 deletions plugin.video.orange.fr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# 2.x

## [2.1.2](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.1.2) - 2024-07-05

### Changed
- Better timeshift management

## [2.1.1](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.1.1) - 2024-06-23

### Changed
- Use [ABC](https://docs.python.org/3/library/abc.html) for class inheritance
- Move Orange util functions to decicated abstract Orange provider
- Better authenticated request management
- Move caching logic to utils

## [2.1.0](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.1.0) - 2024-06-21

### Added
- Catchup TV

## [2.0.1](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.0.1) - 2024-06-20

### Changed
Expand Down
19 changes: 12 additions & 7 deletions plugin.video.orange.fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@
[![Kodi version](https://img.shields.io/badge/kodi%20version-v21-blue)](https://kodi.tv/)
[![GitHub](https://img.shields.io/github/license/f-lawe/plugin.video.orange.fr)](https://github.com/f-lawe/plugin.video.orange.fr/blob/master/LICENSE)

____ _[Lisez-moi](docs/README.fr.md) en français_
____ _[Lisez-moi](doc/README.fr.md) en français_

_This addon is not officially commissioned/supported by Orange. All product names, logos, and trademarks mentionned in this project are property of their respective owners._

## Description
This addon brings Orange TV to Kodi. All channels included in your registration are now directly available from Kodi!

## Installation
Download the latest ZIP archive from the [releases page](https://github.com/f-lawe/plugin.video.orange.fr/releases/latest) and install it into Kodi (Settings > Addons > Install from ZIP). Then install the dependencies from the addon screen (My addons > Video addons > Orange TV France > Dependencies).
This addon features:
- Watching TV with Kodi TV (using [IPTV Simple PVR](https://github.com/kodi-pvr/pvr.iptvsimple))
- Watching catchup TV content
- Access to paid channels included into your subscription (for both live and catchup TV)

Integration to Kodi TV is handled via [IPTV Manager](https://github.com/add-ons/service.iptv.manager). You can install and activate it from the addon settings. Once set up on your system, channels and TV guide are loaded automatically.
## Installation
Orange TV France is available directly from Kodi's main repository. Integration is handled via [IPTV Manager](https://github.com/add-ons/service.iptv.manager). You can install and activate it from the addon settings. Once set up on your system, channels and TV guide are loaded automatically.

You should now be able to view all the channels grouped by category in the TV section. If that's not already installed, Kodi will ask you to install the decrypting tool when accessing a channel for the first time.
You should now be able to view all the channels grouped by category in the TV section. If not already installed, Kodi will ask you to install the decrypting tool when accessing a channel for the first time.

Do not forget to properly configure IPTV Manager and select your TV provider in the settings!

If you need the latest update, you can download the latest ZIP archive from the [releases page](https://github.com/f-lawe/plugin.video.orange.fr/releases/latest) and manually install it into Kodi (Settings > Addons > Install from ZIP). Then install the dependencies from the addon screen (My addons > Video addons > Orange TV France > Dependencies).

## Available providers
| Country | Provider | |
|:---------:|:------------------|:-|
Expand All @@ -27,5 +32,5 @@ Do not forget to properly configure IPTV Manager and select your TV provider in
| 🇫🇷 | Orange Réunion | thanks to [@starmate](https://github.com/starmate) and [@sae-gfc](https://github.com/sae-gfc) |

## Known limitations
- This addons does not provide any catchup functionnalities, for that you can have a look at the great [Catch-up TV & More](https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/)
- Limited to 720p due to Orange limitations (they don't provide higher quality on their web service)
- Limited to 720p because Orange don't provide higher quality on their web TV
- Work only from the listed and tested areas (for now metropolitan France, French Caribbean, and Reunion island)
2 changes: 1 addition & 1 deletion plugin.video.orange.fr/addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.orange.fr" name="Orange TV France" version="2.0.1" provider-name="Flawe">
<addon id="plugin.video.orange.fr" name="Orange TV France" version="2.1.3" provider-name="Flawe">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.routing" version="0.2.3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@ _Cet addon n'est pas officiellement supporté par Orange. Tous les produits, log
## Description
Cet addon ajoute la TV d'Orange à Kodi. Toutes les chaînes inclues dans votre abonnement sont maintenant directement accessibles depuis Kodi !

## Installation
Téléchargez l'archive de la [dernière version](https://github.com/BreizhReloaded/plugin.video.orange.fr/releases/latest) et installez-la directement depuis Kodi (Settings > Addons > Install from ZIP). Installez ensuite les dépendences depuis l'écan de l'adddon (My addons > Video addons > Orange TV France > Dependencies).
Cet addon inclue :
- la télé en direct dans Kodi TV (en utilisant [IPTV Simple PVR](https://github.com/kodi-pvr/pvr.iptvsimple))
- les programmes en replay
- l'accès aux chaînes payantes qui font partie de votre souscription (pour le direct et le replay)

L'intégration à la télévision sur Kodi se fait via [IPTV Manager](https://github.com/add-ons/service.iptv.manager). Vous pouvez l'installer et l'activer directement depuis les réglages de l'addon. Une fois configuré, les chaînes et le programme TV se chargent automatiquement.
## Installation
Orange TV France est disponible directement depuis le dépôt principal de Kodi. L'intégration à la télévision sur Kodi se fait via [IPTV Manager](https://github.com/add-ons/service.iptv.manager). Vous pouvez l'installer et l'activer directement depuis les réglages de l'addon. Une fois configuré, les chaînes et le programme TV se chargent automatiquement.

Vous devriez maintenant voir toutes les chaînes regroupées par categories dans la section TV. S'il n'est pas déjà installé, Kodi vous demandera d'installer l'outil de décryptage quand vous regarderez une chaîne pour la première fois.

N'oubliez pas de configurer IPTV Manager correctement et de sélectionner le bon fournisseur dans les paramètres !

Si vous avez besoin de la dernière version, vous pouvez toujours télécharger la dernière archive ZIP depuis [cette page](https://github.com/BreizhReloaded/plugin.video.orange.fr/releases/latest) et installez-la directement depuis Kodi (Settings > Addons > Install from ZIP). Installez ensuite les dépendences depuis l'écan de l'adddon (My addons > Video addons > Orange TV France > Dependencies).

## Fournisseurs disponibles
| Pays | Fournisseur | |
|:---------:|:------------------|:-|
| 🇫🇷 | Orange | |
| 🇫🇷 | Orange Caraïbe | |
| 🇫🇷 | Orange Réunion | merci à [@starmate](https://github.com/starmate) et [@sae-gfc](https://github.com/sae-gfc)

## Limites connues
- Cet addon ne propose pas le replay TV. Pour cela, vous pouvez aller voir du côté du très bon [Catch-up TV & More](https://github.com/Catch-up-TV-and-More/plugin.video.catchuptvandmore/)
- Qualité vidéo limitée à 720p en raison de limitations techniques du côté d'Orange (ils ne proposent pas plus sur leur plateforme web)
## Limitations connues
- Qualité vidéo limitée à 720p, Orange ne propose pas plus sur leur plateforme web
- Ne fonctionne que depuis les zones listées et testées (pour le moment France métropolitaine, Caraïbes Françaises et La Réunion)
45 changes: 4 additions & 41 deletions plugin.video.orange.fr/resources/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,11 @@

import sys

import lib.routes # noqa: F401
import xbmc
import xbmcplugin
from lib.channelmanager import ChannelManager
from lib.iptvmanager import IPTVManager
from lib.utils.xbmctools import log, ok_dialog
from routing import Plugin

router = Plugin()


@router.route("/")
def index():
"""Display a welcome message."""
log("Hello from plugin.video.orange.fr", xbmc.LOGINFO)
ok_dialog("Hello from plugin.video.orange.fr")


@router.route("/channels/<channel_id>")
def channel(channel_id: str):
"""Load stream for the required channel id."""
log(f"Loading channel {channel_id}", xbmc.LOGINFO)
listitem = ChannelManager().load_channel_listitem(channel_id)
if listitem is not None:
xbmcplugin.setResolvedUrl(router.handle, True, listitem=listitem)


@router.route("/iptv/channels")
def iptv_channels():
"""Return JSON-STREAMS formatted data for all live channels."""
log("Loading channels for IPTV Manager", xbmc.LOGINFO)
port = int(router.args.get("port")[0])
IPTVManager(port).send_channels()


@router.route("/iptv/epg")
def iptv_epg():
"""Return JSON-EPG formatted data for all live channel EPG data."""
log("Loading EPG for IPTV Manager")
port = int(router.args.get("port")[0])
IPTVManager(port).send_epg()

from lib.router import init_router
from lib.utils.kodi import log

if __name__ == "__main__":
log(sys.version, xbmc.LOGDEBUG)
router.run()
init_router()
32 changes: 0 additions & 32 deletions plugin.video.orange.fr/resources/lib/channelmanager.py

This file was deleted.

7 changes: 7 additions & 0 deletions plugin.video.orange.fr/resources/lib/managers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Managers."""

from .catchup_manager import CatchupManager
from .iptv_manager import IPTVManager
from .stream_manager import StreamManager

__all__ = ["CatchupManager", "IPTVManager", "StreamManager"]
54 changes: 54 additions & 0 deletions plugin.video.orange.fr/resources/lib/managers/catchup_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Catchup TV Manager."""

import xbmc
import xbmcplugin

from lib.providers import get_provider
from lib.router import router
from lib.utils.gui import create_directory_items
from lib.utils.kodi import build_addon_url


class CatchupManager:
"""Navigate through catchup TV content."""

def __init__(self):
"""Initialize Catchup Manager object."""
self.provider = get_provider()

def get_channels(self) -> list:
"""Return channels available for catchup TV."""
channels = self.provider.get_catchup_channels()
directory_items = create_directory_items(channels)

succeeded = xbmcplugin.addDirectoryItems(router.handle, directory_items, len(directory_items))
xbmcplugin.endOfDirectory(router.handle, succeeded)

def get_categories(self, catchup_channel_id: str) -> list:
"""Return content categories for the required channel."""
categories = self.provider.get_catchup_categories(catchup_channel_id)
directory_items = create_directory_items(categories)

succeeded = xbmcplugin.addDirectoryItems(router.handle, directory_items, len(directory_items))
xbmcplugin.endOfDirectory(router.handle, succeeded)

def get_articles(self, catchup_channel_id: str, category_id: str) -> list:
"""Return content (TV show, movie, etc) for the required channel and category."""
articles = self.provider.get_catchup_articles(catchup_channel_id, category_id)
directory_items = create_directory_items(articles)

succeeded = xbmcplugin.addDirectoryItems(router.handle, directory_items, len(directory_items))
xbmcplugin.endOfDirectory(router.handle, succeeded)

def get_videos(self, catchup_channel_id: str, article_id: str) -> list:
"""Return the video list for the required show."""
videos = self.provider.get_catchup_videos(catchup_channel_id, article_id)
directory_items = create_directory_items(videos)

succeeded = xbmcplugin.addDirectoryItems(router.handle, directory_items, len(directory_items))
xbmcplugin.endOfDirectory(router.handle, succeeded)

def play_video(self, video_id: str):
"""Play catchup video."""
player = xbmc.Player()
player.play(build_addon_url(f"/catchup-streams/{video_id}"))
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any, Callable

from lib.providers import get_provider
from lib.utils.cache import use_cache


class IPTVManager:
Expand All @@ -30,11 +31,12 @@ def send(self) -> None:
return send

@via_socket
def send_channels(self):
@use_cache("streams.json")
def send_channels(self) -> dict:
"""Return JSON-STREAMS formatted python datastructure to IPTV Manager."""
return dict(version=1, streams=self.provider.get_streams())

@via_socket
def send_epg(self):
def send_epg(self) -> dict:
"""Return JSON-EPG formatted python data structure to IPTV Manager."""
return dict(version=1, epg=self.provider.get_epg())
48 changes: 48 additions & 0 deletions plugin.video.orange.fr/resources/lib/managers/stream_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Video stream manager."""

import inputstreamhelper
import xbmcgui
import xbmcplugin

from lib.providers import get_provider
from lib.router import router
from lib.utils.gui import create_video_item
from lib.utils.kodi import localize, ok_dialog


class StreamManager:
"""Load streams based using active provider."""

def __init__(self):
"""Initialize Stream Manager object."""
self.provider = get_provider()

def load_live_stream(self, stream_id: str) -> xbmcgui.ListItem:
"""Load live TV stream."""
stream_info = self.provider.get_live_stream_info(stream_id)
if not stream_info:
ok_dialog(localize(30900))
return

is_helper = inputstreamhelper.Helper(stream_info["manifest_type"], drm=stream_info["drm"])
if not is_helper.check_inputstream():
ok_dialog(localize(30901))
return

list_item = create_video_item(stream_info)
xbmcplugin.setResolvedUrl(router.handle, True, list_item)

def load_chatchup_stream(self, stream_id: str) -> xbmcgui.ListItem:
"""Load catchup TV stream."""
stream_info = self.provider.get_catchup_stream_info(stream_id)
if not stream_info:
ok_dialog(localize(30900))
return

is_helper = inputstreamhelper.Helper(stream_info["manifest_type"], drm=stream_info["drm"])
if not is_helper.check_inputstream():
ok_dialog(localize(30901))
return

list_item = create_video_item(stream_info)
xbmcplugin.setResolvedUrl(router.handle, True, list_item)
5 changes: 2 additions & 3 deletions plugin.video.orange.fr/resources/lib/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import xbmc

from lib.utils.xbmctools import get_addon_setting, log
from lib.utils.kodi import get_addon_setting, log

from .cache_provider import CacheProvider
from .fr import OrangeCaraibeProvider, OrangeFranceProvider, OrangeReunionProvider
from .provider_interface import ProviderInterface

Expand All @@ -26,4 +25,4 @@

def get_provider() -> ProviderInterface:
"""Return the selected provider."""
return CacheProvider(_PROVIDER)
return _PROVIDER
Loading

0 comments on commit ae622d7

Please sign in to comment.