From 9667591332047b34b5722738c2d78f4e7bf7f939 Mon Sep 17 00:00:00 2001 From: awiouy Date: Tue, 29 Aug 2017 21:24:39 +0200 Subject: [PATCH] webgrabplus: update to 2.1.5_beta --- .../addons/service/webgrabplus/changelog.txt | 3 + .../addons/service/webgrabplus/package.mk | 11 +- .../webgrabplus/source/bin/webgrabplus.init | 77 ++++++++++ .../webgrabplus/source/bin/webgrabplus.run | 39 +---- .../webgrabplus/source/bin/webgrabplus.start | 7 +- .../source/config/WebGrab++.config.xml | 25 +++ .../source/config/mdb/mdb.config.xml | 145 ++++++++++++++++++ .../source/config/rex/rex.config.xml | 126 +++++++++++++++ .../service/webgrabplus/source/default.py | 20 ++- .../resources/language/English/strings.po | 4 + .../webgrabplus/source/resources/settings.xml | 1 + .../webgrabplus/source/settings-default.xml | 1 + 12 files changed, 416 insertions(+), 43 deletions(-) create mode 100644 packages/addons/service/webgrabplus/source/bin/webgrabplus.init create mode 100755 packages/addons/service/webgrabplus/source/config/WebGrab++.config.xml create mode 100755 packages/addons/service/webgrabplus/source/config/mdb/mdb.config.xml create mode 100755 packages/addons/service/webgrabplus/source/config/rex/rex.config.xml diff --git a/packages/addons/service/webgrabplus/changelog.txt b/packages/addons/service/webgrabplus/changelog.txt index ccadc446ad..3b0a72839d 100644 --- a/packages/addons/service/webgrabplus/changelog.txt +++ b/packages/addons/service/webgrabplus/changelog.txt @@ -1,3 +1,6 @@ +105 +- Upgrade WebGrab!Plus to 2.1.5_beta + 104 - Upgrade siteini.pack to 20161021 - Add system.d timer diff --git a/packages/addons/service/webgrabplus/package.mk b/packages/addons/service/webgrabplus/package.mk index 901eeb5a3f..f491d07f5a 100644 --- a/packages/addons/service/webgrabplus/package.mk +++ b/packages/addons/service/webgrabplus/package.mk @@ -1,6 +1,6 @@ ################################################################################ # This file is part of LibreELEC - https://libreelec.tv -# Copyright (C) 2016 Team LibreELEC +# Copyright (C) 2016-present Team LibreELEC # # LibreELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,12 +17,13 @@ ################################################################################ PKG_NAME="webgrabplus" -PKG_VERSION="56.29pre-20161021" -PKG_REV="104" +PKG_VERSION="2.1.5_beta" +PKG_REV="105" PKG_ARCH="any" PKG_LICENSE="prop." PKG_SITE="http://www.webgrabplus.com/" -PKG_URL="https://github.com/awiouy/webgrabplus/archive/$PKG_VERSION.tar.gz" +PKG_URL="http://webgrabplus.com/sites/default/files/download/SW/V2.1.5/WebGrabPlus_V2.1.5_beta_install.tar.gz" +PKG_SOURCE_DIR=".wg++" PKG_DEPENDS_TARGET="toolchain" PKG_SECTION="service" PKG_SHORTDESC="WebGrab+Plus: a multi-site incremental xmltv epg grabber" @@ -45,5 +46,5 @@ makeinstall_target() { addon() { mkdir -p $ADDON_BUILD/$PKG_ADDON_ID - cp -PR $PKG_BUILD/* $ADDON_BUILD/$PKG_ADDON_ID + cp -r $PKG_BUILD/bin $ADDON_BUILD/$PKG_ADDON_ID } diff --git a/packages/addons/service/webgrabplus/source/bin/webgrabplus.init b/packages/addons/service/webgrabplus/source/bin/webgrabplus.init new file mode 100644 index 0000000000..1a02ae35ab --- /dev/null +++ b/packages/addons/service/webgrabplus/source/bin/webgrabplus.init @@ -0,0 +1,77 @@ +#!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +. /etc/profile +oe_setup_addon service.webgrabplus + +dir_bup=".backup" +dir_cfg="$ADDON_DIR/config/" +dir_sip="siteini.pack" +dir_siu="siteini.user" +dir_tmp="/tmp/wgp" +sip_ver="siteini.version" +url_ver="http://www.webgrabplus.com/sites/default/files/download/ini/latest_version.txt" +url_zip="http://webgrabplus.com/sites/default/files/download/ini/SiteIniPack_current.zip" + +cd "$ADDON_HOME" + +# Hack to not test the patience of beta testers +old_ver="version.siteini" +if [ -f "$old_ver" ]; then + mv "$old_ver" "$sip_ver" +fi + +if [ ! -d "$dir_bup" -a ! -f "$sip_ver" ]; then + for i in "mdb" "rex" "siteini.pack" "WebGrab++.config.xml"; do + if [ -e "$i" ]; then + mkdir -p "$dir_bup" + mv "$i" "$dir_bup" + echo "Moved obsolete $i to $dir_bup" + fi + done +fi + +mkdir -p "$dir_sip" +mkdir -p "$dir_siu" +touch "$sip_ver" + +for s in $(find "$dir_cfg" -type f); do + f="${s#$dir_cfg}" + if [ ! -f "$f" ]; then + d="$(dirname $f)" + mkdir -p "$d" + cp "$s" "$d" + echo "Created default $f" + fi +done + +ver_cur="$(wget $url_ver -qO -)" +ver_ins="$(cat $sip_ver)" + +if [ "$ver_cur" != "$ver_ins" ]; then + rm -fr "$dir_tmp" + mkdir -p "$dir_tmp" + wget "$url_zip" -qP "$dir_tmp" && \ + unzip -q "$dir_tmp/*.zip" -d "$dir_tmp" && \ + rm -rf siteini.pack && \ + mv "$dir_tmp/siteini.pack" . && \ + echo "$ver_cur" > "$sip_ver" && \ + echo "Updated siteini.pack to $ver_cur" + rm -fr "$dir_tmp" +fi diff --git a/packages/addons/service/webgrabplus/source/bin/webgrabplus.run b/packages/addons/service/webgrabplus/source/bin/webgrabplus.run index ce6ea05b4d..f78370a03b 100644 --- a/packages/addons/service/webgrabplus/source/bin/webgrabplus.run +++ b/packages/addons/service/webgrabplus/source/bin/webgrabplus.run @@ -1,7 +1,7 @@ #!/bin/sh ################################################################################ # This file is part of LibreELEC - https://libreelec.tv -# Copyright (C) 2016 Team LibreELEC +# Copyright (C) 2016-present Team LibreELEC # # LibreELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,41 +31,10 @@ wgp_user () { fi } -mkdir -p "$ADDON_HOME" +webgrabplus.init + cd "$ADDON_HOME" -for p in chans2correct.xml mdb rex siteini.pack WebGrab++.config.xml -do - if [ ! -e "$p" ] - then - cp -r "$ADDON_DIR/config/$p" . - fi -done - -sid="$(basename $(find $ADDON_DIR/config/siteini.pack -name SiteIni.Pack_*.txt))" -sih="$(basename $(find siteini.pack -name SiteIni.Pack_*.txt))" -if [ "$sid" \> "$sih" ] -then - rm -rf siteini.pack - cp -r "$ADDON_DIR/config/siteini.pack" . -fi - wgp_user "pre-processing" "$ADDON_HOME/before.sh" - -mono $ADDON_DIR/WebGrab+Plus/WebGrab+Plus.exe - -if [ -f guide_mdb.xml ] -then - cp guide_mdb.xml guide_wgp.xml - rm guide_mdb.xml -fi - -cp guide_wgp.xml guide_xtc.xml -mono $ADDON_DIR/WebGrab+Plus/xmltv_time_correct.exe guide_wgp.xml guide_xtc.xml < /dev/zero - -cp guide_xtc.xml guide.xml -rm guide_xtc.xml - -mono $ADDON_DIR/WebGrab+Plus/WG2MP.exe guide.xml mediaportal.xml - +mono "$ADDON_DIR/bin/WebGrab+Plus.exe" "$PWD" wgp_user "post-processing" "$ADDON_HOME/after.sh" diff --git a/packages/addons/service/webgrabplus/source/bin/webgrabplus.start b/packages/addons/service/webgrabplus/source/bin/webgrabplus.start index 6ea408ab31..e364346195 100644 --- a/packages/addons/service/webgrabplus/source/bin/webgrabplus.start +++ b/packages/addons/service/webgrabplus/source/bin/webgrabplus.start @@ -1,7 +1,7 @@ #!/bin/sh ################################################################################ # This file is part of LibreELEC - https://libreelec.tv -# Copyright (C) 2016 Team LibreELEC +# Copyright (C) 2016-present Team LibreELEC # # LibreELEC is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,6 +20,9 @@ . /etc/profile oe_setup_addon service.webgrabplus +webgrabplus.init + [ "$wgp_on_act" ] && on_act="--on-active=$wgp_on_act" -systemd-run $on_act --on-calendar="$wgp_on_cal" --unit=webgrabplus /bin/sh $ADDON_DIR/bin/webgrabplus.run +systemd-run $on_act --on-calendar="$wgp_on_cal" --unit=webgrabplus \ + /usr/bin/nice -n "$wgp_nice" "$ADDON_DIR/bin/webgrabplus.run" diff --git a/packages/addons/service/webgrabplus/source/config/WebGrab++.config.xml b/packages/addons/service/webgrabplus/source/config/WebGrab++.config.xml new file mode 100755 index 0000000000..47239ad1ab --- /dev/null +++ b/packages/addons/service/webgrabplus/source/config/WebGrab++.config.xml @@ -0,0 +1,25 @@ + + + + + + guide.xml + + mdb + Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 + on + 4 + 0 + f + + + + Example + + diff --git a/packages/addons/service/webgrabplus/source/config/mdb/mdb.config.xml b/packages/addons/service/webgrabplus/source/config/mdb/mdb.config.xml new file mode 100755 index 0000000000..f4740feb79 --- /dev/null +++ b/packages/addons/service/webgrabplus/source/config/mdb/mdb.config.xml @@ -0,0 +1,145 @@ + + + + + + imdb.com.ask, imdb.com.imdb + + + guide.xml + + + mdb.xml + + + + + + + + + + +. The individual values will be listed with a (standard WG++ internal element separator) | as separator unless another separator is specified as follows: +'element-name(separator-string)' e.g. 'actor(, )' + - text and element-names can be linked together by enclosing them by {}. This will ensure that, when the element in it is empty, everything between the {} is ignored. E.g. {\nProduced in : ('productiondate')} + - the text in the xmltv-target elements may contain the following simple formatting : + - \n or \r to force a newline + - \t to add a tab +2. The allowed xmltv-target elements (the ones in the target file specified above) are : + (= special case : if the first mdb-title, which is the original showtitle, differs from the xmltv title it can be added to xmltv as extra 'original' title.) + <sub-title> + <desc> + <date> = the xmltv element name containing the productiondate + <star-rating> + <review> (=optional new xmltv element) + <director> e.g to add /substitute the (additional?) mdb-director + <actor> e.g to add /substitute the (additional?) mdb-actor + - IMPORTANT! : any of the above listed xmltv-target elements that is specified in this allocation specification, replaces the existing xmltv element and its content! +3. Supported element-names (from the existing xmltv listing, name definitions as in Appendix D) : + - 'title' 'description' 'starrating' 'subtitle' 'productiondate' 'category' 'director' 'actor' 'presenter' 'writer' 'composer' 'producer' 'rating' 'episode' 'review' 'subtitles' 'premiere' previously-shown' 'aspect' 'quality' +4. Supported MDB element-names + - 'mdb-title' : + If 'mdb-title' is used in the xmltv-target element <title>, it will only be added if different from the existing xmltv title (see 2. above) + If used in any of the other supported xmltv-target elements, there is no such restriction and it will be listed in any case. + - 'mdb-starrating' 'mdb-description' 'mdb-plot' 'mdb-commentsummary' +5. Attributes (might need completion) + - for each of the xmltv-elements the following attribute can be specified + (if not specified the existing one, if present in the xmltv, will be used) : + - lang for <title> and <desc> , default : no attribute + - system for <star-rating> , default : no attribute + - type for <review> , default: type="text" ]]> + + <!--mdb-starrating correction: +allows to convert the mdb-starrating into a value that suits a media-center starrating display. E.g. , the majority of the IMDb starrating values are between 4 (bad) and 8 (good) in a scale of 10. In a 5 star display system , like the one in MCE, there is too little difference between these values. +The following settings, first subtracts 4 from the grabbed mdb-starrating and multiplies the result by 1.2 with a maximum of 5 . That will convert the values above, in 0 (was 4) and 5 (was 8) + Default values: subtract="0" multiply="1" and max="10"--> + <mdb-starrating subtract="4" multiply="1.2" max="5" /> + + <!--The next two lines add mdb-title (if different) as an extra <title> element before the existing one: --> + <title lang="xx">'mdb-title' + 'title' + + + {'mdb-title'...}{[plot: 'mdb-plot']\n}'description'{\n[imdb description: 'mdb-description']} + + + 'starrating' + 'mdb-starrating' + + + + + {Viewers comments : 'mdb-commentsummary( ... )'} + {IMDb review: 'mdb-review'} + + + Disney Channel + RTL 4 + + diff --git a/packages/addons/service/webgrabplus/source/config/rex/rex.config.xml b/packages/addons/service/webgrabplus/source/config/rex/rex.config.xml new file mode 100755 index 0000000000..47d7731a41 --- /dev/null +++ b/packages/addons/service/webgrabplus/source/config/rex/rex.config.xml @@ -0,0 +1,126 @@ + + + + + + + guide.xml + + + + 'description'\n'actor' + The result is the existing 'description' , followed by, on a newline, the actor(s) separated by the standard WG++ element separator | . + The result: + This is the original description. + Michael Douglas|Kim Basinger + + You probably don't like the | as separator between the actors, so you specify anther separator like this: + 'description'\n'actor(, )' + The result: + This is the original description. + Michael Douglas, Kim Basinger + + You can make this prettier by adding some text to the actors addition: + 'description'\nActors: 'actor(, )'. + The result: + This is the original description. + Actors: Michael Douglas, Kim Basinger. + + A small problem: Suppose the source xmltv show doesn't have any actors, then the result would be not so pretty: + This is the original description. + Actors: . + To avoid that, the added text can be linked to the element it must be added to, like this: + 'description'{\nActors: 'actor(, )'.} + Result with actors: + This is the original description. + Actors: Michael Douglas, Kim Basinger. + And without actors: + This is the original description. + + An example with some more elements: + 'description'{\n\tYear of production: 'productiondate'.}{\n\tProducer: 'producer(, )'.}{\n\tActors: 'actor(, )'.} + Result: + This is the original description. + Year of production: 2002. + Producer: Steven Spielberg. + Actors: Michael Douglas, Kim Basinger. + + And another one: + {Episode: 'episode'\t}'subtitle' + Result: + Episode: 3.2/12.1 The original subtitle + + You can also remove elements (but not the title!) from the xmltv listing by specifying an empty element, like this: + + This will remove all elements + And this: + + Will remove the element, including all its child elements like , etc. ]]> +. The individual values will be listed with a (standard WG++ internal element separator) | as separator unless another separator is specified as follows: +'element-name(separator-string)' e.g. 'actor(, )' + - text and element-names can be linked together by enclosing them by {}. This will ensure that, when the element in it is empty, everything between the {} is ignored. E.g. {\nProduced in : ('productiondate')} +- the text in the xmltv-target elements may contain the following simple formatting : + - \n or \r to force a newline + - \t to add a tab + +2. The allowed xmltv-target elements (the ones in the target file specified above) are : + + <sub-title> + <desc> + <date> = the xmltv element name containing the productiondate + <star-rating> + <review> (=optional new xmltv element) + <director> e.g to add /substitute the (additional?) mdb-director + <actor> e.g to add /substitute the (additional?) mdb-actor +- IMPORTANT! : any of the above listed xmltv-target elements that is specified in this allocation specification, replaces the existing xmltv element and its content! + +3. Supported element-names (from the existing xmltv listing, name definitions as in Appendix D) : + - 'title' 'description' 'starrating' 'subtitle' 'productiondate' 'category' 'director' 'actor' 'presenter' 'writer' 'composer' 'producer' 'rating' 'episode' 'review' 'subtitles' 'premiere' 'previously-shown' 'aspect' 'quality' + +4. Also supported are the additional elements created by the MDB-postprocessor. +- Important : This MDB-postprocessor automatically makes use of this REX-postprocessor. In that case the REX-postprocessor uses the allocation specification from the MDB config file mdb.config.xml and ignores the specification entered here. + - 'mdb-title' +(if used in the xmltv-target element <title> it will only be added if different from the existing xmltv title, see for more details mdb.config.xml) + - 'mdb-starrating' 'mdb-description' 'mdb-plot' 'mdb-commentsummary' 'mdb-review' + +5. Attributes (might need completion) + - for each of the xmltv-elements the following attribute can be specified + (if not specified, the existing one, if present in the xmltv, will be used) : + - lang for <title> and <desc> , default : no attribute + - system for <star-rating> , default : no attribute + - type for <review> , default: type="text"]]> + +<!--An example setting --> + <sub-title>{Episode: 'episode' }'subtitle'</sub-title> + <desc>'description'{\n\t¤ Produced in: 'productiondate'. }{¤ Category: 'category(, )'. }{\n\t¤ Actors: 'actor(, )'}{\n\t¤ Director: 'director(, )'}{\n\t¤ Presenter: 'presenter(, )'}</desc> + <credits></credits> + <episode-num></episode-num> + <date></date> + <category></category> + <review>{Ratings: 'rating(, )'.}</review> + <rating></rating> +</settings> diff --git a/packages/addons/service/webgrabplus/source/default.py b/packages/addons/service/webgrabplus/source/default.py index 2666e0f27c..cdf10779d2 100644 --- a/packages/addons/service/webgrabplus/source/default.py +++ b/packages/addons/service/webgrabplus/source/default.py @@ -1,3 +1,21 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>. +################################################################################ + import subprocess import xbmc import xbmcaddon @@ -13,5 +31,5 @@ class Monitor(xbmc.Monitor): subprocess.call(['systemctl', 'restart', self.id]) -if __name__ == "__main__": +if __name__ == '__main__': Monitor().waitForAbort() diff --git a/packages/addons/service/webgrabplus/source/resources/language/English/strings.po b/packages/addons/service/webgrabplus/source/resources/language/English/strings.po index 0ee6e10c44..fb383a64aa 100644 --- a/packages/addons/service/webgrabplus/source/resources/language/English/strings.po +++ b/packages/addons/service/webgrabplus/source/resources/language/English/strings.po @@ -12,3 +12,7 @@ msgstr "" msgctxt "#30002" msgid "--on-calendar" msgstr "" + +msgctxt "#30003" +msgid "Priority (nice, 0=max, 19=min)" +msgstr "" diff --git a/packages/addons/service/webgrabplus/source/resources/settings.xml b/packages/addons/service/webgrabplus/source/resources/settings.xml index 1ddacccab8..c0e62aa40a 100644 --- a/packages/addons/service/webgrabplus/source/resources/settings.xml +++ b/packages/addons/service/webgrabplus/source/resources/settings.xml @@ -3,5 +3,6 @@ <category label="30000"> <setting label="30001" id="wgp_on_act" type="number" default="300" /> <setting label="30002" id="wgp_on_cal" type="text" default="*-*-* 03:00:00" /> + <setting label="30003" id="wgp_nice" type="slider" default="10" range="0,1,19" option="int" /> </category> </settings> diff --git a/packages/addons/service/webgrabplus/source/settings-default.xml b/packages/addons/service/webgrabplus/source/settings-default.xml index 7c6826e537..f9c2020db9 100644 --- a/packages/addons/service/webgrabplus/source/settings-default.xml +++ b/packages/addons/service/webgrabplus/source/settings-default.xml @@ -1,4 +1,5 @@ <settings> + <setting id="wgp_nice" value="10" /> <setting id="wgp_on_act" value="300" /> <setting id="wgp_on_cal" value="*-*-* 03:00:00" /> </settings>