**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: tvtv.co.uk
* @MinSWversion: 1.1.1/53
* @Revision 10 - [13/08/2018] fluffi444
* - changed from tvtv.de TO tvtv.co.uk
* @Revision 9 - [19/02/2015] Francis De Paemeleere
* - add region selectable channels (+ revert to xmltv_ns version)
* @Revision 8 - [14/08/2014] Jan van Straaten
* - added removeduplicates from showsplit, customheaders, timezone
* @Revision 7 - [21/06/2013] Jan van Straaten
* - improved episode and subtitle
* @Revision 6 - [05/04/2013] Jan van Straaten
* - for three weeks of epg
* @Revision 5 - [02/03/2013] Jan van Straaten
* - creation
* @Remarks:
* @header_end
**------------------------------------------------------------------------------------------------
site {url=tvtv.co.uk|timezone=MET|maxdays=21.3|cultureinfo=de-DE|charset=utf-8|titlematchfactor=90|episodesystem=xmltv_ns}
site {subtitlestype=Gehörlose}
url_index{url|http://www.tvtv.co.uk/senderlistings_channel.php?channel=##_CHANNEL_##&woche=|urldate}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
*http://www.tvtv.co.uk/senderlistings_channel.php?channel=ARD&woche=2
urldate.format {list|0|0|0|0|0|0|0|1|1|1|1|1|1|1|2|2|2|2|2|2|2}
scope.range {(urlindex)|end}
index_variable_element.modify {addstart|'config_site_id'}
index_variable_element.modify {substring(type=regex)|^(.*)_#region=}
url_index.modify {replace|##_CHANNEL_##|'index_variable_element'}
end_scope.range
*
index_showsplit.scrub {multi|
}
****
* The index page is a 21 days tvguide with the shows grouped in two hour fragments
* the order of these fragments is :
* week 1
* 0: fragment 1 day 1, 1: fragment 1 day 2, ....., 6: fragment 1 day 7.
* 7: fragment 2 day 1, 8: fragment 2 day 2, ....., 13: fragment 2 day 7.
* ...
* 77: fragment 12 day 1, 78: fragment 12 day 2, ....., 84: fragment 12 day 7.
* week 2
* fragment 1 day 8, fragment 1 day 9, ....., fragment 1 day 14.
* fragment 2 day 8, fragment 2 day 9, ....., fragment 2 day 14.
* ...
* fragment 12 day 8, fragment 12 day 9, ....., fragment 12 day 14.
* week 3
* fragment 1 day 15, fragment 1 day 16, ....., fragment 1 day 21.
* fragment 2 day 15, fragment 2 day 16, ....., fragment 2 day 21.
* ...
* fragment 12 day 15, fragment 12 day 16, ....., fragment 12 day 21.
*
scope.range {(splitindex)|end}
index_temp_6.modify {calculate(type=element format=F0)|'index_showsplit' #}
index_temp_6.modify {calculate(format=F0)|1 - 7 /} * we use this to determine how many weeks in the index page
* first sorting, time fragments of the days after each other, days still mixed up
index_temp_1.modify {substring(type=element)|'index_showsplit' 0 1/7} * all 12 fragments of day01|day08|day15
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 1 1/7} * all 12 fragments of day02|day09|day16
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 2 1/7} * all 12 fragments of day03|day10|day17
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 3 1/7} * all 12 fragments of day04|day11|day18
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 4 1/7} * all 12 fragments of day05|day12|day19
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 5 1/7} * all 12 fragments of day06|day13|day20
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_1.modify {substring(type=element)|'index_showsplit' 6 1/7} * all 12 fragments of day07|day14|day21
index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
index_temp_2.modify {addend|'index_temp_1'####}
index_temp_2.modify {replace|####|\|} * back to multi for operation substring
* Second sorting, order the days
index_showsplit.modify {clear}
* first week:
index_temp_3.modify {substring(type=element)|'index_temp_2' 0 12/'index_temp_6'} * all 12 fragments of day1,2,3,4,5,6,7
index_temp_3.modify {replace|\||####} * single again
index_showsplit.modify {addend|'index_temp_3'####}
* second week:
index_temp_3.modify {substring('index_temp_6' > "12" type=element)|'index_temp_2' 12 12/'index_temp_6'} * all 12 fragments of day8,9,10,11,12,13,14
index_temp_3.modify {replace('index_temp_6' > "12")|\||####} * single again
index_showsplit.modify {addend('index_temp_6' > "12")|'index_temp_3'####}
* third week
index_temp_3.modify {substring('index_temp_6' > "24" type=element)|'index_temp_2' 24 12/'index_temp_6'} * all 12 fragments of day15,16,17,18,19,20,21
index_temp_3.modify {replace('index_temp_6' > "24")|\||####} * single again
index_showsplit.modify {addend('index_temp_6' > "24")|'index_temp_3'####}
index_showsplit.modify {replace|####|\|} * all the 2 hour fragments sorted
*******
index_showsplit.modify {replace||\|} * split the individual shows within a 2 hour block
index_showsplit.modify {select|"title=" ~~} * select the real index shows
*
index_showsplit.modify {cleanup(removeduplicates span=1)}
index_variable_element.modify {clear}
index_variable_element.modify {addstart|'config_site_id'}
index_variable_element.modify {substring(type=regex)|_#region=(.*)}
* A channel has regional (duplicate) channels, just remove all (but one)
index_showsplit.modify {remove('index_variable_element' not="NOTUSED" type=regex)|^.*?(\s*\(\s*'index_variable_element'\s*\)\s*).*$} * remove the region id of the region we want to keep
index_showsplit.modify {remove(type=regex)|^.*?\s*\(\s*[^\)]*\s*\)\s*.*$} * remove all other regions
end_scope.range
*
scope.range {(indexshowdetails)|end}
index_temp_1.scrub {single(separator="', '" include=2)|openDetailPopup|(|);|}
index_urlshow.modify {addstart('index_temp_1' not "")|http://tvtv.co.uk/detailansicht.php?sendungs_id='index_temp_1'}
index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate}
*http://tvtv.co.uk/detailansicht.php?sendungs_id=216703670
index_urlchannellogo {url|http://tvtv.co.uk/| | | |}
end_scope
scope.range {(showdetails)|end}
title.scrub {single||class="DetailTitel">|| }
title.modify {cleanup}
titleoriginal.scrub {single||||}
subtitle.scrub {single(exclude="" separator="," exclude="Staffel""Folge")||||}
description.scrub {single||||}
description.scrub {single|||| }
description.modify {cleanup}
director.scrub {single||'">||}
actor.scrub {multi||'">||}
actor.modify {addend|>}
actor.modify {cleanup(tags="<"">")}
actor.modify {remove|>}
actor.modify {remove|,}
presenter.scrub {multi||'">||}
presenter.modify {cleanup(removeduplicates=name)}
presenter.modify {cleanup}
producer.scrub {single||||}
producer.modify {replace|/|\|}
producer.modify {cleanup}
writer.scrub {multi||'">||}
writer.modify {cleanup}
composer.scrub {multi||'">||}
composer.modify {cleanup}
category.scrub {single||||}
category.scrub {multi||'">||}
productiondate.scrub {single||||}
episode.scrub {single(exclude="" separator="," include="Staffel""Folge")||||}
episode.modify {replace|\||,}
temp_1.scrub {single||||}
subtitles.modify {addstart('temp_1' ~"Gehörlose")|true}
videoaspect.modify {addstart('temp_1' ~ "Breitbild")|Breitbild}
videoquality.modify {addstart('temp_1' ~ "HDTV")|HDTV}
*
* convert episode to xmltv_ns :
* example : Staffel 7, Folge 2 von 30
* temp_1 = season
* temp_2 = episode
* temp_3 = number of seasons
* temp_4 = number of episodes
temp_1.modify {substring(type=regex)|'episode' "Staffel (\d+)"}
temp_3.modify {substring(type=regex)|'episode' "Staffel.\d+ von (\d+)"}
temp_2.modify {substring(type=regex)|'episode' "Folge (\d+)"}
temp_4.modify {substring(type=regex)|'episode' "Folge.\d+ von (\d+)"}
episode.modify {clear}
temp_1.modify {calculate(not="" format=D2)|}
temp_2.modify {calculate(not="" format=D2)|}
episode.modify {addend('temp_1' not="")|S'temp_1'}
episode.modify {addend('temp_2' not="")|E'temp_2'}
episode.modify {addend('temp_4' not="")|/'temp_4'}
*
end_scope.range
*
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
**
** @auto_xml_channel_start
*index_site_channel.scrub {multi|||}
*index_site_id.scrub {multi|a href="senderlistings_channel.php?channel=||">|}
*index_site_id.modify {addend|_#region=NOTUSED}
** @auto_xml_channel_end
|