126 lines
8.3 KiB
INI
Executable File
126 lines
8.3 KiB
INI
Executable File
**------------------------------------------------------------------------------------------------
|
|
* @header_start
|
|
* WebGrab+Plus ini for grabbing EPG data from TvGuide websites
|
|
* @Site: theguardian.com
|
|
* @MinSWversion: V0
|
|
* none
|
|
* @Revision 1 - [15/08/2013] Francis De Paemeleere
|
|
* adjust to new server (tvlistings.guardian.co.uk -> tvlistings.theguardian.com)
|
|
* @Revision 0 - [27/02/2013] Spitfires
|
|
* Output episode number in xmltv_ns format (Based on guardian.co.uk.ini rev 3)
|
|
* @Remarks:
|
|
* The Guardian site can block your IP for a short period.
|
|
* @header_end
|
|
**------------------------------------------------------------------------------------------------
|
|
|
|
site {url=theguardian.com|timezone=UTC+00:00|maxdays=10|cultureinfo=en-GB|charset=ISO-8859-1|episodesystem=onscreen}
|
|
url_index{url|http://tvlistings.theguardian.com/text-only/?tvgChannelName=|channel|&tvgBroadcaster=UKSkyCable&tvgRegion=London&tvgDayOffset=|urldate|f}
|
|
urldate.format {daycounter|0}
|
|
|
|
index_showsplit.scrub {multi|<div class="tvg_channelname">|<span class="tvg_show"|</div></div>|<script type="text/javascript">}
|
|
index_start.scrub {single|tvg_show_start|>|</span>|</span>}
|
|
index_title.scrub {single|tvg_show_title|>|</span>|</span>}
|
|
index_subtitle.scrub {single(separator=": " include=last)|tvg_show_episode_title|>|</div>|</div>}
|
|
index_description.scrub {single(separator="Starring""starring"", with"", With" include=first)|tvg_show_description|>|<span|<span}
|
|
index_category.scrub {single(separator="/")|tvg_show_category|>|</span|</span}
|
|
index_episode.scrub {single(separator=":" include=first)|tvg_show_episode_title|Series|</div>|</div>}
|
|
index_actor.scrub {single(separator=","" and "")""("|tvg_show_description|starring |<span|<span}
|
|
index_previousshown.scrub {single(separator=" " include="REP")|<span class="tvg_show_flags|">[|]|</span>}
|
|
index_premiere.scrub {single(separator=" " include="Live")|<span class="tvg_show_title|">|<|/span>}
|
|
index_subtitles.scrub {single(separator=" " include="SUB")|<span class="tvg_show_flags|">[|]|</span>}
|
|
*
|
|
index_temp_3.scrub {single(include="Part")|tvg_show_description|>|.|<span}
|
|
*
|
|
* Mods
|
|
*
|
|
index_temp_1.scrub {single(separator=","" and ")|tvg_show_description|, with |<span|<span}
|
|
index_temp_2.modify {calculate(format=F0)|'index_temp_1' " " #}
|
|
index_temp_2.modify {calculate(format=F0)|15 /}
|
|
index_actor.modify {addstart(null)|'{single(separator=","" and ")|tvg_show_description|voices of |<span|<span}'}
|
|
index_actor.modify {addstart(null)|'{single(separator=","" and ")|tvg_show_description| voice of |<span|<span}'}
|
|
index_actor.modify {addstart('index_temp_2' "0" null)|'index_temp_1'}
|
|
index_actor.modify {remove|informed analysis}
|
|
index_actor.modify {remove| with }
|
|
index_actor.modify {remove|the voice of }
|
|
index_episode.modify {replace|. Episode |E}
|
|
index_episode.modify {addstart(notnull|S}
|
|
index_previousshown.modify {replace(== "REP")|'index_previousshown'|true}
|
|
index_premiere.modify {replace(== "Live")|'index_premiere'|true}
|
|
index_subtitles.modify {replace(== "SUB")|'index_subtitles'|true}
|
|
index_description.modify {remove|'index_temp_3'.}
|
|
index_temp_3.modify {replace|Part|P}
|
|
index_temp_3.modify {replace|one|1}
|
|
index_temp_3.modify {replace|two|2}
|
|
index_temp_3.modify {replace|three|3}
|
|
index_temp_3.modify {replace|four|4}
|
|
index_temp_3.modify {replace|five|5}
|
|
index_temp_3.modify {replace| of |/}
|
|
index_temp_3.modify {replace| |}
|
|
index_episode.modify {addend('index_temp_3' not ""|'index_temp_3'}
|
|
index_actor.modify {remove|'{multi(separator=","" and ")|tvg_show_description|(|)|<span}'}
|
|
|
|
|
|
* episode format was S2E9/10P1/2 now 2.9/10.1/2
|
|
|
|
*********************************************************************************************************************
|
|
* Adjust an episode number to be xmltv_ns compliant
|
|
* for compliance with xmlv.dtd the season, episode and part numbers are zero-based
|
|
* e.g. "9.13/36." >> "8.12/36."
|
|
* "3.1.1/2" >> "2.0.0/2"
|
|
* "3/5..1/2" >> "2/5..0/2"
|
|
* "0.1/2.2/2" >> "0.0/2.1/2"
|
|
*
|
|
* Author: spitfires 20-Feb-2013 (credit: Jan van Straaten)
|
|
*
|
|
index_temp_1.modify {clear} * var to hold the created episode
|
|
index_temp_6.modify {clear} * var to hold working copy of current episode
|
|
index_temp_6.modify {addstart|'index_episode'} * working copy of episode
|
|
index_temp_6.modify {replace| |} * strip spaces
|
|
* *
|
|
loop ({1 = 1 max=2)|end} * loop thrice - once for each set of numbers
|
|
index_temp_2.modify {calculate(format=F0)|'index_temp_6' "." @} * index of first . (-1 if not found)
|
|
index_temp_3.modify {clear} *
|
|
index_temp_3.modify {substring('index_temp_2' > "0" type=char)|'index_temp_6' 0 'index_temp_2'} * get the next number between dots
|
|
index_temp_3.modify {substring('index_temp_2' = "-1" type=char)|'index_temp_6' 0} * note: n.n is actually invalid but we'll allow it
|
|
* * number may be "3" or "3/4" or ""
|
|
index_temp_4.modify {calculate(format=F0)|'index_temp_3' "/" @} * index of / (-1 if not found)
|
|
index_temp_5.modify {clear} *
|
|
index_temp_5.modify {substring('index_temp_4' > "0" type=char)|'index_temp_3' 'index_temp_4'} * store the "/nn"
|
|
index_temp_3.modify {replace|'index_temp_5'|} * remove the "/nn"
|
|
index_temp_3.modify {calculate('index_temp_3' not "" format=F0)} * extract first numeric string
|
|
index_temp_4.modify {clear} *
|
|
index_temp_4.modify {addstart('index_temp_3' = "0")|0} * must output 0 if input="0"!
|
|
index_temp_4.modify {calculate('index_temp_3' > "0" format=F0)|'index_temp_3' 1 -} * subtract 1
|
|
index_temp_1.modify {addend|'index_temp_4'} * append new episode or part number
|
|
index_temp_1.modify {addend|'index_temp_5'.} * append the "/nn"
|
|
* *
|
|
index_temp_2.modify {calculate(format=F0)|1 +} * increment the index
|
|
index_temp_6.modify {substring('index_temp_2' > "0" type=char)|'index_temp_6' 'index_temp_2'} * remove the number from the input
|
|
end_loop *
|
|
* *
|
|
index_temp_2.modify {calculate(format=F0)|'index_temp_1' "." -@} * remove the trailing dot
|
|
index_temp_1.modify {substring('index_temp_2' > "0" type=char)|'index_temp_1' 0 'index_temp_2'} * - we have one too many ;)
|
|
* *
|
|
index_episode.modify {clear} * clear the existing episode
|
|
index_episode.modify {addstart|'index_temp_1'} * store the computed episode details
|
|
index_episode.modify {remove("..")|'index_episode'} * delete the episode if 'null'
|
|
* *
|
|
*********************************************************************************************************************
|
|
|
|
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
|
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
|
|
**
|
|
** @auto_xml_channel_start
|
|
* --The channel list has lines with site_id="PA", these should be removed
|
|
* --lines with site_id="" need to be changed with site_id="PA%7C%7C" and the channel name.
|
|
* ----For example site_id="" for Sky Action HD should be changed to site_id="PA%7C%7CSky Action HD"
|
|
*
|
|
*index_site_id.scrub {multi()|="tvgChannelName">|value="|"|</form><div }
|
|
*index_site_channel.scrub {multi()|="tvgChannelName">|">|</option|</form><div }
|
|
*scope.range {(channellist)|end}
|
|
*index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")}
|
|
*end_scope
|
|
** @auto_xml_channel_end
|
|
|
|
|