**------------------------------------------------------------------------------------------------
* @header_start
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
* @Site: schedulesdirect.org
* @MinSWversion: V1.1.1/54
* @Revision 1 - [23/10/2014] Jan van Straaten
* - adapted site changes
* @Revision 0 - [31/08/2013] Jan van Straaten / Francis De Paemeleere
* - creation
* @Remarks: You need a login and password for this site
* @header_end
**------------------------------------------------------------------------------------------------
site {url=schedulesdirect.org|timezone=UTC|maxdays=16.1|cultureinfo=en-GB|charset=UTF-8|titlematchfactor=90|keepindexpage|firstshow=1}
site {ratingsystem=MPAA|subtitlestype=teletext|episodesystem=onscreen}
url_index {url|http://dd.schedulesdirect.org/schedulesdirect/tvlistings/xtvdService}
url_index.headers {method=SOAP}
url_index.headers {customheader=SOAPAction=urn:tvDataDelivery#download}
url_index.headers {customheader=Accept-Encoding=gzip,deflate}
*url_index.headers {host=dd.schedulesdirect.org}
* I put my credentials in the following line... I did notice that there was an asteric at the beginning that I had to remove or else I would get an authentication error.
url_index.headers {credentials=xxx,xxx}
*
url_index.headers {accept=text/xml|contenttype=text/xml;charset="utf-8"}
url_index.headers {postdata='index_variable_element'}
scope.range {(urlindex)|end}
** timespan calculation to enable to add the requested timespan from the config
index_variable_element.modify {calculate(format=F1)|'config_timespan_days' 1 +} * add 1 day because config_timespan_days is 0 based
index_variable_element.modify {calculate(format=timespan,hours)} * convert to the proper timespan string required for index_temp_2
index_temp_1.modify {calculate(format=date,yyyy-MM-dd)|'urldate'}
index_temp_2.modify {calculate(format=date,yyyy-MM-dd)|'urldate' 'index_variable_element' +}
index_variable_element.modify {clear} * clear the timespan value
index_variable_element.modify {addstart|'index_temp_1'T00:00:00Z'index_temp_2'T00:00:00Z}
end_scope
index_showsplit.scrub {multi||||} * copies the whole index page
scope.range {(splitindex)|end}
index_temp_1.modify {addstart|'index_showsplit'} * contains the whole xml file
index_variable_element.modify {clear}
index_variable_element.modify {addstart|'config_site_id'}
index_showsplit.modify {substring(type=regex)|(]* station=\''index_variable_element'\' [^>]*>)}
index_showsplit.modify {cleanup(removeduplicates=equal,100)}
index_variable_element.modify {clear}
index_variable_element.modify {addstart|'index_temp_1'} * contains the whole xml file
end_scope
**
index_start.scrub {single|time='|T|Z'|Z'}
index_duration.scrub {single|duration='|PT|M'|M'}
index_temp_5.scrub {single|program='||'|'}
index_videoquality.scrub {single|hdtv='||'|'}
index_videoquality.modify {replace(not="")|'index_videoquality'|HDTV}
index_subtitles.scrub {single|closeCaptioned='||'|'}
index_subtitles.modify {replace(not="")|'index_subtitles'|true}
scope.range {(indexshowdetails)|end}
index_start.modify {calculate(format=utctime)}
index_duration.modify {replace|H|:}
** get the programs part
index_temp_4.modify {substring(type=regex)|'index_variable_element' "^.*(.*?)"}
index_title.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_subtitle.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_description.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_rating.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_temp_2.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_rating.modify {addend|\|'index_temp_2'} *advisory added to rating
index_productiondate.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_episode.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
index_starrating.modify {substring(type=regex)|'index_temp_4' "(\**)[\+]*"} * full stars
index_temp_1.modify {substring(type=regex)|'index_temp_4' ".*(\+)"} * half star
index_starrating.modify {calculate(not="" type=char format=F0)|#}
index_starrating.modify {addend('index_temp_1' not="")|.5}
index_starrating.modify {addend(not="")| / 4}
index_category.modify {substring(type=regex)|'index_temp_4' "([^<]*)"}
* get the productionCrew part
index_temp_4.modify {substring(type=regex)|'index_variable_element' "^.*(.*?)"}
index_actor.modify {substring(type=regex)|'index_temp_4' "[^<]*Actor(.*?)"}
index_actor.modify {cleanup(tags="<"">")}
index_temp_1.modify {substring(type=regex)|'index_temp_4' "[^<]*Guest Star(.*?)"}
index_temp_1.modify {cleanup(tags="<"">")}
index_temp_1.modify {addend(not "")| (Guest Star)}
index_actor.modify {addend('index_temp_1' not "")|'index_temp_1'\|}
index_actor.modify {cleanup(removeduplicates)}
index_presenter.modify {substring(type=regex)|'index_temp_4' "[^<]*Host(.*?)"}
index_presenter.modify {cleanup(tags="<"">")}
index_director.modify {substring(type=regex)|'index_temp_4' "[^<]*Director(.*?)"}
index_director.modify {cleanup(tags="<"">")}
index_producer.modify {substring(type=regex)|'index_temp_4' "[^<]*Producer(.*?)"}
index_producer.modify {cleanup(tags="<"">")}
index_temp_1.modify {substring(type=regex)|'index_temp_4' "[^<]*Executive Producer(.*?)"}
index_temp_1.modify {cleanup(tags="<"">")}
index_temp_1.modify {addend(not "")| (Executive Producer)}
index_producer.modify {addstart('index_temp_1' not="")|'index_temp_1'\|}
index_producer.modify {cleanup(removeduplicates)}
index_writer.modify {substring(type=regex)|'index_temp_4' "[^<]*Writer(.*?)"}
index_writer.modify {cleanup(tags="<"">")}
* get the genres part
index_temp_4.modify {substring(type=regex)|'index_variable_element' "^.*(.*?)"}
index_temp_1.modify {substring(type=regex)|'index_temp_4' ".*?(.*?)"}
index_category.modify {addstart('index_temp_1' not= "")|'index_temp_1'\|}
end_scope
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
**
** @auto_xml_channel_start
*index_site_id.scrub {regex||()||}
*scope.range {(channellist)|end}
*index_site_channel.modify {substring(type=regex)|'index_site_id' "(.*?)"}
*index_site_id.modify {substring(type=regex)|'index_site_id' ""}
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
*end_scope
** @auto_xml_channel_end