**------------------------------------------------------------------------------------------------ * @header_start * WebGrab+Plus ini for grabbing EPG data from TvGuide websites * @Site: tvkingdom.jp * @MinSWversion: V3.0.0 * @Revision 4 - [11/02/2021] Blackbear199 * - site renamed to tvkingdom.jp * - details title fix * - added b24k8k channels * @Revision 3 - [09/09/2020] Blackbear199 * - detail title fix * @Revision 2 - [15/04/2020] Blackbear199 * - add region for local to channel xml * @Revision 1 - [20/11/2018] Blackbear199 * - urlindex/channels.xml fix * @Revision 0 - [17/10/2016] Blackbear199 * - creation * @Remarks: for Terrestrial(地上波),BS1,BS2,BS3,BS4 * @header_end **------------------------------------------------------------------------------------------------ site {url=tvkingdom.jp|timezone=Asia/Tokyo|maxdays=7|cultureinfo=ja-JP|charset=UTF-8|titlematchfactor=90} site {ratingsystem=JP|episodesystem=onscreen} * url_index {url|https://www.tvkingdom.jp/chart/##system##&head=|urldate|0600&span=24&chartWidth=950&cellHeight=5&sticky=false&descriptive=false&iepgType=1&buttonType=0} url_index.headers {customheader=Accept-Encoding=gzip,deflate} * urldate.format {datestring|yyyyMMdd} * scope.range{(urlindex)|end} global_temp_1.modify {substring(type=regex)|'config_site_id' "^([^#]*##\d+)##\d+$"} global_temp_1.modify {replace|##|.action?group=} url_index.modify {replace|##system##|'global_temp_1'} end_scope * global_temp_2.modify {substring(type=regex)|'config_site_id' "##(\d+)$"} index_showsplit.scrub {multi(includeblock="id="cell-station-top-'global_temp_2'"")|
"} index_temp_1.modify {substring(type=regex)|'index_showsplit' "schedule-head-(\d+)\""} index_temp_1.modify {cleanup(removeduplicates span=1 link="index_showsplit")} *index_showsplit.modify {(debug)} end_scope * index_urlshow {url|https://www.tvkingdom.jp||} index_urlshow.headers {customheader=Accept-Encoding=gzip,deflate} * index_start.scrub {single(pattern="yyyyMMddHHmm")|schedule-head-||"|"} index_title.scrub {single|||} * index_title.modify {remove|} index_title.modify {remove(type=regex)|"\s*(?:\[[^\]]*\]\|「.*?」\|【.*?】\|(?:シーズン\|S)?\d*\s*#\d+)\s*"} index_title.modify {remove(type=regex)|"(シーズン\d+)(?:\s*#\d+)?"} * title.scrub {single|

||

|} description.scrub {single|

番組概要

|

|

|
} category.scrub {multi(include="genres[0]" separator=" , ")|
|
|
|
} * title.modify {remove(type=regex)|"\[[^\]]*\]"} subtitle.modify {substring(type=regex)|'title' "[「【](.*?)[」】]"} subtitle.modify {clear(~ "シーズン")} title.modify {remove(type=regex)|"[「【].*?[」】]"} description.modify {cleanup(tags="<"">")} category.modify {cleanup(tags="<"">")} temp_2.modify {substring(type=regex)|'description' "[「【](.*?)[」】]"} temp_2.modify {clear(~ "シーズン")} description.modify {remove(type=regex)|"[「【].*?[」】]"} episode.modify {substring(pattern="シーズン'S1' #'E1'""S'S1' #'E1'""#'E1'" type=regex)|'title' "(?:シーズン\|S)?\d*\s*#\d+"} temp_1.modify {substring(type=regex)|'title' "(シーズン\d+)\s*#\d+"} episode.modify {clear('temp_1' not "")} title.modify {remove('episode' not "")|'episode'} title.modify {remove('temp_1' not "")|'temp_1'} temp_1.modify {remove|(} temp_1.modify {remove|)} loop{('epsisode' "" max=1)|1} episode.modify {set('temp_1' not "")|'temp_1'} loop{('subtitle' "" max=1)|1} subtitle.modify {set('temp_2' not "")|'temp_2'} ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### REGION FILE CREATION (only to create the xxx-channel.xml file) ** * for creation region local for terrestrial ** @auto_xml_channel_start *url_index {url|https://www.tvkingdom.jp/chart/23.action?group=10} *index_site_id.scrub {multi|]*>(.*?)(?:.*?))*||} *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} ** @auto_xml_channel_end ** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file) ** **** use channel region line created in above step **** for Terrestrial(地上波),BS1,BS2,BS3,BS4,b23k8k 1/2 ** @auto_xml_channel_start *url_index {url|https://www.tvkingdom.jp/chart/|subpage|} *url_index.modify {replace|##|.action?group=} *subpage.format {list|'global_temp_1'##10|bs1##21|bs2##22|bs3##23|bs4##24|bs4k8k_1##41|bs4k8k_2##42} *global_temp_1.modify {set|'config_site_id'} *scope.range {(channellist)|end} *index_site_id.scrub{|} *index_temp_9.scrub {multi|
|} *index_temp_4.modify {set|0} *loop{(each "index_temp_8" in 'index_temp_9')|end} *index_temp_7.modify {set|'config_site_id'##10\|bs1##21\|bs2##22\|bs3##23\|bs4##24\|bs4k8k_1##41\|bs4k8k_2##42} *index_temp_7.modify {substring(type=element)|'index_temp_7' 'index_temp_4' 1} *index_temp_6.modify {substring(type=regex)|'index_temp_8' "id=\"cell-station-top-(\d+)\""} *index_temp_6.modify {addstart|'index_temp_7'##} *index_temp_6.modify {replace|\||###} *index_temp_1.modify {addend|'index_temp_6'###} *index_temp_5.modify {substring(type=regex)|'index_temp_8' "id=\"cell-station-top-\d+\"[^t]*title=\"([^\"]*)\""} *index_temp_5.modify {replace|\||###} *index_temp_2.modify {addend|'index_temp_5'###} *index_temp_4.modify {calculate(format=F0)|1 +} *end_loop *index_site_id.modify {substring(type=regex)|'index_temp_1' "(.*?)###"} *index_site_channel.modify {substring(type=regex)|'index_temp_2' "(.*?)###"} *index_site_id.modify {cleanup(removeduplicates=equal,100 link="index_site_channel")} *end_scope ** @auto_xml_channel_end