Skip to content

Commit

Permalink
[plugin.video.orange.fr] 2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
f-lawe committed Aug 9, 2024
1 parent 3f62366 commit 9f7b9db
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 127 deletions.
14 changes: 14 additions & 0 deletions plugin.video.orange.fr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# 2.x

## [2.1.4](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.1.4) - 2024-08-08

## Changed
- Better UI items management

### Fixed
- InputStream Helper is now called properly ([#50](https://github.com/f-lawe/plugin.video.orange.fr/issues/50))
- Avoid plugin to be run twice on catchup TV videos ([#55](https://github.com/f-lawe/plugin.video.orange.fr/issues/55))

## [2.1.3](https://github.com/f-lawe/plugin.video.orange.fr/releases/tag/v2.1.3) - 2024-07-21

### Fixed
- IPTV Manager should now detects Orange TV France from clean install

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

### Changed
Expand Down
4 changes: 2 additions & 2 deletions plugin.video.orange.fr/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) BreizhReloaded.
Copyright (c) François Lavaud-Wernert.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
6 changes: 6 additions & 0 deletions plugin.video.orange.fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ If you need the latest update, you can download the latest ZIP archive from the
## Known limitations
- 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)

## Sponsorship
You like this project? Help me working on it!

[![Donate with PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=PNVV6FEQU94JG)

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.1.3" provider-name="Flawe">
<addon id="plugin.video.orange.fr" name="Orange TV France" version="2.1.4" provider-name="Flawe">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="script.module.routing" version="0.2.3"/>
Expand Down
5 changes: 5 additions & 0 deletions plugin.video.orange.fr/doc/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ Si vous avez besoin de la dernière version, vous pouvez toujours télécharger
## 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)

## Sponsoring
Vous aimez ce projet ? Aidez-moi à travailler dessus !

[![Donate with PayPal](https://www.paypalobjects.com/fr_FR/i/btn/btn_donate_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=PNVV6FEQU94JG)
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Kodi Media Center language file
# Addon Name: Orange TV France
# Addon id: plugin.video.orange.fr
# Addon Provider: BreizhReloaded
# Addon Provider: Flawe
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: BreizhReloaded\n"
"Last-Translator: Flawe\n"
"Language-Team: English\n"
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand All @@ -23,17 +23,25 @@ msgid "Install IPTV Manager…"
msgstr ""

msgctxt "#30102"
msgid "Help 30104"
msgstr "
msgid "Help 30102"
msgstr ""

msgctxt "#30103"
msgid "Go to IPTV Manager settings…"
msgid "Enable IPTV Manager integration"
msgstr ""

msgctxt "#30104"
msgid "Help 30104"
msgstr ""

msgctxt "#30105"
msgid "Go to IPTV Manager settings…"
msgstr ""

msgctxt "#30106"
msgid "Help 30106"
msgstr ""

# Provider settings (from 30200 to 30299)

msgctxt "#30200"
Expand Down Expand Up @@ -103,7 +111,3 @@ msgstr ""
msgctxt "#30901"
msgid "InputStream cannot be loaded."
msgstr ""

msgctxt "#30902"
msgid "Orange TV France must be used from the Kodi TV section."
msgstr ""
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Kodi Media Center language file
# Addon Name: Orange TV France
# Addon id: plugin.video.orange.fr
# Addon Provider: BreizhReloaded
# Addon Provider: Flawe
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: BreizhReloaded\n"
"Last-Translator: Flawe\n"
"Language-Team: Français\n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand All @@ -23,17 +23,25 @@ msgid "Install IPTV Manager…"
msgstr "Installer IPTV Manager…"

msgctxt "#30102"
msgid "Help 30104"
msgid "Help 30102"
msgstr ""

msgctxt "#30103"
msgid "Go to IPTV Manager settings…"
msgstr "Ouvrir les paramètres de IPTV Manager"
msgid "Enable IPTV Manager integration"
msgstr "Activer l'intégration avec IPTV Manager"

msgctxt "#30104"
msgid "Help 30104"
msgstr ""

msgctxt "#30105"
msgid "Go to IPTV Manager settings…"
msgstr "Ouvrir les paramètres de IPTV Manager…"

msgctxt "#30106"
msgid "Help 30106"
msgstr ""

# Provider settings (from 30200 to 30299)

msgctxt "#30200"
Expand Down Expand Up @@ -63,8 +71,8 @@ msgid "Proxy"
msgstr "Proxy"

msgctxt "#30301"
msgid "Activer"
msgstr ""
msgid "Enable"
msgstr "Activer"

msgctxt "#30302"
msgid "Help 30302"
Expand Down Expand Up @@ -103,7 +111,3 @@ msgstr "Cette chaîne ne fait pas partie de votre abonnement."
msgctxt "#30901"
msgid "InputStream cannot be loaded."
msgstr "InputStream n'a pas pu être chargé."

msgctxt "#30902"
msgid "Orange TV France must be used from the Kodi TV section."
msgstr "Orange TV France doit être utilisé depuis la section TV de Kodi."
35 changes: 16 additions & 19 deletions plugin.video.orange.fr/resources/lib/managers/catchup_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""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
from lib.utils.gui import create_list_item


class CatchupManager:
Expand All @@ -19,36 +17,35 @@ def __init__(self):
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)
for channel in channels:
xbmcplugin.addDirectoryItem(router.handle, channel["path"], create_list_item(channel, True), True)

xbmcplugin.endOfDirectory(router.handle)

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)
for category in categories:
xbmcplugin.addDirectoryItem(router.handle, category["path"], create_list_item(category, True), True)

xbmcplugin.endOfDirectory(router.handle)

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)
for article in articles:
xbmcplugin.addDirectoryItem(router.handle, article["path"], create_list_item(article, True), True)

xbmcplugin.endOfDirectory(router.handle)

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)
for video in videos:
xbmcplugin.addDirectoryItem(router.handle, video["path"], create_list_item(video))

def play_video(self, video_id: str):
"""Play catchup video."""
player = xbmc.Player()
player.play(build_addon_url(f"/catchup-streams/{video_id}"))
xbmcplugin.endOfDirectory(router.handle)
38 changes: 17 additions & 21 deletions plugin.video.orange.fr/resources/lib/managers/stream_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""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.gui import create_play_item
from lib.utils.kodi import localize, ok_dialog


Expand All @@ -17,32 +16,29 @@ def __init__(self):
"""Initialize Stream Manager object."""
self.provider = get_provider()

def load_live_stream(self, stream_id: str) -> xbmcgui.ListItem:
def load_live_stream(self, stream_id: str) -> None:
"""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
self._load_stream(stream_info)

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

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

def _load_stream(self, stream_info: dict = None) -> None:
"""Load stream."""
if stream_info is None:
ok_dialog(localize(30900))
xbmcplugin.setResolvedUrl(router.handle, False)
return

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

if is_helper.check_inputstream():
play_item = create_play_item(stream_info, is_helper.inputstream_addon)
xbmcplugin.setResolvedUrl(router.handle, True, play_item)
return

list_item = create_video_item(stream_info)
xbmcplugin.setResolvedUrl(router.handle, True, list_item)
ok_dialog(localize(30901))
xbmcplugin.setResolvedUrl(router.handle, False)
Loading

0 comments on commit 9f7b9db

Please sign in to comment.