**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: shoofeetv.com * @MinSWversion: 1.1.1/55.27 * @Revision 1 - [09/10/2015] Jan van Straaten * - solves the problem that the index shows are not in the regular ascending time order * @Revision 0 - [25/05/2015] Francis De Paemeleere * - creation * @Remarks: * @header_end **------------------------------------------------------------------------------------------------ site {url=shoofeetv.com|timezone=Africa/Algiers|maxdays=2|cultureinfo=en-GB|charset=UTF-8|titlematchfactor=90|nopageoverlaps|keepindexpage|episodesystem=onscreen} urldate.format {list|today|tomorrow} subpage.format{list(step=1 count=55)|0} url_index{url()|http://www.shoofeetv.com/en/guide/getGuide?section=|urldate|&page=|subpage} url_index.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the index pages scope.range {(datelogo)|end} index_variable_element.modify {clear} index_variable_element.modify {addstart|'config_site_id'} end_scope index_urlchannellogo.scrub {regex||^.*?id=\"tvg-channel-'index_variable_element'\".*?]*src=\"([^\"]*)\"||} scope.range {(datelogo)|end} index_urlchannellogo.modify {addstart(not="")|http://www.shoofeetv.com} end_scope * the index file is composed as follows * each day: * all channels are present , indicated by data-channel-id="1144" This id is same as config_site_id * in each channel the prime time shows are listed first (6:30pm - last show before midnight , start has a pm indicator) * then all the other shows (the first starts just after midnight has am indicator * a clear difference between the days is the value of data-id , for the second day at least 5000 (?) more than for the first day * e.g. for channel-id="2" the first days data-id ranges from 1 to 28, the second day from 8443 to 8466 scope.range {(splitindex)|end} index_showsplit.scrub {regex()||
]*data-channel-id=\"'index_variable_element'\"[^>]*>.*?
||} * all shows for this channel index_temp_1.modify {set|'index_showsplit'} index_showsplit.modify {clear} index_temp_5.modify {set|0} index_temp_4.modify {set|1} * start value loop condition loop {('index_temp_4' "1" max=100)|end} * the next line always uses index 0 (the first, because we remove it further on, so in effect index 0 is always the next in line index_temp_2.modify {substring(type=element)|'index_temp_1' 0 1} * indexshow index_temp_3.modify {substring(type=regex)|'index_temp_2' "data-id=\"(\d{1,})\""} * data-id index_temp_4.modify {calculate(format=F0)|'index_temp_3' 'index_temp_5' -} * difference index_temp_5.modify {clear} index_temp_5.modify {set|'index_temp_3'} *saves value of data-id for next loop index_temp_6.modify {addend('index_temp_4' "1")|****'index_temp_2'} * all indexshows of one day added together * remove the show from the index, that will leave all shows of the nexr day in the end index_temp_1.modify {remove(type=element 'index_temp_4' "1")|0 1} * this will contain all next day shows at the end of the loop end_loop *index_temp_1.modify {replace(debug)|\||\|\n\n} * test index_temp_6.modify {replace()|****|\|} *make multi * sort on starttime of the first day loop {(each 'index_temp_2' in 'index_temp_6' max=100)|end} index_temp_3.modify {substring(type=regex)|'index_temp_2' "(\d{2}:\d{2}.+?)\s-"} * start time am pm format index_temp_3.modify {calculate(format=time,HH:mm)} * time converted into 24h format * this 'converted' time can be used in sort (am/pm time cannot) * add the 'converted' starttime to the beginning: index_temp_4.modify {addend()|****'index_temp_3'##'index_temp_2'} end_loop index_temp_4.modify {replace()|****|\|} *make multi needed for sorting * sort on start time index_temp_4.modify {sort(ascending,string)} * this now contains all shows of day one in the right order sort_by.modify {substring(target="index_temp_4" type=regex)|"(\d{2}:\d{2})##"} * index_temp_4.modify {replace|\||****} * make single to allow later adding in index_showsplit * sort on starttime of the second day * prepar by adding the converted starttime as with the first day loop {(each 'index_temp_2' in 'index_temp_1' max=100)|end} index_temp_3.modify {substring(type=regex)|'index_temp_2' "(\d{2}:\d{2}.+?)\s-"} * start time am pm format index_temp_3.modify {calculate(format=time,HH:mm)} * time converted into 24h format index_temp_5.modify {addend()|****'index_temp_3'##'index_temp_2'} end_loop index_temp_5.modify {replace()|****|\|} *make multi, needed for sorting * sort on start time index_temp_5.modify {sort(ascending,string)} * this now contains all shows of day two in the right order sort_by.modify {substring(target="index_temp_5" type=regex)|"(\d{2}:\d{2})##"} index_temp_5.modify {replace|\||****} * make single to allow adding * add the two days together index_showsplit.modify {addstart()|'index_temp_4''index_temp_5'} index_showsplit.modify {replace()|****|\|} * make multi * all done with sorting of the index_shows !! end_scope scope.range {(indexshowdetails)|end} index_start.scrub {single|||-|-} index_stop.scrub {single||-||} index_title.scrub {single()|

||

|} index_urlshow.scrub {regex()||data-id="(\d*)"||} index_urlshow.modify {addstart(not="")|http://www.shoofeetv.com/en/guide/getProgram?id=} index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the end_scope *detail pages title.scrub {single|

||

|} description.scrub {single|
|
|

|

} showicon.scrub {regex||class=\"tvg-details-thumbnail\".*?src=\"([^\"]*)\"||} episode.scrub {regex||class=\"tvg-details-epnum\"[^>]*>([^<]*)<||} description.modify {remove(type=regex)|"<[^>]*>"} showicon.modify {addstart(not~"http://")|http://www.shoofeetv.com} ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** ** @auto_xml_channel_start *index_site_id.scrub {regex||id=\"tvg-channel-\d*\"[^>]*>.*?||} *scope.range {(channellist)|end} *index_site_channel.modify {addstart|'index_site_id'} *index_site_channel.modify {substring(type=regex)|id=\"tvg-channel-\d*\"[^>]*>(.*?)} *index_site_channel.modify {remove(type=regex)|<[^>]*>} *index_site_channel.modify {remove(type=regex)|^\s*} *index_site_channel.modify {remove(type=regex)|\s*$} *index_site_id.modify {substring(type=regex)|id=\"tvg-channel-(\d*)\"} *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} *end_scope ** @auto_xml_channel_end