Skip to content

Commit

Permalink
Version 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paco8 committed May 3, 2024
1 parent 2ca372b commit 5170f76
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 22 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.4.16"
version="0.5.0"
provider-name="Paco8">
<requires>
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
Expand Down
12 changes: 12 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgctxt "#30004"
msgid "Subtitles"
msgstr ""

msgctxt "#30005"
msgid "Playback"
msgstr ""

# For Orange and Movistar only
msgctxt "#30010"
msgid "DRM type"
Expand Down Expand Up @@ -103,6 +107,14 @@ msgctxt "#30026"
msgid "Update interval (in seconds)"
msgstr ""

msgctxt "#30027"
msgid "Skip recaps"
msgstr ""

msgctxt "#30028"
msgid "Skip intros"
msgstr ""

# For SkyOTT only
msgctxt "#30031"
msgid "Streaming service"
Expand Down
12 changes: 12 additions & 0 deletions resources/language/resource.language.es_es/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgctxt "#30004"
msgid "Subtitles"
msgstr "Subtítulos"

msgctxt "#30005"
msgid "Playback"
msgstr "Reproducción"

msgctxt "#30010"
msgid "DRM type"
msgstr "Tipo de DRM"
Expand Down Expand Up @@ -93,6 +97,14 @@ msgctxt "#30026"
msgid "Update interval (in seconds)"
msgstr "Tiempo entre actualizaciones (en segundos)"

msgctxt "#30027"
msgid "Skip recaps"
msgstr "Saltar resúmenes"

msgctxt "#30028"
msgid "Skip intros"
msgstr "Saltar intros"

msgctxt "#30031"
msgid "Streaming service"
msgstr "Plataforma"
Expand Down
12 changes: 12 additions & 0 deletions resources/language/resource.language.hu_hu/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgctxt "#30004"
msgid "Subtitles"
msgstr "Feliratok"

msgctxt "#30005"
msgid "Playback"
msgstr ""

# For Orange and Movistar only
msgctxt "#30010"
msgid "DRM type"
Expand Down Expand Up @@ -103,6 +107,14 @@ msgctxt "#30026"
msgid "Update interval (in seconds)"
msgstr "Frissítési időköz (másodperc)"

msgctxt "#30027"
msgid "Skip recaps"
msgstr ""

msgctxt "#30028"
msgid "Skip intros"
msgstr ""

# For SkyOTT only
msgctxt "#30031"
msgid "Streaming service"
Expand Down
12 changes: 12 additions & 0 deletions resources/language/resource.language.pl_pl/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgctxt "#30004"
msgid "Subtitles"
msgstr "Napisy"

msgctxt "#30005"
msgid "Playback"
msgstr ""

# For Orange and Movistar only
msgctxt "#30010"
msgid "DRM type"
Expand Down Expand Up @@ -103,6 +107,14 @@ msgctxt "#30026"
msgid "Update interval (in seconds)"
msgstr "Częstotliwość aktualizacji (w sekundach)"

msgctxt "#30027"
msgid "Skip recaps"
msgstr ""

msgctxt "#30028"
msgid "Skip intros"
msgstr ""

# For SkyOTT only
msgctxt "#30031"
msgid "Streaming service"
Expand Down
63 changes: 44 additions & 19 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from .sky import *
from .addon import *
from .gui import *
from .user_agent import chrome_user_agent

# Get the plugin url in plugin:// notation.
_url = sys.argv[0]
Expand Down Expand Up @@ -94,6 +95,7 @@ def play(params):
url = '{}/?manifest={}'.format(proxy, url)

#url = 'http://ftp.itec.aau.at/datasets/DASHDataset2014/BigBuckBunny/10sec/BigBuckBunny_10s_onDemand_2014_05_09.mpd'
#url = 'https://rdmedia.bbc.co.uk/bbb/2/client_manifest-common_init.mpd'

play_item = xbmcgui.ListItem(path=url)
play_item.setProperty('inputstream.adaptive.manifest_type', 'mpd')
Expand All @@ -102,7 +104,7 @@ def play(params):
license_url = '{}/license?url={}||R{{SSM}}|'.format(proxy, quote_plus(data['license_url']))
LOG('license_url: {}'.format(license_url))
play_item.setProperty('inputstream.adaptive.license_key', license_url)
#play_item.setProperty('inputstream.adaptive.stream_headers', 'User-Agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0')
play_item.setProperty('inputstream.adaptive.stream_headers', 'User-Agent=' + chrome_user_agent)
#play_item.setProperty('inputstream.adaptive.server_certificate', certificate)
#play_item.setProperty('inputstream.adaptive.license_flags', 'persistent_storage')
#play_item.setProperty('inputstream.adaptive.license_flags', 'force_secure_decoder')
Expand Down Expand Up @@ -184,31 +186,54 @@ def play(params):
play_item.setContentLookup(False)
xbmcplugin.setResolvedUrl(_handle, True, listitem=play_item)

if addon.getSettingBool('send_progress') and slug:
# Control player
send_progress = addon.getSettingBool('send_progress')
skip_recap = addon.getSettingBool('skip_recap')
skip_intro = addon.getSettingBool('skip_intro')
LOG('markers: {}'.format(info.get('markers')))
if (send_progress or skip_recap or skip_intro) and slug:
from .player import SkyPlayer
player = SkyPlayer()
monitor = xbmc.Monitor()
last_pos = 0
total_time = 0
start_time = time.time()
interval = addon.getSettingInt('progress_interval')
if interval < 20: interval = 20
LOG('progress_interval: {}'.format(interval))

def check_marker(l_start, l_end, last_pos):
if l_start in info['markers'] and l_end in info['markers']:
s_start = int(info['markers'][l_start] / 1000)
s_end = int(info['markers'][l_end] / 1000) - 2
#LOG('s_start: {} s_end: {}'.format(s_start, s_end))
if last_pos > s_start:
if s_end - s_start > 10:
player.seekTime(s_end)
del info['markers'][l_start]
return

if send_progress:
last_pos = 0
total_time = 0
start_time = time.time()
interval = addon.getSettingInt('progress_interval')
if interval < 20: interval = 20
LOG('progress_interval: {}'.format(interval))
while not monitor.abortRequested() and player.running:
monitor.waitForAbort(10)
monitor.waitForAbort(2)
if player.isPlaying():
last_pos = player.getTime()
if total_time == 0: total_time = player.getTotalTime()
#LOG('**** position: {}'.format(last_pos))
if time.time() > (start_time + interval):
start_time = time.time()
LOG('**** {} {}'.format(info['provider_variant_id'], info['bookmark_metadata']))
sky.set_bookmark(info['provider_variant_id'], info['bookmark_metadata'], last_pos)
if send_progress:
if total_time == 0: total_time = player.getTotalTime()
#LOG('**** position: {}'.format(last_pos))
if time.time() > (start_time + interval):
start_time = time.time()
LOG('**** {} {}'.format(info['provider_variant_id'], info['bookmark_metadata']))
sky.set_bookmark(info['provider_variant_id'], info['bookmark_metadata'], last_pos)
if 'markers' in info:
if skip_recap: check_marker('SOR', 'EOR', last_pos)
if skip_intro: check_marker('SOI', 'EOI', last_pos)
LOG('**** playback finished')
LOG('**** last_pos: {} total_time: {}'.format(last_pos, total_time))
if (total_time - last_pos) < 20: last_pos = total_time
if last_pos > interval:
sky.set_bookmark(info['provider_variant_id'], info['bookmark_metadata'], last_pos)
if send_progress:
LOG('**** last_pos: {} total_time: {}'.format(last_pos, total_time))
if (total_time - last_pos) < 20: last_pos = total_time
if last_pos > interval:
sky.set_bookmark(info['provider_variant_id'], info['bookmark_metadata'], last_pos)


def add_videos(category, ctype, videos, from_watchlist=False, from_continue=False, updateListing=False, cacheToDisc=True):
Expand Down
8 changes: 6 additions & 2 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
<setting id="dolbyvision" type="bool" label="DolbyVision" default="false" visible="eq(-1,true)" subsetting="true"/>
<setting id="hdr10" type="bool" label="HDR10" default="false" visible="eq(-2,true)" subsetting="true"/>
<setting id="hdcp_enabled" type="bool" label="30037" default="false"/>
<setting id="send_progress" type="bool" label="30025" default="false"/>
<setting id="progress_interval" type="number" label="30026" default="120" visible="eq(-1,true)" subsetting="true"/>
<setting id="only_subscribed" type="bool" label="30017" default="false"/>
<setting label="30019" type="action" id="is_settings" action="Addon.OpenSettings(inputstream.adaptive)" enable="System.HasAddon(inputstream.adaptive)" option="close"/>
<setting type="sep"/>
<setting label="30450" type="action" id="donation" action="RunPlugin(plugin://plugin.video.skyott?action=show_donation_dialog)" option="close"/>
</category>
<category label="30005">
<setting id="send_progress" type="bool" label="30025" default="false"/>
<setting id="progress_interval" type="number" label="30026" default="120" visible="eq(-1,true)" subsetting="true"/>
<setting id="skip_recap" type="bool" label="30027" default="false"/>
<setting id="skip_intro" type="bool" label="30028" default="false"/>
</category>
<category label="30004">
<setting id="use_ttml2ssa" type="bool" label="$ADDON[script.module.ttml2ssa 32202]" default="false"/>
<setting id="ssa_settings" type="action" label="$ADDON[script.module.ttml2ssa 32201]" option="close" action="Addon.OpenSettings(script.module.ttml2ssa)" enable="eq(-1,true)" subsetting="true"/>
Expand Down

0 comments on commit 5170f76

Please sign in to comment.