diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml
index ef1756e9..9d856961 100644
--- a/.github/workflows/auto-update.yml
+++ b/.github/workflows/auto-update.yml
@@ -13,6 +13,7 @@ jobs:
site:
[
andorradifusio.ad,
+ arianaafgtv.com,
arianatelevision.com,
astro.com.my,
comteco.com.bo,
diff --git a/README.md b/README.md
index f3c51a24..9e214624 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,8 @@ To load a program guide, all you need to do is copy the link to one of the guide
Country | EPG |
- 🇦🇫 Afghanistan | https://iptv-org.github.io/epg/guides/arianatelevision.com.guide.xml |
+ 🇦🇫 Afghanistan | https://iptv-org.github.io/epg/guides/arianaafgtv.com.guide.xml |
+ https://iptv-org.github.io/epg/guides/arianatelevision.com.guide.xml |
🇩🇿 Algeria | https://iptv-org.github.io/epg/guides/elcinema.com.guide.xml |
🇦🇱 Albania | https://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml |
🇦🇩 Andorra | https://iptv-org.github.io/epg/guides/andorradifusio.ad.guide.xml |
diff --git a/sites/arianaafgtv.com.channels.xml b/sites/arianaafgtv.com.channels.xml
new file mode 100755
index 00000000..f9d910d0
--- /dev/null
+++ b/sites/arianaafgtv.com.channels.xml
@@ -0,0 +1,6 @@
+
+
+
+ Ariana Afghanistan International TV
+
+
\ No newline at end of file
diff --git a/sites/arianaafgtv.com.config.js b/sites/arianaafgtv.com.config.js
new file mode 100644
index 00000000..97079f11
--- /dev/null
+++ b/sites/arianaafgtv.com.config.js
@@ -0,0 +1,87 @@
+const cheerio = require('cheerio')
+const dayjs = require('dayjs')
+const utc = require('dayjs/plugin/utc')
+const timezone = require('dayjs/plugin/timezone')
+const customParseFormat = require('dayjs/plugin/customParseFormat')
+
+dayjs.extend(utc)
+dayjs.extend(timezone)
+dayjs.extend(customParseFormat)
+
+module.exports = {
+ lang: 'en',
+ days: 7,
+ site: 'arianaafgtv.com',
+ channels: 'arianaafgtv.com.channels.xml',
+ output: '.gh-pages/guides/arianaafgtv.com.guide.xml',
+ url() {
+ return `https://www.arianaafgtv.com/index.html`
+ },
+ parser({ content, date }) {
+ const programs = []
+ const items = parseItems(content, date)
+ items.forEach(item => {
+ const title = item.title
+ const start = parseStart(item, date)
+ const stop = parseStop(item, date)
+ programs.push({
+ title,
+ start,
+ stop
+ })
+ })
+
+ return programs
+ }
+}
+
+function parseStop(item, date) {
+ const time = `${date.format('MM/DD/YYYY')} ${item.end.toUpperCase()}`
+
+ return dayjs.tz(time, 'MM/DD/YYYY hh:mm A', 'Asia/Kabul')
+}
+
+function parseStart(item, date) {
+ const time = `${date.format('MM/DD/YYYY')} ${item.start.toUpperCase()}`
+
+ return dayjs.tz(time, 'MM/DD/YYYY hh:mm A', 'Asia/Kabul')
+}
+
+function parseItems(content, date) {
+ const $ = cheerio.load(content)
+ const dayOfWeek = date.format('dddd')
+ const column = $('.H4')
+ .filter((i, el) => {
+ return $(el).text() === dayOfWeek
+ })
+ .first()
+ .parent()
+
+ const rows = column
+ .find('.Paragraph')
+ .map((i, el) => {
+ return $(el).html()
+ })
+ .toArray()
+ .map(r => (r === ' ' ? '|' : r))
+ .join(' ')
+ .split('|')
+
+ const items = []
+ rows.forEach(row => {
+ row = row.trim()
+ if (row) {
+ const found = row.match(/(\d+(|:\d+)(a|p)m-\d+(|:\d+)(a|p)m)/gi)
+ if (!found) return
+ const time = found[0]
+ let start = time.match(/(\d+(|:\d+)(a|p)m)-/i)[1]
+ start = dayjs(start.toUpperCase(), ['hh:mmA', 'h:mmA', 'hA']).format('hh:mm A')
+ let end = time.match(/-(\d+(|:\d+)(a|p)m)/i)[1]
+ end = dayjs(end.toUpperCase(), ['hh:mmA', 'h:mmA', 'hA']).format('hh:mm A')
+ const title = row.replace(time, '').replace(' ', '').trim()
+ items.push({ start, end, title })
+ }
+ })
+
+ return items
+}