You are here

Questions about siteini

16 posts / 0 new
Last post
Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks
Questions about siteini

Hello,

I'm in the process of finalizing a siteini and I have a few questions.

1) Is it possible to put more than one source (URL) to retrieve the guide?
If the first guide is inaccessible, the second source would be used.

2) In the section for creating channels, I'd like all channels to use update="f" instead of update="i".
How can I do this?

3) Stil in the section for creating channels, how do I get the xmltv_id to take the same value as site_id rather than the channel name?

Currently
------------------------------------------------------------------------------------------------
<channel update="i" site="mysite.com" site_id="Channel1.fr" xmltv_id="My channel">My channel</channel>
------------------------------------------------------------------------------------------------

That's what I'd like.
------------------------------------------------------------------------------------------------
<channel update="f" site="mysite.com" site_id="Channel1.fr" xmltv_id="Channel1.fr">My channel</channel>
------------------------------------------------------------------------------------------------

Here's the CHANNEL FILE CREATION

===============================================================================================
** _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
** ##### CHANNEL FILE CREATION (only to create the xxx-channel.xml file)
** @auto_xml_channel_start
*index_site_id.scrub {regex||<channel [^>]*id="[^\"]*"[^>]*>.*?</channel>||}
*scope.range {(channellist)|end}
*index_site_channel.modify {addstart|'index_site_id'}
*index_site_id.modify {substring(type=regex)|<channel [^>]*id="([^\"]*)"[^>]*>}
*index_site_channel.modify {substring(type=regex)|<display-name [^>]*>(.*?)</display-name>}
*index_site_id.modify {cleanup(removeduplicates=equal link="index_site_id")}
*end_scope
** @auto_xml_channel_end
===============================================================================================

Thank you for your help.

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 12 hours

Not clear what you need...The channel list is created with update "c" not F or I.
1. Not really, WG++ use also postback but no program is able to understand if first link is not good to use a second one. You can solve with different siteini and probably try to merge them
2. Channel list only use update "c"
3. do the same scrub

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks

Sorry if I wasn't specific enough.

What I'm trying to do is modify some entries in the FILE CREATE CHANNEL section to have a slightly different output when the channels are generated.

I want the generated channels to have the 'xmltv_id' which is the same as the 'site_id'. Currently the 'xmltv_id' uses the value of the channel name.
Then for each generated channel, I want the value displayed update=“i” to be update=“f”. (Nothing to do with the c parameter for generating channels.)

I'll let you have another look at my first message with the expected results, hoping I've made myself clear.

Thanks to you.

japangelo
Offline
japangelo's picture
Donator
Joined: 4 years
Last seen: 1 hour

from your scrubs its very hard to comprehend what you really trying to do..in the site id scrub youre matching the whole line since i dont see parenthesis, also the substrings are wrong..overall kinda confusing and wrong in my opinion..moreover i dont get the need of update="f" in the channel list..why? whats the point of it and i dont think wg let you do that..it just creates lines with update="i"

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

you want to use alloc,with it u can set the xmltv_id="xxx" to the site="xxx" value.
section 4.5.3 in the manual.
another option that may be of interest is channelnameprefix,look it up in the manual.
for changing update=“i” to be update=“f” use your editor replace feature or simply use <update>f</update>
this overrides any channel line setting update mode.

from the manual...
With the dedicated argument alloc it is possible to change the allocation of these values. This argument accepts only
three values : site_id, xmltv_id and display_name E.g. (alloc=site_id,xmltv_id)
index site_id.scrub (multi(alloc=site_id,xmltv_id)|your_scrub_string}

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks
japangelo wrote:

moreover i dont get the need of update="f" in the channel list..why?

The guide I'm working on will retrieve information about soccer matches, and the script will retrieve various daily information, such as the match location, the referee, etc...
This information usually arrives a few days before the match. If you leave it on 'i', this information is never updated in the guide description.

Blackbear199 wrote:

you want to use alloc,with it u can set the xmltv_id="xxx" to the site="xxx" value.
section 4.5.3 in the manual.
another option that may be of interest is channelnameprefix,look it up in the manual.
for changing update=“i” to be update=“f” use your editor replace feature or simply use <update>f</update>
this overrides any channel line setting update mode.
from the manual...
With the dedicated argument alloc it is possible to change the allocation of these values. This argument accepts only
three values : site_id, xmltv_id and display_name E.g. (alloc=site_id,xmltv_id)
index site_id.scrub (multi(alloc=site_id,xmltv_id)|your_scrub_string}

Thank you very much, I'll have a look and test these solutions.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

best of luck.
in 8 years i've been using wegrab i have never used alloc so hopefully it has the reuslt you are trying to achieve.

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks

I tested your command => index site_id.scrub (multi(alloc=site_id,xmltv_id)|your_scrub_string}
but I don't understand what it puts in 'your_scrub_string'?

I tested this without success:
*index site_id.scrub {multi(alloc=site_id,xmltv_id)|regex||]*id=“[^\”]*"[^>]*>.*?||}

Could you give me an example with the contents of the CHANNEL FILE CREATION that I sent in the first message?

Thanks

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 12 hours
Sperafico wrote:

I tested your command => index site_id.scrub (multi(alloc=site_id,xmltv_id)|your_scrub_string}
but I don't understand what it puts in 'your_scrub_string'?
I tested this without success:
*index site_id.scrub {multi(alloc=site_id,xmltv_id)|regex||]*id=“[^\”]*"[^>]*>.*?||}
Could you give me an example with the contents of the CHANNEL FILE CREATION that I sent in the first message?
Thanks

This is wrong *index site_id.scrub {multi(alloc=site_id,xmltv_id)|regex||]*id=“[^\”]*"[^>]*>.*?||}
you scrubbing multi then you add regex?? should be index site_id.scrub {regex(alloc=site_id,xmltv_id)||\]*id=“[^\”]*"[^>]*>.*?||}

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks

Thank you mat8861 for your reply.
Following your recommendation, I have corrected it to :
---------------------------------------------
index site_id.scrub {regex(alloc=site_id,xmltv_id)||<channel [^>]*id="[^\"]*"[^>]*>.*?</channel>||}
---------------------------------------------
Unfortunately, this syntax seems to cause problems when generating the channel file, but without any error message. In fact, the channel file is not generated.

Have you used this 'alloc' feature in the past?

mat8861
Offline
WG++ Team memberDonator
Joined: 9 years
Last seen: 12 hours

what wg version? have you tried to debug ? xxxx.scrub(debug alloc...xxxxx) Post a string you want to scrub your regex doesn't look correct
I never used alloc

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

is the site_id value being copied to channel name also?
its most likely due to the fact you copy the channel name from the site_id then substring.
something like this should fix it..

** @auto_xml_channel_start
*index_site_id.scrub {multi(alloc=site_id,xmltv_id)|<channel|id="|"|>}
*index_site_channel.scrub {regex||<channel[^>]*>[^<]*<display-name [^>]*>(.*?)</display-name>||}
*index_site_id.modify {cleanup(removeduplicates link="index_site_channel")}
** @auto_xml_channel_end

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

tested alloc and works as expected.
first screenshot without alloc.
second is with alloc.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

also..
you said no channel file is generated,are you using V5.2?
channel creation is broken in it.
i would use the latest evaluation build V5.2.1.5
https://github.com/SilentButeo2/webgrabplus-siteinipack/tree/master/eval...

Sperafico
Offline
Donator
Joined: 4 years
Last seen: 2 weeks

Sorry for the delayed response.

I use version 5.1.4.0.

Blackbear199, I tested your solution and it works perfectly.

By the way, would it be possible to validate my commit on GitHub for the xml of the channels?
https://github.com/SilentButeo2/webgrabplus-siteinipack/pull/567/commits...

This is the result of CHANNEL FILE CREATION (except for the update="f" which I added post-processing)

Many thanks mat8861 and Blackbear199 for your support.

Blackbear199
Offline
Blackbear199's picture
WG++ Team memberDonator
Joined: 9 years
Last seen: 2 hours

looks fine to me.

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