Guest User

Untitled

a guest
Feb 10th, 2017
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. **------------------------------------------------------------------------------------------------
  2. * @header_start
  3. * WebGrab+Plus ini for grabbing EPG data from TvGuide websites
  4. * @Site: tvtv.de
  5. * @MinSWversion: 1.1.1/53
  6. * @Revision 9 - [19/02/2015] Francis De Paemeleere
  7. * - add region selectable channels (+ revert to xmltv_ns version)
  8. * @Revision 8 - [14/08/2014] Jan van Straaten
  9. * - added removeduplicates from showsplit, customheaders, timezone
  10. * @Revision 7 - [21/06/2013] Jan van Straaten
  11. * - improved episode and subtitle
  12. * @Revision 6 - [05/04/2013] Jan van Straaten
  13. * - for three weeks of epg
  14. * @Revision 5 - [02/03/2013] Jan van Straaten
  15. * - creation
  16. * @Remarks:
  17. * @header_end
  18. **------------------------------------------------------------------------------------------------
  19.  
  20. site {url=tvtv.de|timezone=Europe/Berlin|maxdays=21.3|cultureinfo=de-DE|charset=utf-8|titlematchfactor=90|episodesystem=xmltv_ns}
  21. site {subtitlestype=teletext}
  22. url_index{url|http://tvtv.de/senderlistings_channel.php?channel=##_CHANNEL_##&woche=|urldate}
  23. url_index.headers {customheader=Accept-Encoding=gzip,deflate}
  24. *http://www.tvtv.de/senderlistings_channel.php?channel=ARD&woche=2
  25. urldate.format {list|0|0|0|0|0|0|0|1|1|1|1|1|1|1|2|2|2|2|2|2|2}
  26.  
  27. scope.range {(urlindex)|end}
  28. index_variable_element.modify {addstart|'config_site_id'}
  29. index_variable_element.modify {substring(type=regex)|^(.*)_#region=}
  30. url_index.modify {replace|##_CHANNEL_##|'index_variable_element'}
  31. end_scope.range
  32.  
  33. *
  34. index_showsplit.scrub {multi|<table class="sendungsblock"||</table>|</table>}
  35. ****
  36. * The index page is a 21 days tvguide with the shows grouped in two hour fragments
  37. * the order of these fragments is :
  38. * week 1
  39. * 0: fragment 1 day 1, 1: fragment 1 day 2, ....., 6: fragment 1 day 7.
  40. * 7: fragment 2 day 1, 8: fragment 2 day 2, ....., 13: fragment 2 day 7.
  41. * ...
  42. * 77: fragment 12 day 1, 78: fragment 12 day 2, ....., 84: fragment 12 day 7.
  43. * week 2
  44. * fragment 1 day 8, fragment 1 day 9, ....., fragment 1 day 14.
  45. * fragment 2 day 8, fragment 2 day 9, ....., fragment 2 day 14.
  46. * ...
  47. * fragment 12 day 8, fragment 12 day 9, ....., fragment 12 day 14.
  48. * week 3
  49. * fragment 1 day 15, fragment 1 day 16, ....., fragment 1 day 21.
  50. * fragment 2 day 15, fragment 2 day 16, ....., fragment 2 day 21.
  51. * ...
  52. * fragment 12 day 15, fragment 12 day 16, ....., fragment 12 day 21.
  53. *
  54. scope.range {(splitindex)|end}
  55. index_temp_6.modify {calculate(type=element format=F0)|'index_showsplit' #}
  56. index_temp_6.modify {calculate(format=F0)|1 - 7 /} * we use this to determine how many weeks in the index page
  57. * first sorting, time fragments of the days after each other, days still mixed up
  58. index_temp_1.modify {substring(type=element)|'index_showsplit' 0 1/7} * all 12 fragments of day01|day08|day15
  59. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  60. index_temp_2.modify {addend|'index_temp_1'####}
  61. index_temp_1.modify {substring(type=element)|'index_showsplit' 1 1/7} * all 12 fragments of day02|day09|day16
  62. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  63. index_temp_2.modify {addend|'index_temp_1'####}
  64. index_temp_1.modify {substring(type=element)|'index_showsplit' 2 1/7} * all 12 fragments of day03|day10|day17
  65. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  66. index_temp_2.modify {addend|'index_temp_1'####}
  67. index_temp_1.modify {substring(type=element)|'index_showsplit' 3 1/7} * all 12 fragments of day04|day11|day18
  68. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  69. index_temp_2.modify {addend|'index_temp_1'####}
  70. index_temp_1.modify {substring(type=element)|'index_showsplit' 4 1/7} * all 12 fragments of day05|day12|day19
  71. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  72. index_temp_2.modify {addend|'index_temp_1'####}
  73. index_temp_1.modify {substring(type=element)|'index_showsplit' 5 1/7} * all 12 fragments of day06|day13|day20
  74. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  75. index_temp_2.modify {addend|'index_temp_1'####}
  76. index_temp_1.modify {substring(type=element)|'index_showsplit' 6 1/7} * all 12 fragments of day07|day14|day21
  77. index_temp_1.modify {replace|\||####} * we must make it single to use it in a add operation
  78. index_temp_2.modify {addend|'index_temp_1'####}
  79. index_temp_2.modify {replace|####|\|} * back to multi for operation substring
  80. * Second sorting, order the days
  81. index_showsplit.modify {clear}
  82. * first week:
  83. index_temp_3.modify {substring(type=element)|'index_temp_2' 0 12/'index_temp_6'} * all 12 fragments of day1,2,3,4,5,6,7
  84. index_temp_3.modify {replace|\||####} * single again
  85. index_showsplit.modify {addend|'index_temp_3'####}
  86. * second week:
  87. index_temp_3.modify {substring('index_temp_6' > "12" type=element)|'index_temp_2' 12 12/'index_temp_6'} * all 12 fragments of day8,9,10,11,12,13,14
  88. index_temp_3.modify {replace('index_temp_6' > "12")|\||####} * single again
  89. index_showsplit.modify {addend('index_temp_6' > "12")|'index_temp_3'####}
  90. * third week
  91. index_temp_3.modify {substring('index_temp_6' > "24" type=element)|'index_temp_2' 24 12/'index_temp_6'} * all 12 fragments of day15,16,17,18,19,20,21
  92. index_temp_3.modify {replace('index_temp_6' > "24")|\||####} * single again
  93. index_showsplit.modify {addend('index_temp_6' > "24")|'index_temp_3'####}
  94. index_showsplit.modify {replace|####|\|} * all the 2 hour fragments sorted
  95. *******
  96. index_showsplit.modify {replace|<td class="uhrzeit">|\|} * split the individual shows within a 2 hour block
  97. index_showsplit.modify {select|"title=" ~~} * select the real index shows
  98. *
  99. index_showsplit.modify {cleanup(removeduplicates span=1)}
  100.  
  101. index_variable_element.modify {clear}
  102. index_variable_element.modify {addstart|'config_site_id'}
  103. index_variable_element.modify {substring(type=regex)|_#region=(.*)}
  104.  
  105. * A channel has regional (duplicate) channels, just remove all (but one)
  106. index_showsplit.modify {remove('index_variable_element' not="NOTUSED" type=regex)|^.*?(<span class="region">\s*\(\s*'index_variable_element'\s*\)\s*</span>).*$} * remove the region id of the region we want to keep
  107. index_showsplit.modify {remove(type=regex)|^.*?<span class="region">\s*\(\s*[^\)]*\s*\)\s*</span>.*$} * remove all other regions
  108. end_scope.range
  109.  
  110.  
  111. *
  112. scope.range {(indexshowdetails)|end}
  113. index_temp_1.scrub {single(separator="', '" include=2)|openDetailPopup|(|);|</a>}
  114. index_urlshow.modify {addstart('index_temp_1' not "")|http://tvtv.de/detailansicht.php?sendungs_id='index_temp_1'}
  115. index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate}
  116. *http://tvtv.de/detailansicht.php?sendungs_id=216703670
  117. index_urlchannellogo {url|http://tvtv.de/|<td class="logo">|<img src="|" alt ="Sender:|/>}
  118. *
  119. index_start.scrub {single|||<|<}
  120. index_title.scrub {single|title="mehr|"|"">|</a>}
  121. end_scope
  122. scope.range {(showdetails)|end}
  123. title.scrub {single|<div id="DetailTitelinfos">|class="DetailTitel">|</|</div>}
  124. title.modify {cleanup}
  125. titleoriginal.scrub {single|<span class="DetailblockOrig">||</span>|</span>}
  126. subtitle.scrub {single(exclude="<b>" separator="," exclude="Staffel""Folge")|<span class="DetailFolgeninfo">||</span>|</span>}
  127. description.scrub {single|<span class="DetailTheman">||</span>|</span>}
  128. description.scrub {single|<div id="DetailText">|<span class="DetailText">|</span>|</div>}
  129. description.modify {cleanup}
  130. director.scrub {single|<span class="DetailblockRegie">|'">|</a>|</span>}
  131. actor.scrub {multi|<span class="DetailblockDarsteller">|'">||</span>}
  132. actor.modify {addend|>}
  133. actor.modify {cleanup(tags="<"">")}
  134. actor.modify {remove|>}
  135. actor.modify {remove|,}
  136. presenter.scrub {multi|<span class="DetailblockModeration">|'">|</a>|</span>}
  137. presenter.modify {cleanup(removeduplicates=name)}
  138. presenter.modify {cleanup}
  139. producer.scrub {single|<span class="DetailblockProduktion">||</span>|</span>}
  140. producer.modify {replace|/|\|}
  141. producer.modify {cleanup}
  142. writer.scrub {multi|<span class="DetailblockAutor">|'">|</a>|</span>}
  143. writer.modify {cleanup}
  144. composer.scrub {multi|<span class="DetailblockMusik">|'">|</a>|</span>}
  145. composer.modify {cleanup}
  146. category.scrub {single|<span class="DetailGenre">||</span>|</span>}
  147. category.scrub {multi|<span class="DetailblockKategorie">|'">|</a>|</span>}
  148. productiondate.scrub {single|<span class="DetailJahr">||</span>|</span>}
  149. episode.scrub {single(exclude="<b>" separator="," include="Staffel""Folge")|<span class="DetailFolgeninfo">||</span>|</span>}
  150. episode.modify {replace|\||,}
  151. temp_1.scrub {single|<span class="DetailSonderzeichen">||</span>|</span>}
  152. subtitles.modify {addstart('temp_1' ~"Gehörlose/VT")|true}
  153. videoaspect.modify {addstart('temp_1' ~ "Breitbild")|16:9}
  154. videoquality.modify {addstart('temp_1' ~ "HDTV")|HDTV}
  155. *
  156. * convert episode to xmltv_ns :
  157. * example : Staffel 7, Folge 2 von 30
  158. * temp_1 = season
  159. * temp_2 = episode
  160. * temp_3 = number of seasons
  161. * temp_4 = number of episodes
  162. temp_1.modify {substring(type=regex)|'episode' "Staffel (\d+)"}
  163. temp_3.modify {substring(type=regex)|'episode' "Staffel.\d+ von (\d+)"}
  164. temp_2.modify {substring(type=regex)|'episode' "Folge (\d+)"}
  165. temp_4.modify {substring(type=regex)|'episode' "Folge.\d+ von (\d+)"}
  166. temp_1.modify {calculate(not="" format=F0)|1 -}
  167. temp_2.modify {calculate(not="" format=F0)|1 -}
  168. episode.modify {clear}
  169. episode.modify {addend('temp_1' not="")|'temp_1'}
  170. episode.modify {addend('temp_3' not="")|/'temp_3'}
  171. episode.modify {addend|.}
  172. episode.modify {addend('temp_2' not="")|'temp_2'}
  173. episode.modify {addend('temp_4' not="")|/'temp_4'}
  174. episode.modify {addend|.}
  175. episode.modify {clear(="..")}
  176. *
  177. end_scope.range
  178. *
  179. ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  180. ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
  181. **
  182. ** @auto_xml_channel_start
  183. *index_site_channel.scrub {multi|<a href="senderlistings_channel.php?channel=|">|</a>|</li>}
  184. *index_site_id.scrub {multi|a href="senderlistings_channel.php?channel=||">|</li>}
  185. *index_site_id.modify {addend|_#region=NOTUSED}
  186. ** @auto_xml_channel_end
RAW Paste Data