06.7.2017, 21:01
Pokračoval jsme v řešení přenosu kategorií do Tvheadend a Kodi. Vytvořil jsem soubor category.ini (je přiložen v zip), který obsahuje všechny kategorie, které zná Tvheadend (anglické názvy jsou vytažené ze zdrojových souborů) a pro ty kategorie, které jsem potřeboval, jsem nahradil symbolické označení kategorií českým textem. Tyto řádky je možné vložit do příslušných *.ini souborů WG++ a po grabování bude zaručeno, že se kategorie přejmenují do správného anglického tvaru a rozpoznají a přenesou i do Tvheadend a do Kodi. Poprvé, co se zedituje *.ini soubor, a po každé změně v kategoriích, je třeba spustit grabování s parametrem "f" (<update>f</update>). Pokud se to neprovede a proběhne jenom inkrementální grabování, tak se nové kategorie objeví pouze u nově přidaných pořadů.
Pozn. Po této úpravě se doba grabování opět prodlouží. Vhodné si tedy vyzkoušet, jak dlouho typicky trvá a podle toho si nastavit další kroky. Pokud máte LibreELEC a používáte tedy addon WebGrab+Plus (repozitář LibreELEC Add-ons), tak grabování spustíte "ručně" z příkazové řádky zadáním:
/storage/.kodi/addons/service.webgrabplus/bin/webgrabplus.run
Obsah mého tv.sms.cz.m.ini souboru po přidání příkazů pro překlad názvů kategorií (category.modify...):
Pozn. Po této úpravě se doba grabování opět prodlouží. Vhodné si tedy vyzkoušet, jak dlouho typicky trvá a podle toho si nastavit další kroky. Pokud máte LibreELEC a používáte tedy addon WebGrab+Plus (repozitář LibreELEC Add-ons), tak grabování spustíte "ručně" z příkazové řádky zadáním:
/storage/.kodi/addons/service.webgrabplus/bin/webgrabplus.run
Obsah mého tv.sms.cz.m.ini souboru po přidání příkazů pro překlad názvů kategorií (category.modify...):
Kód:
**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: tv.sms.cz.m
* @MinSWversion: V1.1.1/55.1
* @Revision 4 - [09/11/2015] Francis De Paemeleere
* - disable the .channels.xml generation
* @Revision 3 - [03/11/2015] Jan van Straaten
* - fix of start time, timezone
* @Revision 2 - [22/11/2013] Peter Fuzek
* - less unnecessary updates
* @Revision 1 - [19/11/2013] Peter Fuzek
* - replaced show icons with higher resolution pictures
* @Revision 0 - [24/08/2013] Peter Fuzek / Francis De Paemeleere
* - creation
* @Remarks:
* @header_end
**------------------------------------------------------------------------------------------------
site {url=m.tv.sms.cz|timezone=Europe/Prague|maxdays=16|cultureinfo=cs-CZ|charset=windows-1250|titlematchfactor=50|episodesystem=xmltv_ns}
url_index{url|http://m.tv.sms.cz/index.php?den=|urldate|&stanice=|channel|&cas=0}
urldate.format {datestring|yyyy-MM-dd}
index_showsplit.scrub {multi|id='obsah'|<div class='porad'||id='preddal'}
index_start.scrub {regex(pattern="HH.mm")||>(\d{2}\.\d{2})<||}
index_title.scrub {single(include=2)|<a class='nazev'|>|<|</a>}
index_urlshow {url||<a class='nazev'|href='|'><div style|}
index_urlchannellogo.scrub {single|<div class='logo_out'|src='|'|</div>}
scope.range{(indexshowdetails)|end}
index_title.modify {remove(type=regex)|"(\([0-9]*?\))$"} * remove any episode info from the title
index_title.modify {remove(type=regex)|"(\([0-9]*?/[0-9]*?\))$"} * remove any episode info from the title
index_title.modify {cleanup}
index_title.modify {remove(type=regex)|" (X{0,3})(IX\|IV\|V?I{0,3})$"} *remove roman numerals
index_title.modify {cleanup}
end_scope
title.scrub {single|<div class="nadpis_detail">|||</div>}
title.scrub {single|<div class='nadpis_detail'>|||</div>}
episode.scrub {single|díl: |||)}
description.scrub {multi|class="popis|<div class="nadpis_scroll">|<div>|<div class='program'>}
director.scrub {multi(separator=",")|<strong>Režie:</strong>||</div>|</div>}
actor.scrub {multi(separator=",")|<strong>Hrají:</strong>||</div>|</div>}
category.scrub {multi(separator="/")|<strong>Žánr:</strong>||<|<}
productiondate.scrub {single|<strong>Year:</strong>||<|<}
showicon.scrub {single|<div class="detail_foto_in">|src="|"|</div>|}
showicon.modify {replace|/100/|/600/}
scope.range{(showdetails)|end}
title.modify {cleanup(tags="<"">")}
title.modify {cleanup}
* temp_1 = season
* temp_2 = episode
* temp_3 = number of seasons
* temp_4 = number of episodes
episode.modify {cleanup(tags="<"">")}
temp_1.modify {substring(type=regex)|'episode' "\(([0-9]*?)\. série.*?\)$"}
temp_2.modify {substring(type=regex)|'episode' "\(.*?([0-9]*?)\. díl\)$"}
temp_2.modify {substring(="" type=regex)|'title' "\(([0-9]*?)\)$"}
temp_2.modify {substring(="" type=regex)|'title' "\(([0-9]*?)/[0-9]*?\)$"}
temp_4.modify {substring(="" type=regex)|'title' "\([0-9]*?/([0-9]*?)\)$"}
temp_1.modify {calculate(not="" format=F0)|1 -}
temp_2.modify {calculate(not="" format=F0)|1 -}
subtitle.modify {substring(type=regex)|'episode' "^(.*)\(.*?\)$"}
episode.modify {clear}
episode.modify {addend('temp_1' not="")|'temp_1'}
episode.modify {addend('temp_3' not="")|/'temp_3'}
episode.modify {addend|.}
episode.modify {addend('temp_2' not="")|'temp_2'}
episode.modify {addend('temp_4' not="")|/'temp_4'}
episode.modify {addend|.}
episode.modify {clear(="..")}
title.modify {remove(type=regex)|"(díl\: .*?)$"} * remove any episode info from the title
title.modify {remove(type=regex)|"^(Seriál: )"}
title.modify {remove(type=regex)|"(\([0-9]*?\))$"} * remove any episode info from the title
title.modify {remove(type=regex)|"(\([0-9]*?/[0-9]*?\))$"} * remove any episode info from the title
title.modify {cleanup}
description.modify {substring(type=regex)|"^(?:.*?</div>(.*?</div>))"} * only get the info, not the description titles
description.modify {replace|">...</span>|">}
description.modify {cleanup(tags="<"">")}
actor.modify {remove| a další}
category.modify {replace|drama|Movie / Drama}
category.modify {replace|krimi|Detective / Thriller}
category.modify {replace|thriller|Detective / Thriller}
category.modify {replace|dobrodružný|Adventure / Western / War}
category.modify {replace|akční|Adventure / Western / War}
category.modify {replace|sci-fi|Sciencefiction / Fantasy / Horror}
category.modify {replace|fantasy|Sciencefiction / Fantasy / Horror}
category.modify {replace|horor|Sciencefiction / Fantasy / Horror}
category.modify {replace|mytseriozní|Sciencefiction / Fantasy / Horror}
category.modify {replace|komedie|Comedy}
category.modify {replace|romantický|Romance}
category.modify {replace|historický|Serious / Classical / Religious / Historicalmovie / Drama}
category.modify {replace|rodinný|Film / Cinema}
category.modify {replace|dokument|Documentary}
category.modify {replace|sport|Sports}
category.modify {replace|animovaný|Cartoons / Puppets}
category.modify {replace|hudební|Music / Ballet / Dance}
category.modify {replace|fitnes a zdraví|Fitnessandhealth}
category.modify {replace|vaření|Cooking}
category.modify {replace|reklama|Advertisement / Shopping}
category.modify {replace|nakupování|Advertisement / Shopping}
category.modify {replace|zahradničení|Gardening}
end_scope
*** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
*** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
***
*** @auto_xml_channel_start
*url_index{url|http://m.tv.sms.cz/?cas=0&zmen_stanice=true}
*index_site_id.scrub {multi(includeblock="title=")|<div class='stanice'|value='|'|}
*index_site_channel.scrub {multi(includeblock="title=")|<div class='stanice'|class='nazev'>|<|}
*scope.range {(channellist)|end}
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
*end_scope
*** @auto_xml_channel_end