**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: movistar.com.pe * @MinSWversion: * @Revision 1 - [08/04/2015] Francis De Paemeleere * - adjust to new url * @Revision 0 - [09/12/2014] Francis De Paemeleere * - creation * @Remarks: * @header_end **------------------------------------------------------------------------------------------------ site {url=movistar.com.pe|timezone=America/Lima|maxdays=7|cultureinfo=es-PE|charset=UTF-8|titlematchfactor=90|nopageoverlaps|firstshow=1} urldate.format {datestring|_d__m___yyyy} url_index{url|http://tm.movistar.com.pe/FrontEnd/Paginas/MovistarTV/Services.aspx/GetProgramacionGrilla} url_index.headers {method=POST|contenttype=application/json; charset=utf-8} url_index.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the index pages url_index.headers {customheader=X-Requested-With=XMLHttpRequest} scope.range{(urlindex)|end} index_temp_1.modify {clear} index_temp_1.modify {addstart|'config_site_id'} index_temp_1.modify {substring(type=regex)|LOCATIONID_(\d*)} index_variable_element.modify {calculate(format=date,_d__M___yyyy)|'urldate'} index_variable_element.modify {addend|"} index_variable_element.modify {replace|___|", "anio":"} index_variable_element.modify {replace|__|", "mes":"} index_variable_element.modify {replace|_|"dia":"} index_variable_element.modify {addstart|"localidadID": "'index_temp_1'" ,} url_index.headers {postdata={'index_variable_element'}} end_scope scope.range{(datelogo)|end} index_variable_element.modify {clear} index_variable_element.modify {addstart|'config_site_id'} index_variable_element.modify {substring(type=regex)|CHANNELID_(\d*)} end_scope index_showsplit.scrub {regex||\\"Programas\\"[^]]*],\\"CC\\"\:'index_variable_element'}||} scope.range{(splitindex)|end} index_showsplit.modify {replace|\\"|"} index_showsplit.modify {substring(type=regex)|\{"DU"[^\}]*\}} end_scope *index_date.scrub {single|} index_start.scrub {regex||"HI"\s*:\s*"([^"\\]*(?:\\.[^"\\]*)*)"||} index_stop.scrub {regex||"HF"\s*:\s*"([^"\\]*(?:\\.[^"\\]*)*)"||} index_temp_1.scrub {regex||"CP"\s*:\s*([+-]?\d*)||} *index_urlshow {url|http://www.movistar.com.pe/FrontEnd/Paginas/MovistarTV/Services.aspx/ObtenerProgramacion} index_title.scrub {regex||"TI"\s*:\s*"([^"\\]*(?:\\.[^"\\]*)*)"||} ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** ** @auto_xml_channel_start * *** ** ** ** ** ** ** ** ** *** * *subpage.format {list(step=1 count=8)|1} *url_index{url|http://tm.movistar.com.pe/FrontEnd/Paginas/MovistarTV/Services.aspx/GetChannels###SUBPAGE|subpage} *url_index.headers {method=POST|contenttype=application/json; charset=utf-8} *url_index.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the pages *url_index.headers {customheader=X-Requested-With=XMLHttpRequest} * *scope.range{(urlindex)|end} *url_index.headers {postdata={'localidadID':'subpage'}} *url_index.modify {remove(type=regex)|###SUBPAGE.*$} *end_scope * *index_site_id.scrub {regex||"d":"\[.*?\}\]"}||} * list of location channels *scope.range {(channellist)|end} *index_site_id.modify {replace|\\"|"} *index_temp_5.modify {clear} *index_temp_5.modify {addstart|1} *index_temp_1.modify {clear} * *loop {(each 'index_temp_6' in 'index_site_id' max=10)|end} *index_temp_6.modify {replace(type=regex)|""CodCanal"(\:)\d*"|:LOCATIONID_'index_temp_5'__CHANNELID_} *index_temp_5.modify {calculate(format=D0)|1 +} *index_temp_1.modify {addend|'index_temp_6'###_###} *end_loop * *index_temp_1.modify {replace|LOCATIONID_1|LOCATIONID_1__LOCATION_Lima} *index_temp_1.modify {replace|LOCATIONID_2|LOCATIONID_2__LOCATION_Arequipa} *index_temp_1.modify {replace|LOCATIONID_3|LOCATIONID_3__LOCATION_Chiclayo} *index_temp_1.modify {replace|LOCATIONID_4|LOCATIONID_4__LOCATION_Piura} *index_temp_1.modify {replace|LOCATIONID_5|LOCATIONID_5__LOCATION_Cusco} *index_temp_1.modify {replace|LOCATIONID_6|LOCATIONID_6__LOCATION_Huancayo} *index_temp_1.modify {replace|LOCATIONID_7|LOCATIONID_7__LOCATION_Chimbote} *index_temp_1.modify {replace|LOCATIONID_8|LOCATIONID_8__LOCATION_Trujillo} **index_temp_1.modify {replace|###_###|\|} *index_temp_1.modify {addend|###_###1} *index_site_channel.modify {substring(type=regex)|'index_temp_1' "LOCATIONID[^\,]*,"NomCanal":"([^\"]*)""} *index_site_id.modify {substring(type=regex)|'index_temp_1' "(LOCATIONID[^\,]*),"NomCanal":"[^\"]*""} *index_temp_1.modify {addend|###_##2} * *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} *end_scope ** @auto_xml_channel_end