**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: humo.be * @MinSWversion: V1.1.1/54 * @Revision 5 - [06/02/2020] WGT * @Revision 4 - [07/11/2015] Francis De Paemeleere * update to new site api * @Revision 3 - [09/11/2013] Francis De Paemeleere * update * @Revision 2 - [28/02/2013] Francis De Paemeleere * new site implementation * @Remarks: * .channels.xml generation not fully automatic! * @header_end **------------------------------------------------------------------------------------------------ site {url=humo.be|timezone=Europe/Brussels|maxdays=8|cultureinfo=nl-BE|charset=UTF-8|titlematchfactor=90|keepindexpage} site {loadcookie=hot_cookies.txt} subpage.format {list|main|rest} url_index{url|https://www.humo.be/api/epg/humosite/schedule/|subpage|/|urldate|/full} url_index.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the index pages url_index.headers {customheader=Cookie=pwv=1; pws=functional\|analytics} urldate.format {datestring|yyyy-MM-dd} scope.range {(urlindex)|end} index_variable_element.modify {substring(type=regex)|'config_site_id' "##id=([^#]*)"} index_variable_element.modify {set|"id":'index_variable_element',"code":"} end_scope index_urlchannellogo.scrub {regex||^.*'index_variable_element'.*?"medium":"([^\"]*)"||} scope.range{(datelogo)|end} index_urlchannellogo.modify {cleanup(style=jsondecode)} end_scope index_showsplit.scrub {multi|'index_variable_element'|,"url":"||,"code":"} index_start.scrub {regex||^.*?"starttime"\s*:\s*([+-]?\d*)||} index_start.scrub {single|"starttime":|||,} index_stop.scrub {single|"endtime":|||,} index_title.scrub {single|"title":"||"|"} index_subtitle.scrub {single|"episodetitle":"||"|"} index_temp_1.scrub {single|"episodenumber":"||"|} index_temp_2.scrub {single|"episodetotal":"||"|} index_temp_3.scrub {single|"episodeseason":"||"|} index_productiondate.scrub {single|"year":"||"|} index_description.scrub {single|"content_short":"||"|} index_actor.scrub {multi|"credits":|"role":"actor","name":"|"|]} index_presenter.scrub {multi|"credits":|"role":"presenter","name":"|"|]} index_director.scrub {multi(separator="," " en ")|"credits":|"role":"director","name":"|"|]} index_category.scrub {multi|"genres":[|"|"|]} index_starrating.scrub {single|"appreciation":"||"|} index_videoaspect.scrub {single|"prop_16_9"||1|1} index_videoquality.scrub {single|"hd"||1|1} index_showicon.scrub {single|"resized_urls":{"large":"||",|",} index_country.scrub {single|"countries":["||"]} scope.range {(indexshowdetails)|end} index_start.modify {calculate(format=utctime)} index_stop.modify {calculate(format=utctime)} index_urlshow.modify{replace|\/|/} ** create the episode element index_episode.modify {addstart('index_temp_3' not= "")|Seizoen 'index_temp_3'} index_episode.modify {addend('index_temp_1' not= "")| Aflevering 'index_temp_1'} index_episode.modify {addend('index_temp_2' not= "")|/'index_temp_2'} * ** cleanup the unicode characters index_title.modify {cleanup} index_subtitle.modify {cleanup} index_description.modify {cleanup} index_actor.modify {cleanup} index_presenter.modify {cleanup} index_category.modify {cleanup(style=name)} * index_starrating.modify {calculate(not "" format=F1)|'index_starrating' 10 /} index_videoaspect.modify {replace(not "")|'index_videoaspect'|16:9} index_videoquality.modify {replace(not "")|'index_videoquality'|hdtv} index_showicon.modify {cleanup(style=jsondecode)} end_scope ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** *** @auto_xml_channel_start *subpage.format {list|main|rest} *url_index{url|https://www.humo.be/api/epg/humosite/channels/|subpage|} *url_index.headers {customheader=Cookie=pwv=1; pws=functional\|analytics} *index_site_id.scrub {multi|"groups":[{"code":|||} *scope.range {(channellist)|end} *index_temp_2.modify {clear} *loop {(each 'index_temp_6' in 'index_site_id' max=3000)|end} *index_temp_1.modify {substring(type=regex)|'index_temp_6' ^.*?"([^\"]*)"} *index_temp_6.modify {replace|"id":|"id":##type='index_temp_1'##id=} *index_temp_2.modify {addend|'index_temp_6'} *end_loop *index_site_id.modify {substring(type=regex)|'index_temp_2' "id":([^,]*),"code":"[^\"]*","display_name":"[^\"]*"} *index_site_channel.modify {substring(type=regex)|'index_temp_2' "id":[^,]*,"code":"[^\"]*","display_name":"([^\"]*)"} *index_site_channel.modify {cleanup(style=jsondecode)} *end_scope *** @auto_xml_channel_end