Giter VIP home page Giter VIP logo

japanterebi-xmltv's Introduction

japanterebi-xmltv

Sakayanagi

Easily create XMLTV files.

Plan your watching journey!



EPG Update GitHub — License GitHub top language Code Size Repo Size Issues

Usage

API

You can use the 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.

run: python scripts/filter.py --input database/data/channels.csv --language="jpn" --country="JP" --minify channels.json

This file is updated every hour using GitHub Actions.

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 directory require Python 3.7 to run correctly.

The dependencies are listed in the requirements.txt file. You can install them by running:

python -m pip install -r requirements.txt --upgrade

Scripts

Filter

The filter.py script filters the different channels from the iptv-org/database repository.

To download the repository, you can run the following command:

git clone --depth 1 -b main https://github.com/iptv-org/database.git
CLI

You can run the script with the following command:

python scripts/filter.py --input <database/data/channels.csv> <output_path.json>

database/data/channels.csv is the path to the channels CSV file from the 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 category

You 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 :

[
    {
        "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:

- name: Getting the channels ID
run: python scripts/filter.py --input database/data/channels.csv --language="jpn" --country="JP" --minify channels.json

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 objects, which can easily be manipulated.

Fetcher

The fetcher.py gathers the different EPG sites which can be used to create the final EPG.

You need to download the iptv-org/epg repository to get the different EPG sites first.

git clone --depth 1 -b master https://github.com/iptv-org/epg.git

Then you can run the script with the following command:

python scripts/fetcher.py --input <input_path.json> --sites epg/sites <output_path.xml>

The input_path.json file should contain the list of channels you want to fetch. It should be generated by the filter.py script.

Here is the command used in the workflow:

- name: Filtering the channels
run: python scripts/fetcher.py --input channels.json --sites epg/sites japanterebi.channels.xml

The output is an XML file which can be used with the grab command from the iptv-org/epg repository.

npm run grab -- --channels=<output_path.xml>

Merger

Because the grab command gathers information from different EPG sites, the final EPG has multiple redundant entries.

The merger.py script merges the different EPG entries into a single one.

You can run the script with the following command:

python scripts/merger.py --input <input_path.xml> <output_path.xml>

The input_path.xml file should be the output of the grab command, or an equivalent XMLTV-formatted file.

Here is the command used in the workflow:

- name: Merging redundant programs
run: python scripts/merger.py --input guide.xml guide.xml

Minifier

The minify.py script simply minfies the XMLTV file.

You can run the script with the following command:

python scripts/minify.py --input <input_path.xml> <output_path.xml>

Note

Note that it just removes empty lines for now.

Here is the command used in the workflow:

- name: Minify XML
run: python scripts/minify.py --input guide.xml guide.xml

japanterebi-xmltv's People

Contributors

animenosekai avatar

Stargazers

watora avatar Alex avatar  avatar  avatar Zern avatar

Watchers

 avatar

Forkers

nicet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.