**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: telkku.com * @MinSWversion: * @Revision 1 - [20/02/2016] * - creation * 2 - [15/02/2017] * - Fixed time format error on Linux caused by error in index_showsplit * - Episode and Season numbers (xmltv_ns and onscreen) * @Remarks: * @header_end **------------------------------------------------------------------------------------------------ site {url=telkku.com|timezone=EET|maxdays=21|cultureinfo=fi-FI|charset=UTF-8|titlematchfactor=90|episodesystem=xmltv_ns|ratingsystem=MEKU} url_index{url|http://www.telkku.com/api/channels/|channel|/offering?startTime=04:00:00.000&duration=PT25H&inclusionPolicy=IncludeOngoingAlso&limit=1000&tvDate=|urldate|&view=PublicationDetails} url_index.headers {accept=text/html,application/xhtml+xml,application/xml|contenttype=application/json} url_index.headers {customheader=Accept-Encoding=gzip,deflate} urldate.format {datestring|yyyy-MM-dd} index_showsplit.scrub {regex||{"id":"\d+.+?}||} index_showsplit.modify {cleanup(style=jsondecode)} index_start.scrub {regex||"startTime":"(.+?)",||} index_stop.scrub {regex||"endTime":"(.+?)",||} index_title.scrub {regex||"title":"(.+?)","||} *index_titleoriginal.scrub {regex||"episodeTitle":"(.*?)","||} index_rating.modify {substring(type=regex)|'index_title' \((S?\d{0,2})\)$} index_title.modify {remove('index_rating' not = "")| ('index_rating')} index_description.scrub {regex||"description":"(.*?)","||} index_showicon.scrub {regex||"publicationImageUrl":"(.+?)","||} *Season and Episode numbers index_temp_1.modify {substring(type=regex)|'index_description' ([Kk]ausi \d+\|\d+\. kausi\|\d+\. tuotantokausi)} * Season number from description index_temp_2.modify {substring(type=regex)|'index_description' ([Jj]akso \d+\|\d+\. jakso\|Osa \d+\|^\d+\/\d+)} * Episode number from description index_temp_2.modify {substring(type=regex 'index_temp_2' = "")|'index_description' Kausi \d+. (\d+)\/\d+} * Kausi 1, 1/8. index_temp_1.modify {substring(type=regex)|'index_temp_1' \d+} * Only leave numbers inside index_temp_1 and index_temp_2 index_temp_2.modify {remove(type=regex)|\/\d+} index_temp_2.modify {substring(type=regex)|'index_temp_2' \d+} index_temp_1.modify {substring(type=element)|'index_temp_1' 0 1} * Sometimes the season number is multiple times inside the description index_temp_2.modify {substring(type=element)|'index_temp_2' 0 1} * Sometimes the episode number is multiple times inside the description *Episode (xmltv_ns 0.0.) index_temp_1.modify {calculate(format=F0 'index_temp_1' not = "")|1 -} index_temp_2.modify {calculate(format=F0 'index_temp_2' not = "")|1 -} index_episode.modify {addend('index_temp_1' not = "")|'index_temp_1'.} index_episode.modify {addend('index_temp_2' not = "")|.'index_temp_2'.} index_episode.modify {replace|..|.} index_temp_1.modify {clear} index_temp_2.modify {clear} **Episode (onscreen S01E01) *index_temp_1.modify {replace(type=regex)|(?=^\d$)|0} *index_temp_2.modify {replace(type=regex)|(?=^\d$)|0} *index_temp_1.modify {addstart('index_temp_1' not = "")|S} *index_temp_2.modify {addstart('index_temp_2' not = "")|E} *index_episode.modify {addstart|'index_temp_1''index_temp_2'} *index_temp_1.modify {clear} *index_temp_2.modify {clear} **Starrating and Category (Disable these for faster processing) index_urlshow.scrub {regex||"id":"(\d+?)",||} index_urlshow.modify {addstart('index_urlshow' not = "")|http://www.telkku.com/api/publications/} title.modify {addend|'index_title'} starrating.scrub {regex||"meanRating":(\d+\.\d)||} category.scrub {regex||"topics":\[(.+?)\],"||} category.scrub {regex||"format":"(.+?)","||} category.modify {cleanup(style=jsondecode)} category.modify {remove|"} category.modify {replace|,|\|} category.modify {replace|CLIP|} category.modify {replace|EPISODIC|sarjat} category.modify {replace|MOVIE|elokuvat} category.modify {replace|PERIODICAL|} category.modify {replace|SINGLE|} category.modify {replace|SPORTS|urheilu} category.modify {cleanup(removeduplicates)} **Starrating and Category ends ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** ** @auto_xml_channel_start *url_index{url|http://www.telkku.com/tv-ohjelmat/|urldate|/peruskanavat/tulevat} *index_site_channel.scrub {regex||default_builtin_channelgroup\d+\.0\.1\.1\.\$.+?">(.+?)||} *index_site_id.scrub {regex||default_builtin_channelgroup\d+\.0\.1\.1\.\$(.+?)">||} *scope.range {(channellist)|end} *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} *end_scope ** @auto_xml_channel_end