From f85f5986929646483bce68fc864bd06ff373cda9 Mon Sep 17 00:00:00 2001 From: freearhey Date: Tue, 20 Apr 2021 17:54:45 +0300 Subject: [PATCH] Added guide from albepg.com --- .github/workflows/auto-update.yml | 15 ++++ README.md | 1 + package-lock.json | 17 ++++ package.json | 1 + sites/albepg.com.channels.xml | 124 ++++++++++++++++++++++++++++++ sites/albepg.com.config.js | 51 ++++++++++++ 6 files changed, 209 insertions(+) create mode 100755 sites/albepg.com.channels.xml create mode 100644 sites/albepg.com.config.js diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index df9adee9..25a22299 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,6 +4,21 @@ on: schedule: - cron: '0 0 * * *' jobs: + albepg_com: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + - name: Install Dependencies + run: npm install + - name: Run EPG Grabber + run: npx epg-grabber --config=sites/albepg.com.config.js + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.1 + with: + branch: gh-pages + folder: .gh-pages + clean: false tvtv_ca: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index 4c42c993..a3cc21ca 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ To load a program guide, all you need to do is copy the link to one of the guide CountryEPG + 🇦🇱 Albaniahttps://iptv-org.github.io/epg/guides/albepg.com.guide.xml 🇦🇷 Argentinahttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇦🇺 Australiahttps://iptv-org.github.io/epg/guides/ontvtonight.com.guide.xml 🇧🇾 Belarushttps://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml diff --git a/package-lock.json b/package-lock.json index ffd67491..6e5c56b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "dependencies": { "dayjs": "^1.10.4", "epg-grabber": "^0.6.5", + "epg-parser": "^0.1.3", "glob": "^7.1.6", "html-to-text": "^7.0.0", "iconv-lite": "^0.4.24", @@ -385,6 +386,14 @@ "node": ">=10.0.0" } }, + "node_modules/epg-parser": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/epg-parser/-/epg-parser-0.1.3.tgz", + "integrity": "sha512-+PUYT8UAA598nD4AKleojSeb1QqpFJ6rdcMCrjc0tddkQ3Q7qRYfBMbl1mXj/YWRpoLCjE5RT9u8MsMI15H2xA==", + "dependencies": { + "xml-js": "^1.6.11" + } + }, "node_modules/escodegen": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", @@ -1568,6 +1577,14 @@ "xml-js": "^1.6.11" } }, + "epg-parser": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/epg-parser/-/epg-parser-0.1.3.tgz", + "integrity": "sha512-+PUYT8UAA598nD4AKleojSeb1QqpFJ6rdcMCrjc0tddkQ3Q7qRYfBMbl1mXj/YWRpoLCjE5RT9u8MsMI15H2xA==", + "requires": { + "xml-js": "^1.6.11" + } + }, "escodegen": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", diff --git a/package.json b/package.json index f586b5f2..cbd4cb3f 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "dayjs": "^1.10.4", "epg-grabber": "^0.6.5", + "epg-parser": "^0.1.3", "glob": "^7.1.6", "html-to-text": "^7.0.0", "iconv-lite": "^0.4.24", diff --git a/sites/albepg.com.channels.xml b/sites/albepg.com.channels.xml new file mode 100755 index 00000000..31e11054 --- /dev/null +++ b/sites/albepg.com.channels.xml @@ -0,0 +1,124 @@ + + + + 21 Junior + 21 Popullore + 24 Kitchen Srbija + 3 Plus + ABC News + AlbUK TV + Alsat + Animal Planet Europe + Arena Sport 1 + Arena Sport 2 + Arena Sport 3 + Arena Sport 4 + Arta + BBF Music TV + BabyTV Europe + Balkanika TV + Bang Bang + Boomerang EMEA + Click TV + Discovery Channel Bulgaria + Elrodi TV + Euronews Albania + Eurosport 1 + Explorer Histori + Explorer Natyra + Explorer Shkencë + Family HD + FashionTV Europe + Film Aksion + Film Drame + Film Dy HD + Film Hits + Film Hits +1 + Film Komedi + Film Një HD + Film Thriller + Folk+ + Fox Life Regional + Fox Srbija + In TV + Investigation Discovery Europe + Junior TV + Kanal 10 + Kanal D Drama + Kanali 7 + Klan Kosova + Klan Macedonia + Klan Plus + Kohavision + Living HD + MFM + MTV Live HD + Muse + My Music + National Geographic Channel HD Europe + Nesër TV + News 24 + On-TV + Ora News + Peace TV English + RTSH 1 + RTSH 2 + RTSH 3 + RTSH Agro + RTSH Femije + RTSH Film + RTSH Korca + RTSH Muzike + RTSH Plus + RTSH Shkolle + RTSH Shqip + RTSH Sport + RTV21 + STV Folk + Stinët + Super Sonic TV + SuperSport 1 + SuperSport 2 + SuperSport 3 + SuperSport 4 + SuperSport 5 + SuperSport 6 + SuperSport Kosova 1 + SuperSport Kosova 2 + SuperSport Kosova 3 + T7 + TV 21 Macedonia + TV Klan + TV Koha + TV Shenja + TV Tetova + TVM2 + Telesport + Tip TV + Top Channel + Top News + Tribuna Channel + Tring Action + Tring Comedy + Tring Family + Tring Fantasy + Tring History + Tring International + Tring Jolly + Tring Kids + Tring Life + Tring Planet + Tring Shqip + Tring Smile + Tring Sport 1 + Tring Sport 2 + Tring Sport 3 + Tring Sport 4 + Tring Sport News + Tring Super + Tring Tring + Tring World + Vizion Plus + Çufo + + \ No newline at end of file diff --git a/sites/albepg.com.config.js b/sites/albepg.com.config.js new file mode 100644 index 00000000..e1191460 --- /dev/null +++ b/sites/albepg.com.config.js @@ -0,0 +1,51 @@ +const epgParser = require('epg-parser') +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const customParseFormat = require('dayjs/plugin/customParseFormat') + +dayjs.extend(utc) +dayjs.extend(customParseFormat) + +module.exports = { + lang: 'sq', + site: 'albepg.com', + channels: 'albepg.com.channels.xml', + output: '.gh-pages/guides/albepg.com.guide.xml', + request: { + timeout: 15000, + headers: { + Referer: 'http://albepg.com/epg.html' + } + }, + url: function () { + return `http://albepg.com/epg/guide.xml` + }, + logo: function ({ channel }) { + return `http://albepg.com/tvlogi/${encodeURI(channel.site_id)}.png` + }, + parser: function ({ content, channel, date }) { + const results = epgParser.parse(content) + let programs = [] + results.programs + .filter(item => item.channel === channel.site_id) + .forEach(item => { + if (item.title.length && item.start && item.stop) { + const description = item.desc.length ? item.desc[0].value : null + const category = item.category.length ? item.category[0].value : null + const start = dayjs.utc(item.start, 'YYYYMMDDHHmmss Z') + const stop = dayjs.utc(item.stop, 'YYYYMMDDHHmmss Z') + if (start.diff(date.format('YYYY-MM-DD'), 'd') === 0) { + programs.push({ + title: item.title[0].value, + description, + category, + start: start.toString(), + stop: stop.toString() + }) + } + } + }) + + return programs + } +}