﻿﻿﻿**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: programtv.onet.pl
* @MinSWversion: V3.2.3.7
* @Revision 4 - [18/02/2023] Blackbear199
*  - ini update
* @Revision 3 - [08/04/2018] Blackbear199
*  - add channel logo,showicon scrub change
* @Revision 2 - [26/09/2017] Blackbear199
*  - subtitle/titleoriginal better separation
* @Revision 1 - [12/06/2017] Blackbear199
*  - site update
* @Revision 0 - [29/03/2016] Blackbear199
*  - creation
* @Remarks:
* @header_end
**------------------------------------------------------------------------------------------------
site {url=programtv.onet.pl|timezone=Europe/Warsaw|maxdays=13|cultureinfo=pl-PL|charset=UTF-8|titlematchfactor=25|episodesystem=onscreen}
*
url_index{url|https://programtv.onet.pl/program-tv/|channel|?dzien=|urldate|}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
*
urldate.format {daycounter|0}
*
index_urlchannellogo {url||<span class="logoTV">|<img src="|"|</span>}
*
index_showsplit.scrub {multi|<div class="emissions">|<li class="hh|</li>|</ul>}
*index_showsplit.modify {(debug)}
*
index_urlshow {url|https://programtv.onet.pl|<a href="||">|">}
index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate}
*
index_urlchannellogo {url(include=first)|http:|<span class="logoTV">|<img src="|"|alt}
*
index_start.scrub {single|<span class="hour">||</span>|</span>}
index_title.scrub {single|<a href=|>|</a>|<span }
index_category.scrub {single|<span class="type">||</span>|</span>}
*
scope.range {(indexshowdetails)|end}
index_subtitle.modify {substring(type=regex)|'index_title' "\s*(?:\s*\d+)?,\s*odc\.\s*\d+(?:\/\d+)?.*$"}
index_title.modify {remove('index_subtitle' not "")|'index_subtitle'}
index_episode.modify {substring(pattern="S'S1' E'E1'/'Et1'""E'E1'/'Et1'""E'E1'"" type=regex)|'index_subtitle' "\s*(?:\s*\d+)?,\s*odc\.\s*\d+(?:\/\d+)?"}
index_subtitle.modify {remove('index_episode' not "")|'index_episode'}
if {('index_episode' not "")|end}
index_episode.modify {replace(type=regex)|"^([^\d]*)\d+,\s*odc"|S}
index_episode.modify {replace|, odc. |E}
end_if
index_subtitle.modify {remove(type=regex)|"^\s*[-:]\s*"}
index_title.modify {remove(type=regex)|"\s\(\d{4}\)"}
index_category.modify {cleanup(style=name)}
end_scope
*
titleoriginal.scrub {single(separator=", " include=first)|<h4>||</h4>|</h4>}
description.scrub {single|<p class="entryDesc">||</p>|</p>}
director.scrub {single(separator=", \n")|>Reżyseria:</li>|<li>|</li>|<li}
presenter.scrub {single(separator=", \n")|<li class="header">Gospodarze:</li>|<li>|</li>|</ul>}
actor.scrub {single(separator=", \n")|Obsada:</li>|<li>|</li>|</ul>}
writer.scrub {single(separator=", \n")|<li class="header">Scenariusz:</li>|<li>|</li>|</ul>}
starrating.scrub {multi|<span class="rating">Ocena</span>|<span class="stars stars|">|</span>|">}
rating.scrub {single|<span class="pegi pegi||"></span>|"></span>}
productiondate.scrub {single|"datePublished": "||"|"}
country.scrub {single|"countryOfOrigin": "||"|"}
showicon.scrub {single|<section class="colLeft|src="|"|</section>}
*
scope.range {(showdetails)|end}
title.modify {addstart|'index_title'}
titleoriginal.modify {remove(type=regex)|"\s\(\d{4}\)"}
titleoriginal.modify {addend(not "")|(lang=en)}
temp_1.modify {substring(type=regex)|'titleoriginal' ":([^:]+)$"}
if {('index_subtitle' "")|1}
subtitle.modify {set('temp_1' not "")|'temp_1'}
actor.modify {replace| (|(role=}
rating.modify {addend(not "")|+}
if {('starrating' not "")|2}
starrating.modify {calculate(format=F1)}
starrating.modify {addend|/10}
showicon.modify {addstart(not "")|https:}
end_scope
**  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _
**      #####  CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
**
** @auto_xml_channel_start
*url_index{url|http://programtv.onet.pl/stacje}
*index_site_channel.scrub {multi|<ul class="singleChannel letter_#">|title="|"|</div>}
*index_site_id.scrub {multi|<ul class="singleChannel letter_#">|<a href="/program-tv/|"|</div>}
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
** @auto_xml_channel_end
