https://github.com/animenosekai/japanterebi-xmltv
Easily create XMLTV files
https://github.com/animenosekai/japanterebi-xmltv
epg japanterebi tv xmltv
Last synced: about 1 month ago
JSON representation
Easily create XMLTV files
- Host: GitHub
- URL: https://github.com/animenosekai/japanterebi-xmltv
- Owner: Animenosekai
- License: mit
- Created: 2024-03-21T21:55:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-07T21:41:49.000Z (about 1 month ago)
- Last Synced: 2025-05-07T21:46:12.589Z (about 1 month ago)
- Topics: epg, japanterebi, tv, xmltv
- Language: Python
- Homepage: https://animenosekai.github.io/japanterebi-xmltv/guide.xml
- Size: 4.54 GB
- Stars: 37
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# japanterebi-xmltv
Easily create XMLTV files.
***Plan your watching journey!***
[](https://github.com/Animenosekai/japanterebi-xmltv/actions/workflows/update.yaml)
[](https://github.com/Animenosekai/japanterebi-xmltv/blob/master/LICENSE)
[](https://github.com/Animenosekai/japanterebi-xmltv)


## Usage
### API
You can use the [https://animenosekai.github.io/japanterebi-xmltv/guide.xml](https://animenosekai.github.io/japanterebi-xmltv/guide.xml) URL as an XMLTV source in any compatible software.
This pre-built XMLTV file contains EPG data for channels from Japan or with Japanese audio.
This file is updated every hour using [GitHub Actions](https://github.com/Animenosekai/japanterebi-xmltv/actions/workflows/update.yaml).
But you can also build your own XMLTV file using the different scripts provided in this repository.
### Pre-requisites
The different programs located in the [`scripts`](./scripts/) directory require Python 3.7 to run correctly.
The dependencies are listed in the `requirements.txt` file. You can install them by running:
```bash
python -m pip install -r requirements.txt --upgrade
```### Scripts
#### Filter
The [`filter.py`](./scripts/filter.py) script filters the different channels from the [`iptv-org/database`](https://github.com/iptv-org/database) repository.
To download the repository, you can run the following command:
```bash
git clone --depth 1 -b main https://github.com/iptv-org/database.git
```##### CLI
You can run the script with the following command:
```bash
python scripts/filter.py --input
```[`database/data/channels.csv`](https://github.com/iptv-org/database/blob/master/data/channels.csv) is the path to the channels CSV file from the [`iptv-org/database`](https://github.com/iptv-org/database) repository.
You can specify :
- `--language` to filter the channels by language
- `--country` to filter the channels by country
- `--category` to filter the channels by categoryYou can use those options multiple times to filter the channels by multiple criteria.
The different filters add up, and a union is made between the different filters.
You can also directly use the `--add` or `--remove` options to add or remove channels IDs from the list.
Here is an example output :
```json
[
{
"id": "ABEMAAnime.jp",
"name": "ABEMA Anime",
"alt_names": [
"ABEMAアニメ"
],
"network": null,
"owners": [],
"country": "JP",
"subdivision": null,
"city": "Shibuya-ku",
"broadcast_area": "c/JP",
"languages": [
"jpn"
],
"categories": [
"animation",
"kids"
],
"is_nsfw": false,
"launched": 1522540800.0,
"closed": null,
"replaced_by": null,
"website": "https://abema.tv/now-on-air/abema-anime?lang=en",
"logo": "https://i.imgur.com/OfqTpK6.png"
}
]
```Here is the command used in the workflow:
##### Python
You can also use the script as a Python module. It provides a way to convert the CSV file to a list of [`Channel`](./scripts/model.py) objects, which can easily be manipulated.
#### Fetcher
The [`fetcher.py`](./scripts/fetcher.py) gathers the different EPG sites which can be used to create the final EPG.
You need to download the [`iptv-org/epg`](https://github.com/iptv-org/epg) repository to get the different EPG sites first.
```bash
git clone --depth 1 -b master https://github.com/iptv-org/epg.git
```Then you can run the script with the following command:
```bash
python scripts/fetcher.py --input --sites epg/sites
```The [`input_path.json`](./channels.json) file should contain the list of channels you want to fetch. It should be generated by the [`filter.py`](#filter) script.
Here is the command used in the workflow:
The output is an [XML file](./japanterebi.channels.xml) which can be used with the `grab` command from the [`iptv-org/epg`](https://github.com/iptv-org/epg) repository.
```bash
npm run grab -- --channels=
```#### Fixer
Because sometimes the EPG sites return non-escaped `&` characters, the [`fix.py`](./scripts/fix.py) script fixes the XML file by correctly escaping those characters.
You can run the script with the following command:
```bash
python scripts/fix.py --input
```Here is the command used in the workflow:
#### Merger
Because the `grab` command gathers information from different EPG sites, the final EPG has multiple redundant entries.
The [`merger.py`](./scripts/merger.py) script merges the different EPG entries into a single one.
You can run the script with the following command:
```bash
python scripts/merger.py --input
```The [`input_path.xml`](./guide.xml) file should be the output of the `grab` command, or an equivalent XMLTV-formatted file.
Here is the command used in the workflow:
#### Minifier
The [`minify.py`](./scripts/minify.py) script simply minfies the XMLTV file.
You can run the script with the following command:
```bash
python scripts/minify.py --input
```> [!NOTE]
> Note that it just removes empty lines for now.Here is the command used in the workflow: