Skip to content

Commit

Permalink
Version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco8 committed Jun 5, 2023
1 parent 5eb2091 commit 4e106f7
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.skyott"
name="Skyott"
version="0.3.11"
version="0.4.0"
provider-name="Paco8">
<requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
Expand Down
2 changes: 1 addition & 1 deletion resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ msgstr ""

# For SkyOTT only
msgctxt "#30040"
msgid "Use only for these languages (e.g.: es en pt):"
msgid "Use for these languages (e.g.: es en pt):"
msgstr ""

# For SkyOTT only
Expand Down
16 changes: 13 additions & 3 deletions resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ msgstr ""
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE\n"
"Language: en\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -122,9 +122,10 @@ msgctxt "#30037"
msgid "Enable HDCP"
msgstr "Habilitar HDCP"

# For SkyOTT only
msgctxt "#30040"
msgid "Use only for these languages (e.g.: es en pt):"
msgstr "Usar solo para estos idiomas (ej: es en pt):"
msgid "Use for these languages (e.g.: es en pt):"
msgstr "Usar para estos idiomas (ej: es en pt):"

# For SkyOTT only
msgctxt "#30041"
Expand Down Expand Up @@ -388,6 +389,11 @@ msgctxt "#30303"
msgid "IPTV Manager settings"
msgstr "Opciones de IPTV Manager"

# For Orange and Movistar only
msgctxt "#30304"
msgid "IPTV"
msgstr ""

msgctxt "#30305"
msgid "Export channels and EPG for IPTV automatically"
msgstr "Exportar automáticamente canales y guía para IPTV"
Expand Down Expand Up @@ -423,3 +429,7 @@ msgstr "Calificación: {}"
msgctxt "#30321"
msgid "Show age rating before playback"
msgstr "Mostrar la calificación de edades al empezar la reproducción"

#~ msgctxt "#30040"
#~ msgid "Use only for these languages (e.g.: es en pt):"
#~ msgstr "Usar solo para estos idiomas (ej: es en pt):"
9 changes: 7 additions & 2 deletions resources/language/resource.language.hu_hu/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ msgstr "HDCP engedélyezése"

# For SkyOTT only
msgctxt "#30040"
msgid "Use only for these languages (e.g.: es en pt):"
msgstr "Csak ezekhez a nyelvekhez használja (pl.: es en pt):"
msgid "Use for these languages (e.g.: es en pt):"
msgstr ""

# For SkyOTT only
msgctxt "#30041"
Expand Down Expand Up @@ -464,3 +464,8 @@ msgstr "Értékelés: {}"
msgctxt "#30321"
msgid "Show age rating before playback"
msgstr "Korhatár-besorolás megjelenítése lejátszás előtt"

# For SkyOTT only
#~ msgctxt "#30040"
#~ msgid "Use only for these languages (e.g.: es en pt):"
#~ msgstr "Csak ezekhez a nyelvekhez használja (pl.: es en pt):"
9 changes: 7 additions & 2 deletions resources/language/resource.language.pl_pl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ msgstr "Włączenie HDCP"

# For SkyOTT only
msgctxt "#30040"
msgid "Use only for these languages (e.g.: es en pt):"
msgstr "Użycie tylko dla tych języków (np. es en pt):"
msgid "Use for these languages (e.g.: es en pt):"
msgstr ""

# For SkyOTT only
msgctxt "#30041"
Expand Down Expand Up @@ -464,3 +464,8 @@ msgstr "Ocena: {}"
msgctxt "#30321"
msgid "Show age rating before playback"
msgstr "Pokaż ocenę wieku przed odtwarzaniem"

# For SkyOTT only
#~ msgctxt "#30040"
#~ msgid "Use only for these languages (e.g.: es en pt):"
#~ msgstr "Użycie tylko dla tych języków (np. es en pt):"
13 changes: 12 additions & 1 deletion resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def play(params):

if addon.getSettingBool('use_ttml2ssa') and slug:
# Convert subtitles
import re
from .parsemanifest import extract_tracks, download_split_subtitle
from ttml2ssa import Ttml2SsaAddon
ttml = Ttml2SsaAddon()
Expand All @@ -131,7 +132,9 @@ def play(params):
subpaths = []
tracks = extract_tracks(content)
filter_list = addon.getSetting('ttml2ssa_filter').lower().split()
subtracks = [t for t in tracks['subs'] if len(filter_list) == 0 or t['lang'][:2] in filter_list]
subtracks = []
if len(filter_list) > 0:
subtracks = [t for t in tracks['subs'] if t['lang'][:2] in filter_list]
for t in subtracks:
filename = subfolder + t['lang'][:2]
if t['value'] == 'caption': filename += ' [CC]'
Expand All @@ -143,6 +146,14 @@ def play(params):
else:
content = sky.net.load_url(os.path.join(baseurl, t['filename']))

# Add <i> and </i> for italics
content = re.sub(r'<c\.[^>]*font-style_italic[^>]*>(.*?)<\/c>', r'<i>\1</i>', content, flags=re.DOTALL)
# Remove remaining <c> tags
content = re.sub(r'<c\.[^>]*>|<\/c>', '', content)
# Add spaces before and after <i> </i> if necessary
content = re.sub(r'(?<![.,;:!?\-\s])<i>', r' <i>', content)
content = re.sub(r'</i>(?![.,;:!?\-\s])', r'</i> ', content)

#LOG(content.encode('utf-8'))
ttml.parse_vtt_from_string(content)
if subtype != 'srt':
Expand Down

0 comments on commit 4e106f7

Please # to comment.