**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: tv.com * @MinSWversion: V1.57 * @Revision 6 - [19/10/2017] Blackbear199 * - added required header * @Revision 5 - [16/12/2016] Blackbear199 * - added subdetail pages * @Revision 4 - [24/07/2016] Blackbear199 * - added retry= * @Revision 3 - [03/06/2016] Blackbear199 * - fix - sometimes title not present on showdetails page * @Revision 2 - [12/01/2016] Francis De Paemeleere * - get all the data available (previous only 3 or 4 days were grabbed) * @Revision 1 - [05/01/2016] Jan van Straaten * - remove some special chars in the title (only seen on movies) * @Revision 0 - [03/11/2015] Jan van Straaten * - creation * @Remarks: directv alternative, less details * @header_end **------------------------------------------------------------------------------------------------ site {url=tv.com|timezone=America/New_York|maxdays=10|cultureinfo=en-US|charset=UTF-8|titlematchfactor=90|nopageoverlaps} site {ratingsystem=US|episodesystem=onscreen} site {loadcookie=tv.com.cookies.txt|retry=4} * url_index{url|http://www.tv.com/listings/singlestation/?start=##TIMESTAMP##&last_event=nada&station=|channel|} url_index.headers {customheader=X-Requested-With=XMLHttpRequest} url_index.headers {customheader=Accept-Encoding=gzip,deflate} * urldate.format {datestring|yyyy-MM-dd} * scope.range {(urlindex)|end} index_variable_element.modify {calculate(format=date,unix)|'urldate'} url_index.modify {replace|##TIMESTAMP##|'index_variable_element'} end_scope * index_showsplit.scrub {regex||
  • ||} index_showsplit.modify {cleanup(style=jsondecode)} index_showsplit.modify {cleanup(removeduplicates=equal,100)} * index_temp_1.scrub {regex||data-tmsid="rvp:(\d+?)"||} * id index_urlshow.modify {addstart('index_temp_1' not "")|http://www.tv.com/listings/event/?EventTmsId=rvp%3A'index_temp_1'} index_urlshow.headers {customheader=X-Requested-With=XMLHttpRequest} index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate} * index_start.scrub {single(pattern="h:mmtt")|
    |||
    } index_title.scrub {regex||
    (.+?)
    ||} index_title.modify {remove(type=regex)|"()"} index_title.modify {remove(type=regex)|"(<[^>]*>)"} index_description.scrub {single|
    ||
    |} index_description.modify {clear('index_urlshow' not "")} * title.scrub {regex||

    (?:)?(.+?)(?:)?

    ||} subtitle.scrub {regex||

    (?:)?(.+?)(?:)?

    ||} description.scrub {regex||
    (.*?)
    ||} showicon.scrub {regex||data-image=\\"(http://.+?\.jpg)\\"||} * title.modify {remove(type=regex)|"()"} title.modify {remove(type=regex)|"(<[^>]*>)"} title.modify {addstart('title' "")|'index_title'} subtitle.modify {remove(type=regex)|"(<[^>]*>)"} description.modify {cleanup(style=jsondecode)} description.modify {remove|'subtitle'. } * temp_1.scrub {single|

    ||

    } temp_2.scrub {single|

    ||

    } urlsubdetail.modify {addend('temp_1' not "")|http://www.tv.com'temp_1'/} *overview urlsubdetail.modify {addend('temp_1' not "")|####http://www.tv.com'temp_1'/cast/} *cast & crew urlsubdetail.modify {addend('temp_2' not "")|####http://www.tv.com'temp_2'} *episode details urlsubdetail.modify {replace|####|\|} urlsubdetail.headers {customheader=X-Requested-With=XMLHttpRequest} urlsubdetail.headers {customheader=Accept-Encoding=gzip,deflate} * *overview* subdetail_title.scrub {single||" />} subdetail_description.scrub {single|itemprop="description">|

    |

    |} subdetail_category.scrub {single(separator=",""&")|

    Categories

    |

    |

    |} subdetail_category.modify {cleanup(tags="<"">")} subdetail_rating.scrub {single|
    Rating:
    |
    |
    |} subdetail_rating.modify {clear("Not Available")} subdetail_starrating.scrub {single|
    |
    |} subdetail_starrating.modify {clear("N/A")} subdetail_productiondate.scrub {single|
    Released:
    |
    |
    |} *cast & crew* subdetail_director.scrub {multi(includeblock="

    Directors |
    |
    |} subdetail_director.modify {cleanup(tags="<"">")} subdetail_producer.scrub {multi(includeblock="
    Producer
    ")|
  • ||
  • } subdetail_producer.modify {cleanup(tags="<"">")} subdetail_actor.scrub {multi(includeblock="

    Stars |
    |
    |} subdetail_actor.modify {cleanup(tags="<"">")} subdetail_writer.scrub {multi(includeblock="

    Writers |
    |
    |} subdetail_writer.modify {cleanup(tags="<"">")} * *episode Sx Ex can be used for episode system=onscreen or xmltv_ns subdetail_temp_3.scrub {single|class="ep_season" itemprop="partOfSeason">||
    |} subdetail_temp_4.scrub {single||||} subdetail_temp_4.modify {cleanup(tags="<"">")} subdetail_temp_4.modify {addstart('subdetail_temp_3' not "")|'subdetail_temp_3' } subdetail_episode.modify {addstart('subdetail_temp_4' not "" pattern="Season 'S1' Episode 'E1'")|'subdetail_temp_4'} * *episode S0xE0x for kodi,ect which require leading zero when single digit.use episodesystem=onscreen only *subdetail_temp_3.scrub {single|class="ep_season" itemprop="partOfSeason">|||} *subdetail_temp_3.modify {remove(not "")|Season } *subdetail_temp_5.modify {calculate('subdetail_temp_3' not "" format=F0 type=char)|'subdetail_temp_3' #} *subdetail_temp_3.modify {addstart('subdetail_temp_5' < "2")|0} *subdetail_temp_3.modify {clear("0")} *subdetail_temp_3.modify {addstart(not "")|S} *subdetail_episode.scrub {single||||} *subdetail_episode.modify {cleanup(tags="<"">")} *subdetail_episode.modify {remove(not "")|Episode } *subdetail_temp_5.modify {calculate('subdetail_episode' not "" format=F0 type=char)|'subdetail_episode' #} *subdetail_episode.modify {addstart('subdetail_temp_5' < "2")|0} *subdetail_episode.modify {clear("0")} *subdetail_episode.modify {addstart(not "")|E} *subdetail_episode.modify {addstart('subdetail_temp_3' not "")|'subdetail_temp_3'} ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** ** @auto_xml_channel_start *scope.range {(channellist)|end} *url_index {url|http://www.tv.com/listings/} *index_site_channel.scrub {regex||(.+?)(?:\|)||} ***** add channel name makes it more clear? *index_temp_1.modify {set|0} *loop {(each "index_temp_2" in 'index_site_channel')|end} *index_temp_3.modify {substring(type=element)|'index_temp_6' 'index_temp_1' 1} * name *index_temp_4.modify {addend|'index_temp_2' ('index_temp_3')####} *index_temp_1.modify {calculate(format=F0)|1+} *end_loop *index_site_channel.modify {set|'index_temp_4'} *index_site_channel.modify {replace|####|\|} *index_site_channel.modify {cleanup(removeduplicates=equal,100 link="index_site_id")} *end_scope ** @auto_xml_channel_end