You are here

Where to Insert Icon URL in Config File

24 posts / 0 new
Last post
EPGFreak
Offline
Donator
Joined: 1 year
Last seen: 1 month
Where to Insert Icon URL in Config File

Hi,

I am looking for an example config.xml and/or .ini file that includes channel icon url links. I want to use specific channel URL image links, but I can't seem to figure out where to insert the link in the config file nor can I find a thread that shows a sample working config file that shows in the destination XML file.

Thank you for helping.

bebawy6
Offline
bebawy6's picture
Donator
Joined: 7 months
Last seen: 1 week

please any help with that as I need it too

sparklesunshine
Offline
Donator
Joined: 10 months
Last seen: 5 days

The way I do it (and there is probably a much better way as you will see why in a min) is once you have grabbed the epg data open your epg xml file

Look at the top of the xml and you will see a list of channel details
See my file in attachment as an example and add the icon src line for adding a channel logo

Now here comes the issue.
The next time you run the webgrab it will replace all the channel data in the xml file so you will need to copy and paste all the channel data with your image links you have done into a seperate file and then copy it all back replacing the updated epg channel data once you run webgrab again.

There is probably a much better way that can auto insert the images either from a seperate file or directly by telling the ini how to do it but i've no idea how

Attachments: 
kicktd
Offline
Donator
Joined: 6 months
Last seen: 4 months

The way I do it so I don't have to edit the guide each run is in my site ini I have this:

index_temp_9.modify {substring(type=regex)|'config_site_id' "Icon:([^,]*)"}
index_urlchannellogo.modify {addstart('index_temp_9' not="")|http://myserver/path/to/image/folder/'index_temp_9'}

index_temp_9 might be different for you based on how many index_temp_X are in your .ini file. This allows me to set the following in my config.xml file:

channel update="i" site="siteini" site_id="stuff_that_goes_here,Icon:My Icon.png" xmltv_id="Whatever"

So what this does is in the site ini when the channel is being processed, it will check the site_id for a regex match of Icon: and take whatever is there as the image value. Note that if you add a space after the : that will be included as part of the image file name. You can also replace the comma there with something else if the site ini file uses those as a separator, you just need to modify the regex ^, to be ^separator IE: ^| would be used if | is used as the separator in the site_id for the channel.

This allows me to quickly add new channels and channel logo images without the need of manually editing the XML every time it runs and is adaptable for most site ini files.

sparklesunshine
Offline
Donator
Joined: 10 months
Last seen: 5 days
kicktd wrote:

The way I do it so I don't have to edit the guide each run is in my site ini I have this:
index_temp_9.modify {substring(type=regex)|'config_site_id' "Icon:([^,]*)"}
index_urlchannellogo.modify {addstart('index_temp_9' not="")|http://myserver/path/to/image/folder/'index_temp_9'}
index_temp_9 might be different for you based on how many index_temp_X are in your .ini file. This allows me to set the following in my config.xml file:
channel update="i" site="siteini" site_id="stuff_that_goes_here,Icon:My Icon.png" xmltv_id="Whatever"
So what this does is in the site ini when the channel is being processed, it will check the site_id for a regex match of Icon: and take whatever is there as the image value. Note that if you add a space after the : that will be included as part of the image file name. You can also replace the comma there with something else if the site ini file uses those as a separator, you just need to modify the regex ^, to be ^separator IE: ^| would be used if | is used as the separator in the site_id for the channel.
This allows me to quickly add new channels and channel logo images without the need of manually editing the XML every time it runs and is adaptable for most site ini files.

I tested this and it works great thanks however some of my site ini files are encrypted so I can't add this code to it.
Is there a way to add the channel logo url automatically after its grabbed the epg data. I presume via rex

mat8861
Offline
WG++ Team memberDonator
Joined: 5 years
Last seen: 13 hours

just curious which siteini don't have logo ? or do you want to add your own ?

sparklesunshine
Offline
Donator
Joined: 10 months
Last seen: 5 days

tvguide.com doesn't have logos but I got that working with the siteini addition posted

tvguide.co.uk pulls channel logos automatically but if I replace the code it uses with the one posted above it no longer recognizes the site id and doesn't pull any data

This is what is in the tvguide.co.uk site.ini

index_variable_element.modify {set|'config_site_id'}
index_urlchannellogo.modify {addstart|http://my.tvguide.co.uk/channel_logos/'index_variable_element'.png}

So it pulls the logo from that web address and it pulls the image that matches the site id. Eg if site id is 127 then it pulls 127.png
However I want to change it so it's like the example posted in the post earlier so I can put my own link in. I can change the url but unless the url ends 127.png it won't work and in the case of file hosting sites it will give you a random share link so it won't work.
I've got around it by uploading the image and calling it 127.png to github as that uses a direct link with the raw address that ends 127.png so that works

The encrypted ones do automatically grab channel logos but I just wondered if you wanted to automatically add your own or change the ones that are grabbed after they are grabbed when you can't edit the site ini

kicktd
Offline
Donator
Joined: 6 months
Last seen: 4 months

Like mentioned above tvguide doesn't have them, not sure on about other siteini, I know tvtv.us has them. I also add it in to be available in fixed.ini. I use custom logos that are white or the colors are more friendly to be displayed on a darker guide background.

Sparklesunshine: I haven't tried messing with rex post-processing yet, so don't have an answer on that one yet.

bebawy6
Offline
bebawy6's picture
Donator
Joined: 7 months
Last seen: 1 week

How you did it for the fixed ini
It didn't work for me
Would you share your fixed ini file
Many thanks

kicktd
Offline
Donator
Joined: 6 months
Last seen: 4 months
bebawy6 wrote:

How you did it for the fixed ini
It didn't work for me
Would you share your fixed ini file
Many thanks

For fixed ini to maintain same format it uses:

index_temp_1.modify {substring(type=regex)|'config_site_id' "Icon:([^#]*)"}
index_urlchannellogo.modify {addstart('index_temp_1' not="")|http://server/path/to/images/'index_temp_1'}

Example channel that would be in the config, note Icon: followed by icon file name:

<channel update="f" site="fixed" site_id="00:00-23:59##title:My Show##description:This is a show##Icon:MyIcon.png####" xmltv_id="ID">My Channel</channel>

bebawy6
Offline
bebawy6's picture
Donator
Joined: 7 months
Last seen: 1 week

many thanks for the explanation. this work perfectly if you have it as one line but in my case I do it with multiple line like the following

please see picture

any suggestion..

many thanks

Attachments: 
kicktd
Offline
Donator
Joined: 6 months
Last seen: 4 months
bebawy6 wrote:

many thanks for the explanation. this work perfectly if you have it as one line but in my case I do it with multiple line like the following
please see picture
any suggestion..
many thanks

Should be 2 #'s before Icon: ##Icon:cyc.png####

Even though the Icon addition only looks for Icon: and then uses everything after Icon: until it detects a #, the other parsing for description etc. that comes with the fixed ini looks for double ## for splitting each section.

bebawy6
Offline
bebawy6's picture
Donator
Joined: 7 months
Last seen: 1 week

many thanks

this works like magic, many thanks again for your time and prompt responses.

for after the fact edit of the guid.xml file .. I use Git software with Shell scripts

so you create a txt file with the following and when save it replace extension to .sh

#!/bin/sh
cd /c/data/EPG "guide path location"
sed -i '819a ' guid.xml
sed -i '816s ' guid.xml

if you notice the

819a is the line number I want to insert the icon after

816s is the line number I want to replace. like an icon link and I want to to replace it with mine

to identify the line number I use Notepad++

another trick that I start from the line number from bottom( 819 the 816) as when you add number the the line number sequence get shifted so start from the bottom will not affect the sequence you want to edit.

and you can run the shell from windows task after your Wbgraber completed.

thanks

Attachments: 
WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 8 years
Last seen: 14 hours
Is the support helpful?
support us

Hi all channel logo seekers !!

a very interesting conversation with some amazing suggestion for a solution!!

For some time already I was working on a more general addition WG++ ... a plugin that can be used in the POSTPROCESSOR
It is intended as a general purpose addition. It allows to run a 'plugin' , that must be an executable utility/app/program , that the user can run as part of the POSTPROCESSOR

Example, interesting for you guys, to add or change the channel logos. Let me explain how that will work :
Suppose there is a small program 'add_logos.exe' . It reads a file (e.g. my_logos.ini) with all the channel logos you want in your xmltv and does just that!!

In your config file you specify it , see config.xml

The content of 'my_logos.ini' looks like this (xmltv_id, logo value):

TV Câmara , https://www.net.com.br/imagens/logo/tv_camara-1680_95x39.png
TV Brasil , https://www.net.com.br/imagens/logo/tv_brasil-1683_95x39.png
PREMIERE HD 3 ³ , https://www.net.com.br/imagens/logo/premiere_hd_3_-1175_95x39.png

Suppose the channel section of your guide.xml is, see attached guide.xml

Notice this :
'TV Câmara' the logo in my_logos is different from that in guide.xml
'TV Brasil', has no logo in the guide.xml
'Premiere HD 2' has no value in my_logos.ini
'PREMIERE HD 3 ³' has the same value in guide.xml and my_logos.ini

The result after it ran, see guidelogos.xml..

I have a reasonable working version of this 'add_logos.exe' and I also implemented the 'plugin' option of the POSTPROCESSOR.

I expect to release them in the coming days ...

pls let me know if you have any extra suggestions

Jan

kicktd
Offline
Donator
Joined: 6 months
Last seen: 4 months

That sounds great. Will make maintaining the channel icons and adding new ones a lot easier, really excited to see this addition and thanks for all the hard work!

sparklesunshine
Offline
Donator
Joined: 10 months
Last seen: 5 days

I've found another way to replace a channel logo after grabbing

I have uploaded my example script and instructions - unzip the attachement

Basically it is a script that will replace the logo line in your xml with what you tell it to replace it with.

It is different from the example posted above because instead of telling it what line number to replace you tell it exactly what text to replace. This eliminates the possibility of line numbers changing each grab.

So every time you run WebGrab+Plus it should replace your change with the original url of the logo from what it grabs into your xml. Running the script will replace that again with what ever you want to replace it with assuming the orig url hasn't changed

bebawy6
Offline
bebawy6's picture
Donator
Joined: 7 months
Last seen: 1 week
WGMaker wrote:

Hi all channel logo seekers !!
a very interesting conversation with some amazing suggestion for a solution!!
For some time already I was working on a more general addition WG++ ... a plugin that can be used in the POSTPROCESSOR
It is intended as a general purpose addition. It allows to run a 'plugin' , that must be an executable utility/app/program , that the user can run as part of the POSTPROCESSOR
Example, interesting for you guys, to add or change the channel logos. Let me explain how that will work :
Suppose there is a small program 'add_logos.exe' . It reads a file (e.g. my_logos.ini) with all the channel logos you want in your xmltv and does just that!!
In your config file you specify it , see config.xml
The content of 'my_logos.ini' looks like this (xmltv_id, logo value):
TV Câmara , https://www.net.com.br/imagens/logo/tv_camara-1680_95x39.png
TV Brasil , https://www.net.com.br/imagens/logo/tv_brasil-1683_95x39.png
PREMIERE HD 3 ³ , https://www.net.com.br/imagens/logo/premiere_hd_3_-1175_95x39.png
Suppose the channel section of your guide.xml is, see attached guide.xml
Notice this :
'TV Câmara' the logo in my_logos is different from that in guide.xml
'TV Brasil', has no logo in the guide.xml
'Premiere HD 2' has no value in my_logos.ini
'PREMIERE HD 3 ³' has the same value in guide.xml and my_logos.ini
The result after it ran, see guidelogos.xml..
I have a reasonable working version of this 'add_logos.exe' and I also implemented the 'plugin' option of the POSTPROCESSOR.
I expect to release them in the coming days ...
pls let me know if you have any extra suggestions
Jan

Hello WGMaker

many thanks for releasing the add_logo.exe

I just extract the add_logo.exe folder within the same location. has my logo ini file in my siteini.pack folder and run it

but nothing happen it did not create the out put xml file

what I am missing?

WebGrab+Plus/w MDB & REX Postprocess -- version V3.1.3.3

[ Info ] Job (add_logo.exe /in=arEPG.v1.xml /out=logos.arEPG.v1.xml /logos=my_logos.ini) started at 10/11/2020 21:36:00
[ Info ] Job (add_logo.exe /in=arEPG.v1.xml /out=logos.arEPG.v1.xml /logos=my_logos.ini) finished at 10/11/2020 21:36:00 done in 0s

then I start moving add_logo.exe and my_logo ini everywhere {same directory like XML file , main directory for Webgraber etc} still the same issue.

please advise

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 8 years
Last seen: 14 hours
Is the support helpful?
support us

Hi, it is a bit difficult to figure out what goes wrong with just the .jpg screen copies. Please send me the following files to webgrabpp@gmail.com :
* my_logos.ini
* arEPGv1.xml (or just the channel part)
* the webgrab++.log.txt (of the run that failed)
* the config file

From the jpg's it is not fully clear what the locations of the files is.
The easiest way is to have everything in the same folder as the webgrab++.config as that is the default path for add_logo
* add_logo.exe + arEPG.v1.xml + my_logos.ini
If you decide for another location, you must include the full path for each of them e.g.
I assuming your /in file is on that default location,
/in=arEPG.v1.xml /out=logos.arEPG.v1.xml /logos=..\appdata\local\webgrab+plus\siteini.pack\my_logos.ini

What I wonder is, if some of the files are not found by add_logo, there must be some warning/error in the log file?

We will fix this ... Jan

davidenci0
Offline
Donator
Joined: 3 months
Last seen: 3 months

Hello! I am having same issue and after following your steps I'm still in the same situation. Any solution?

Thank you in advance :)

sparklesunshine
Offline
Donator
Joined: 10 months
Last seen: 5 days
davidenci0 wrote:

Hello! I am having same issue and after following your steps I'm still in the same situation. Any solution?
Thank you in advance :)

I've written a simple guide to most of the basic WebGrabPlus functions

Goto https://webgrabplusguide.github.io

Read from the part "Channel Logos"
The first part you can add/change a line in the siteini so it adds the channel logo which points to a file on for example github that matches the name of site_id

Second part is "Change channel logos on encrypted siteinis or post grab" for if the siteini grabs a logo but you want to change it automatically via a script without editing the siteini

The third part is "Add channel logo line via script post grab" if the siteini doesn't pull a logo line at all & you don't want to edit the siteini

davidenci0
Offline
Donator
Joined: 3 months
Last seen: 3 months

Thankyou very much, sparklesunshine!
I am terrible noob, so it is being difficult for me.

I was expecting a solution for the add_logo plugin that has been added recently.

I am not sure about my abilities running scripts yet, so I hope @wgmaker or @bebawy6 have an answer from their previous discussion.

Blackbear199
Offline
WG++ Team memberDonator
Joined: 5 years
Last seen: 1 week

upload webgrab log

mat8861
Offline
WG++ Team memberDonator
Joined: 5 years
Last seen: 13 hours

Yes, sure!

I am uploading the files

EDITED NO CONFIG WITH LICENSE INFO !!

Blackbear199
Offline
WG++ Team memberDonator
Joined: 5 years
Last seen: 1 week

[ ] WebGrab+Plus/w MDB & REX Postprocess -- version V3.1.0.0

http://webgrabplus.com/content/introducing-postprocess-plugin

add logo wasnt added until webgrab 3.1.4 beta
upgrade to 3.1.5

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