**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: tvtid.tv2.dk * @MinSWversion: V2.0.1 * @Revision 5 - [13/03/2018] doglover * Update to new website * @Revision 4 - [18/09/2017] Blackbear199 * http address change * other small fixes * @Remarks: * none * @header_end **------------------------------------------------------------------------------------------------ site {url=tvtid.tv2.dk|timezone=UTC|maxdays=7|cultureinfo=da-DK|charset=UTF-8|titlematchfactor=90} url_index{url|https://tvtid-api.api.tv2.dk/api/tvtid/v1/epg/dayviews/|urldate|?ch=|channel|} *https://tvtid-api.api.tv2.dk/api/tvtid/v1/epg/dayviews/2018-03-14?ch=1 url_index.headers {accept=application/json, text/javascript, */*; q=0.01} url_index.headers {customheader=Accept-Encoding=gzip,deflate} urldate.format {datestring|yyyy-MM-dd} * index_showsplit.scrub {multi ()|[{"id"|{|}|]}]} * index_start.scrub {single|"start":||,|,} index_stop.scub {single|"stop":||,|,} index_title.scrub {single|"title":"||",} index_category.scrub {multi (separator=",") |"categories":[||]} index_category.modify {remove|"} * index_temp_1.modify {addstart|'config_site_id'} index_temp_2.scrub {single|"id":|"|",|,} * index_urlshow.modify {addstart( 'index_temp_2' not "")|https://tvtid-api.api.tv2.dk/api/tvtid/v1/schedules/channels/'index_temp_1'/programs/'index_temp_2'} index_urlshow.headers {accept=application/json, text/javascript, */*; q=0.01} index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate} * scope_range{(showdetails)|end} *title.scrub {single|"title":"||"|"} title.modify {addstart|'index_title'} titleoriginal.scrub {single|orgTitle":"||"|"} description.scrub {single|"desc":"||"|"} director.scrub {multi(separator=";")|"director":|"name":"|"|}]} actor.scrub {multi|"actor":|"name":"|"|}]} productiondate.scrub {single|"prodYear":||,|,} country.scrub {single(separator=",")|"prodCountry":"||"|"} * temp_1.scrub {single|"series":{||}|}} subtitle.modify {substring(type=regex)|'temp_1' "\"title\":\"(.+?)\""} episode.modify {substring(type=regex)|'temp_1' "\"episode\":(\d+),"} *episode temp_2.modify {substring(type=regex)|'temp_1' "\"season\":(\d+)"} *season temp_2.modify {clear ('temp_2' = "0")} episode.modify {addstart('episode' not "")|E} episode.modify {addstart('episode' not "")|S'temp_2'} episode.modify {replace|SE|E} episode.modify {substring(pattern="S'S1'E'E1'""E'E1'" type=regex not "")|"^.*$"} *episode.modify {set(not "")|'episode'\|'episode'(system=xmltv_ns)} * videoaspect.scrub {single|"aspect":"||"|"} videoquality.scrub {single|"video":{"definition":"||"}|"}} * description.modify {remove(type=regex)|\\} titleoriginal.modify {clear('title')} director.modify {remove(type=regex)|\.$} actor.modify {remove(type=regex)|\.$} productiondate.modify {clear("0")} end_scope ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** ** @auto_xml_channel_start *url_index{url|https://tvtid-api.api.tv2.dk/api/tvtid/v1/schedules/channels} *index_site_id.scrub {multi|"id":|"|",|} *index_site_channel.scrub {multi|"title":"||"|"} *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} ** @auto_xml_channel_end *For classical credits - remove the next lines category.modify {cleanup(removeduplicates)} category.modify {cleanup} actor.modify {cleanup} director.modify {cleanup} actor.modify {replace|\|\||\|} description.modify {addend('director' not "" separator=", ")|\n'director'} description.modify {addend('actor' not "" separator="\n")|\n'actor'} actor.modify {clear} director.modify {clear} subtitle.modify {addstart ('titleoriginal' not "") | ('titleoriginal')} subtitle.modify {addend ('episode' not "") | ('episode')} subtitle.modify {addend ('productiondate' not "") | ('productiondate')} subtitle.modify {addstart ('category' not "") |['category'] } subtitle.modify {addend ('rating' not "") | ['rating'] } subtitle.modify {addend ('country' not "") | ['country'] } rating.modify {clear} episode.modify {clear} category.modify {clear} productiondate.modify {clear} titleoriginal.modify {clear} writer.modify {clear} producer.modify {clear} composer.modify {clear} starrating.modify {clear} rating.modify {clear} presenter.modify {clear} starrating.modify {clear} videoquality.modify {clear} videoaspect.modify {clear} country.modify {clear} index_category.modify {cleanup(removeduplicates)} index_category.modify {cleanup} index_description.modify {addend ('index_director' not "" separator=", " )|\n'index_director'} index_description.modify {addend ('index_actor' not "" separator="\n" )|\n'index_actor'} index_description.modify {addend ('index_presenter' not "" separator=", " )|\n'index_presenter'} index_subtitle.modify {addstart ('index_titleoriginal' not "") | ('index_titleoriginal')} index_subtitle.modify {addend ('index_episode' not "") | ('index_episode')} index_subtitle.modify {addend ('index_productiondate' not "") | ('index_productiondate')} index_subtitle.modify {addstart ('index_category' not "") |['index_category'] } index_subtitle.modify {addend ('index_rating' not "") | ['index_rating'] } index_writer.modify {clear} index_rating.modify {clear} index_productiondate.modify {clear} index_titleoriginal.modify {clear} index_actor.modify {clear} index_director.modify {clear} index_presenter.modify {clear} index_episode.modify {clear} index_category.modify {clear} index_videoquality.modify {clear} description.modify {substring(type=char)|'description' 0 2300} title.modify {substring(type=char)|'title' 0 80} subtitle.modify {substring(type=char)|'subtitle' 0 160} index_description.modify {substring(type=char)|'index_description' 0 2300} index_title.modify {substring(type=char)|'index_title' 0 80} index_subtitle.modify {substring(type=char)|'index_subtitle' 0 160}