**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from Finnish Yle Areena. Works for all free to air channels. * @Site: areena.yle.fi * @MinSWversion: v3.1 * @Revision 3 - [28/07/2023] Mat8861 * @Revision 2 - [24/12/2021] * @Revision 1 - [16/07/2017] * - creation * @Remarks: * @header_end **------------------------------------------------------------------------------------------------ site {url=areena.yle.fi|timezone=Europe/Helsinki|maxdays=7|cultureinfo=fi-FI|charset=UTF-8|titlematchfactor=90|ratingsystem=MEKU} url_index{url|https://areena.api.yle.fi/v1/ui/schedules/|channel|/|urldate|.json?&language=fi&v=10&client=yle-areena-web&offset=0&limit=100&isInEU=true&app_id=areena-web-items&app_key=v9No1mV0omg2BppmDkmDL6tGKw1pRFZt} url_index.headers {accept=text/html,application/xhtml+xml,application/xml|contenttype=text/html} url_index.headers {customheader=Accept-Encoding=gzip,deflate} urldate.format {datestring|yyyy-MM-dd} *Showsplit index_variable_element.modify {set|'config_site_id'} index_urlchannellogo.scrub {single(includeblock="aria-label="'index_variable_element'")|class="channel-header__logo "|style="background-image: url('|')|>} index_showsplit.scrub {regex||\{"title":".*?"type":"[^"]*"\}||} *Start and stop times index_start.scrub {regex||"raw":"(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})\+\d+:\d+",||} *Title and rating index_title.scrub {regex||"title":"([^"]*)",||} index_rating.modify {substring(type=regex)|'index_title' \((S?\d{0,2})\)$} *Get rating from program title index_title.modify {remove(type=regex)| \(S?\d{0,2}\)} *Remove rating from program title index_title.modify {remove(type=regex)| \d+\. kausi$} *Remove season number from program title (Sub,Ava,MTV3) index_category.modify {addend('index_title' ~ "Elokuva: ")|Elokuva} *Mark movies based on title index_category.modify {addend('index_title' ~ "kino")|Elokuva} *Mark movies based on title index_category.modify {addend('index_title' ~ "Kotikatsomo: ")|Elokuva} *Mark movies based on title index_category.modify {addend('index_title' ~ "Leffa: ")|Elokuva} *Mark movies based on title index_title.modify {remove(type=regex)|^(?i)([\w-]*)(elokuva\|jännäri\|kino\|komedia\|kotikatsomo\|leffa\|perjantai\|putki\|trilleri)(: )} *Remove nonsense from the start of program names *Description index_description.scrub {regex||"description":"(.*?)","||} index_description.modify {remove(type=regex)|(?<=[\?!])\.} *Remove dot after ? or ! index_description.modify {remove(type=regex)|\s+$} *Remove extra spaces index_description.modify {replace(type=regex)|\s{2,}| } *Remove extra spaces index_description.modify {replace(type=regex)|(?<=\d+\. )tuotantokausi|kausi} * Tuotantokausi -> kausi index_description.modify {replace(type=regex)|(?:Kausi \d+([,.\s]+\|[,.\s]+[Oo]sa \|[,.\s]+jakso ))(?:\d+)|. Jakso } *Kausi 1, 1/10 or Kausi 1, osa 1/10 or Kausi 1, jakso 1/10 -> Kausi 1. Jakso 1/10. index_description.modify {replace(type=regex)|(?<=\d+\. kausi)([,\s]+\|, osa )(?=\d+)|. Jakso } *1. kausi, 1/10 -> 1. kausi. Jakso 1/10. index_description.modify {addend('index_description' = "")|'index_title'} *Add title to description if description is empty *Showicon index_showicon.scrub {regex||