106 lines
5.4 KiB
INI
Executable File
106 lines
5.4 KiB
INI
Executable File
**------------------------------------------------------------------------------------------------
|
|
* @header_start
|
|
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
|
|
* @Site: tvtv.us
|
|
* @MinSWversion: V2.1
|
|
* @Revision 5 - [20/04/2020] WGT*add elements (see note below)
|
|
* @Revision 4 - [20/02/2020] WGT* ATTENTION !! need in folder \WebGrab+Plus\robots\tvtv.us.robots to be read-only and with only 2 lines:
|
|
* User-agent: *
|
|
* User-agent: WebGrab+Plus
|
|
* @Revision 3 - [18/01/2020] WGT*
|
|
* @Revision 2 - [03/09/2019] FilipeKAV
|
|
* url_index and CHANEL FILE CREATION xml fix.
|
|
* @Revision 1 - [07/09/2018] r00ty
|
|
* Initial work on tvtv.us (and tvtv.ca separately)
|
|
* @Remarks:
|
|
* mostly json and on single page
|
|
* @header_end
|
|
**------------------------------------------------------------------------------------------------
|
|
site {url=tvtv.us|timezone=UTC|maxdays=7|cultureinfo=en-US|charset=UTF-8|episodesystem=onscreen|ratingsystem=US}
|
|
** Separate lineup and station ID
|
|
scope.range{(urlindex)|end}
|
|
global_temp_1.modify{substring(type=regex)|'config_site_id' "\/(.*?)$"}
|
|
global_temp_2.modify{substring(type=regex)|'config_site_id' "^(.*?)\/"}
|
|
url_index.modify{replace|##prov##|'global_temp_2'}
|
|
url_index.modify{replace|##chan##|'global_temp_1'}
|
|
end_scope
|
|
*
|
|
url_index{url|https://tvtv.us/tvm/t/tv/v4/lineups/##prov##/listings/grid?detail=%27brief%27&start=|urldate|T00:00:00.000Z&end=|urldate|T23:59:00.000Z&startchan=##chan##&endchan=##chan##}
|
|
**
|
|
url_index.headers {customheader=Accept-Encoding=gzip,deflate} * to speedup the downloading of the index pages
|
|
urldate.format {datestring|yyyy-MM-dd}
|
|
**
|
|
index_showsplit.scrub {regex||"listings"\:\[\s*(\{.*?"showHost".*?\},?\s*)+.*?||}
|
|
index_showsplit.modify {cleanup(style=jsondecode)}
|
|
**
|
|
index_variable_element.modify {set|'config_site_id'}
|
|
global_temp_3.scrub {regex||\{\s*"channel":\{.*?"logoFilename":"(.*?)"\,?.*?"listings".*]||}
|
|
index_urlchannellogo.modify {addstart|https://tvtv.us/tvm/i/image/station/100x100/'global_temp_3'}
|
|
**
|
|
scope.range{(indexshowdetails)|end}
|
|
index_start.scrub {single|"listDateTime"|:"|",|",}
|
|
index_description.scrub {single|"description"|:"|",|",}
|
|
index_title.scrub {single|"showName"|:"|",|",}
|
|
index_subtitle.scrub {single|"episodeTitle"|:"|",|",}
|
|
index_category.scrub {single|"showType"|:"|",|",,}
|
|
index_rating.scrub {single|"rating"|:"|",|",}
|
|
index_title.modify {replace("Movie")|'index_title'|'index_subtitle'}
|
|
index_subtitle.modify {remove('index_title')|'index_subtitle'}
|
|
index_director.scrub{single(separator=",")|"director":"||",|",}
|
|
index_actor.scrub {single(separator=",")|"cast":"||",|",}
|
|
index_productiondate.scrub{single|"year":"||",|",}
|
|
index_showicon.modify {addstart(not"")|https://cdn.tvpassport.com/image/show/480x720/}
|
|
**
|
|
** Some special handling for sports
|
|
index_temp_3.scrub {single|"team1"|:"|",|",}
|
|
index_temp_4.scrub {single|"team2"|:"|",|",}
|
|
index_temp_5.scrub {single|"location"|:"|",|",}
|
|
index_temp_6.scrub {single|"league"|:"|",|",}
|
|
** Show ID only for secondary lookup per show
|
|
index_temp_7.scrub {single|"showID"|:|,}
|
|
index_temp_8.modify {addstart('index_temp_3' not "")|'index_temp_3'}
|
|
index_temp_8.modify {addend('index_temp_8' not "")| vs. 'index_temp_4'.}
|
|
index_description.modify {addstart('index_temp_6' not "")|'index_temp_6' }
|
|
index_description.modify {addend('index_temp_8' not "")| 'index_temp_8'}
|
|
index_description.modify {addend('index_temp_5' not "")| 'index_temp_5'}
|
|
index_subtitle.modify {addstart('index_subtitle' "")|'index_temp_8'}
|
|
**
|
|
** Split multiple categories
|
|
index_category.modify {replace|,|\|}
|
|
end_scope
|
|
**
|
|
** If you would like episode numbers, then uncomment the following lines. It will mean an extra web action per show (much slower)
|
|
index_urlshow.modify {addstart|https://tvtv.us/tvm/t/tv/v4/episodes/'index_temp_7'}
|
|
scope.range{(showdetails)|end}
|
|
title.scrub{single|"seriesName"|:"|",|",}
|
|
title.modify {replace("Movie")|'title'|'index_title'}
|
|
temp_1.scrub {single|"seasonNumber"|:|,}
|
|
temp_2.scrub {single('temp_1' not "")|"seasonSeqNo"|:|,}
|
|
temp_1.modify {replace|0|}
|
|
temp_2.modify {replace|0|}
|
|
episode.modify {addstart('temp_2' not "")|S'temp_1' E'temp_2'}
|
|
end_scope
|
|
** End of episode number section
|
|
**
|
|
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
|
|
**
|
|
** Note, the 36212D is the line-up for New York DirecTV. You can get your own lineup by visiting http://tvtv.us enter your location.
|
|
** It should then load a URL like: https://www.tvtv.us/ny/new-york-mills/lu2381D for which you just take everything after "lu" as your lineup ID
|
|
** Then you can add a line like the following (replacing the site_id value with your own linup:
|
|
** <channel update="i" site="tvtv.us" site_id="2381D" xmltv_id="tvtv New York">tvtv New York</channel>
|
|
** It will then generate a channel file for your line-up
|
|
**
|
|
** @auto_xml_channel_start
|
|
*url_index{url|https://tvtv.us/tvm/t/tv/v4/lineups/|channel|}
|
|
*index_temp_9.scrub{regex||"lineupID":"(.*?)","||}
|
|
*index_site_channel.scrub {regex||"name":"(.*?)","callsign":"||}
|
|
*index_site_id.scrub {regex||{"number":"(.*?)","channelNumber"||}
|
|
*index_site_channel.modify {replace|\'|}
|
|
*index_site_channel.modify {cleanup(style=jsondecode)}
|
|
*index_site_id.modify {addstart|'index_temp_9'/}
|
|
*scope.range {(channellist)|end}
|
|
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
|
|
*end_scope
|
|
** @auto_xml_channel_end
|