You are here

help with new site.ini file

14 posts / 0 new
Last post
jztilly
Offline
Joined: 6 years
Last seen: 5 years
help with new site.ini file

Hi guys,

I'm trying to write my own ini file but i'm really struggling. I've followed as much as i could understand from the documentation and a few forum posts and can get it to generate the correct URLs, but the showsplit is confusing me. I've looked through a number of other ini files and tried a number of things but I keep going back to nothing :(

Here is my ini file so far:

site {url=epg.abctv.net.au|timezone=UTC+00:00|maxdays=6|cultureinfo=en-AU|charset=ISO-8859-1|titlematchfactor=90}
*site {ratingsystem=ES|episodesystem=onscreen|grabengine=|firstshow=0|firstday=0000000}
url_index{url|http://epg.abctv.net.au/processed/|channel|_|urldate|.json}
urldate.format {datestring|yyyy-MM-dd}
*subpage.format {number||1|}
index_showsplit.scrub{(debug)multi|"channel"}

I'm struggling as the JSON file on the source website (http://epg.abctv.net.au/processed/Melbourne_2019-01-15.json) has all the channels on 1 page. The actual listing data comes after a number of other tags.

So for the first channel on the webapge, the actual listings start after:
{"date": "2019-01-05", "region": "Melbourne", "schedule": [{"channel": "ABC1", "listing":

Second one after:
{"channel": "ABC2", "listing":

Using my code splits it down to individual channels, but need to subsplit(?) it down into channels from there... If anyone could please lend a hand in trying to split it further I should be ok to get the rest done :) I've also attached the log from using the above ini.

Thanks in advance!

Attachments: 
jztilly
Offline
Joined: 6 years
Last seen: 5 years

Thanks Goran! That's ever so helpful :) So far it's pretty good but have a few little bugs.

I've got the basic info working ok - that is start/stop times, title and description and even managed to copy the season/episode code from the freeview.com.au.ini before i found 2 issues below:

1. There are two "channels" within the JSON data which are the same channel but one is for the daytime viewing ("ABC4KIDS") and nighttime viewing ("ABC2"). How does one go about merging these two data sources together into one xmltv channel id?

2. The other issue is there are programs from the previous day in the next days listings! For example, in todays JSON data (2019-01-05) the last programs start time is "2019-01-05T23:29:00", but the same program appears as the first program in tomorrows (2019-01-06) JSON data. Is there a way to get it to ignore listings with yesterdays date?

So 2 issues where i'm not sure where to start! Thanks again for your help!

site {url=epg.abctv.net.au|timezone=UTC+10:00|maxdays=6|cultureinfo=en-AU|charset=ISO-8859-1|titlematchfactor=90}
site {episodesystem=onscreen}
url_index{url|http://epg.abctv.net.au/processed/Melbourne_|urldate|.json}
urldate.format {datestring|yyyy-MM-dd}

index_variable_element.modify{set|'config_site_id'}
index_showsplit.scrub{multi|{"channel": "'index_variable_element'|{"consumer_advice"|}|}}
index_start.scrub {single|"start_time": "||"|}
index_stop.scrub {single|"end_time": "||"|}
index_title.scrub {single|"title": "||"|}
index_description.scrub {single|"description": "||"|}

index_temp_1.scrub {single|"episode_num": ||,|}
index_temp_1.modify {addstart (not"")|E}
index_temp_2.scrub {single|"series_num": ||,|}
index_temp_2.modify {addstart(not"")|S}
index_temp_2.modify {addend|'index_temp_1'}
index_episode.modify {set(pattern="S'S1'E'E1'""E'E1'""S'S1'")|'index_temp_2'}

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 32 min

the solution for the last problem is here

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 18 min

You have several errors, the index_showsplit's above are wrong. So read the manual as there are several ways to do it and keep up to good work. You should end up for 1 day with something like:
[ Debug ] 12594 shows in 511 channels
[ Debug ] 0 updated shows
[ Debug ] 12594 new shows added
[ Info ]
[ Info ]
[ ] Job finished at 05/01/2019 16:19:31 done in 1m 58s

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 18 min
Goran wrote:

Remove duplicate shows (put before index_start)
index_temp_3.modify {substring(type=regex)|'index_showsplit' ""start_time": "([^"]+)\""}
index_temp_3.modify {cleanup(removeduplicates=equal,100 link="index_showsplit")}
to merge channels i don't know
remove index_stop.scrub - that you don't have 1 min gap between shows.

don't need to do that.

jztilly
Offline
Joined: 6 years
Last seen: 5 years

Thanks Goran and Blackbear - your input is much appreciated.

Unfortunately the remove duplicates lines don't seem to work. I'm wondering if it's possible to use the dates it's using for the URL and have it ignore anything that doesn't have todays date on a entry?

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 32 min

i did this ini a yr ago and yes u need to deal with duplicates.

i realize ur new at this but u need todo this in scope(see the manual)
and yes u can substing just the start time to use for duplicate removal rather than the entire show.
this goes after ur showsplit.scrub line..

what this does is substring the start time from each show into a temp element,then if a duplicate exists it remove the same show from the showsplit.
ignore the first replace line as ur showsplit is different and u dont need this.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 32 min

also
timezone=UTC
and
timezone=UTC+00:00
are not the same,the first doesnt observe DST where the 2nd one does.so this wud change from +00:00 to +01:00

jztilly
Offline
Joined: 6 years
Last seen: 5 years

thanks again but im gonna throw in the towel. im not that desperate and seems like matt and yourself have done the work but dont want to share it. ill just stick with the EIT data.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 32 min

ur never to old to learn,i started just like you..from no knowledge.
i am done posting completed ini's.

jztilly
Offline
Joined: 6 years
Last seen: 5 years

thanks guys. i gave it a bit more time and think i have it a little more refined.

I changed the showsplit to the following as not all programs started with "consumer_advice":
index_showsplit.scrub {multi(debug)|{"channel": "'index_variable_element'| {|},|}]},}

I am having trouble getting my head around the blocks and elements as in I can't seem to get consistent results for the start and end times. Why does the end_time double up on the quotation marks whereas the start_time doesn't?:

After they're processed they look good, I'm just trying to get my head around the debugging.

Thanks to blackbear and goran for the extra code - it does seem to work but it sticks (n) on the end of every description when it's enabled.

One last thing - the info on how to 'join' channels together using the config file is great, but is there any way to remove the WARNING: show ends after... in the program description?

Cheers

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 18 min

index_start.scrub {single|"start_time": "||"|"} is correct or better index_start.scrub {single|"start_time": "||",|",}
About remove duplicates, Goran and Blackbear are correct with that showsplit.

jztilly
Offline
Joined: 6 years
Last seen: 5 years

Thanks to all of you. Seems like its all working as expected! I'm using an xml transform sheet to remove/replace stuff so it works better with plex but i'm pretty happy.

and here was the final code:
site {url=epg.abctv.net.au|timezone=Australia/Melbourne|maxdays=6|cultureinfo=en-AU|charset=ISO-8859-1|titlematchfactor=90}
site {episodesystem=xmltv_ns}
url_index{url|http://epg.abctv.net.au/processed/Melbourne_|urldate|.json}
urldate.format {datestring|yyyy-MM-dd}

index_variable_element.modify{set|'config_site_id'}
index_showsplit.scrub {multi|{"channel": "'index_variable_element'| {|},|}]},}

scope.range{(splitindex)|end}
index_temp_3.modify {substring(type=regex)|'index_showsplit' "\"start_time\": \"([^"]+)\""}
index_temp_3.modify {cleanup(removeduplicates=equal,100 link="index_showsplit")}
end_scope

*index_start.scrub {single|start_time": |"|"|",|}
index_start.scrub {single|"start_time": "||",|",}
index_stop.scrub {single|"end_time": "||"|"}
index_title.scrub {single|"title": "||",|",}
index_description.scrub {single|"description": "||",|",}
index_category.scrub {single|"genres": ["||"|"]}
index_category.scrub {single|"genres": ["|", "|"|"]}

index_temp_1.scrub {single|"episode_num": ||,|}
index_temp_1.modify {addstart (not"")|E}
index_temp_2.scrub {single|"series_num": ||,|}
index_temp_2.modify {addstart(not"")|S}
index_temp_2.modify {addend|'index_temp_1'}
index_episode.modify {set(pattern="S'S1'E'E1'""E'E1'""S'S1'")|'index_temp_2'}

thanks again (and sorry about the size of the screenshot)

jdevcl
Offline
Donator
Joined: 4 years
Last seen: 1 year

nice

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl