Skip to content

Commit 5ebdeba

Browse files
author
Thiago Crepaldi
committed
Improve readme file for add_logo plugin
1 parent 2bf170e commit 5ebdeba

File tree

3 files changed

+82
-62
lines changed

3 files changed

+82
-62
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Add logo post process
2+
3+
Add or change channel logos in xmltv files
4+
5+
Content of the logos file
6+
-------------------------
7+
8+
The syntax for the logo ini file is `channel name, logo link`. Each channel on its own line
9+
10+
- The `channel name` must be the same as the `channel_id` value in the channel section of the input file
11+
- Lines starting with `*` are considered a comment text
12+
13+
**Example logos file content:**
14+
15+
```xml
16+
TV Camara , https://www.net.com.br/imagens/logo/tv_camara-1680_95x39.png
17+
TV Brasil , https://www.net.com.br/imagens/logo/tv_brasil-1683_95x39.png
18+
PREMIERE HD 3 , https://www.net.com.br/imagens/logo/premiere_hd_3_-1175_95x39.png
19+
```
20+
21+
## .NET version (add_logo.exe)
22+
23+
Version 1.0.0 Jan van Straaten , November 2020
24+
25+
How to use
26+
----------
27+
28+
**Specify the following command line arguments following the syntax `/name=value` or `/name:value`:**
29+
30+
- `/in=xmltv`: input file name. E.g. /in=guide.xml
31+
- `/out=xmltv`: output file name. This is an optional and default value is 'guide_logos.xml'.
32+
Cannot be the same as `/in`. E.g. /out=epg_logos.xml
33+
- `/logos=name`: Name of the file with the new logos. E.g. /logos=my_logos.ini
34+
- `/h` or `/?`: Print this help. Optional and takes no argument
35+
36+
**Example of a valid command line:**
37+
38+
```cmd
39+
add_logo.exe /in=guide.xml /out=epg_logos.xml /logos=logos.ini
40+
```
41+
42+
**Example as webgrab+plus postprocess plugin:**
43+
44+
```xml
45+
<postprocess run=\"y\" grab=\"n\">add_logo.exe /in=guide+2.xml /logos=logos.txt</postprocess>
46+
```
47+
48+
# Python version (add_logo.py)
49+
50+
Version 1.0.0 Thiago Crepaldi, December 2023
51+
52+
The python version internally works the ame way as the .NET version. The only difference is how the script is invoked by the user.
53+
54+
## Requirements
55+
56+
* Python 3
57+
58+
How to use
59+
----------
60+
61+
*add_logo.py [-h] --xmltv_in XMLTV_IN --logos LOGOS [--xmltv_out XMLTV_OUT] [--version VERSION] [--usage]*
62+
63+
Options
64+
-------
65+
- `-h` or `--help`: Show this help message and exit
66+
- `--xmltv_in XMLTV_IN`: Path to XMLTV Guide file
67+
- `--logos LOGOS`: Path to Logos file
68+
- `--xmltv_out XMLTV_OUT`: Path to updated XMLTV Guide file that will be created
69+
- `--version VERSION`: Set script version
70+
71+
**Example of a valid command line:**
72+
73+
```sh
74+
/usr/bin/python3 add_logo.py --xmltv_in=guide.xml --logos=my_logos.ini --xmltv_out guide_with_logo.xml
75+
```
76+
77+
**Example as webgrab+plus postprocess plugin:**
78+
79+
```xml
80+
<postprocess run=\"y\" grab=\"n\">python3 add_logo.py --xmltv_in=guide.xml --logos=my_logos.ini --xmltv_out guide_with_logo.xml</postprocess>
81+
```

postprocess_plugins/add-logo/add_logo.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ def main():
1919
parser.add_argument(
2020
"--version", help="Set script version", required=False, default="0.1"
2121
)
22-
parser.add_argument(
23-
"--usage", help="Example usage", required=False, action="store_true"
24-
)
22+
2523
args = parser.parse_args()
2624

2725
# Check if the user has provided valid arguments
@@ -98,29 +96,6 @@ def main():
9896

9997

10098
def check_usage(args):
101-
if args.usage:
102-
message = """Example usage:
103-
** Example of a valid command line:
104-
python add_logo --xmltv_in guide.xml --xmltv_out epg_logos.xml --logos logos.ini
105-
- as webgrab+plus postprocess plugin:
106-
<postprocess run="y" grab="n">python add_logo --xmltv_in guide+2.xml --logos logos.txt</postprocess>
107-
108-
** Content of the logos file:
109-
110-
- syntax ... channel name, logo link
111-
112-
- channel name must be the same as the channel_id value in the channel section of the input file
113-
- lines starting with * are considered a comment text
114-
115-
** Example logos file content:
116-
117-
* list of channel logo links
118-
*
119-
TV Camara , https://www.net.com.br/imagens/logo/tv_camara-1680_95x39.png
120-
TV Brasil , https://www.net.com.br/imagens/logo/tv_brasil-1683_95x39.png
121-
PREMIERE HD 3 , https://www.net.com.br/imagens/logo/premiere_hd_3_-1175_95x39.png
122-
----------------------------------------------------------------------------------------------
123-
"""
12499
fail = False
125100
if not args.xmltv_in or not os.path.exists(args.xmltv_in):
126101
message = "invalid --xmltv_in argument, try -h for help"

postprocess_plugins/add-logo/help.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)