+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sites/tv.boxbg.net/__data__/no_content.html b/sites/tv.boxbg.net/__data__/no_content.html
new file mode 100644
index 00000000..76870a48
--- /dev/null
+++ b/sites/tv.boxbg.net/__data__/no_content.html
@@ -0,0 +1,485 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
БНТ1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sites/tv.boxbg.net/readme.md b/sites/tv.boxbg.net/readme.md
new file mode 100644
index 00000000..6b3f7468
--- /dev/null
+++ b/sites/tv.boxbg.net/readme.md
@@ -0,0 +1,21 @@
+# tv.boxbg.net
+
+https://tv.boxbg.net
+
+### Download the guide
+
+```sh
+npm run grab --- --site=tv.boxbg.net
+```
+
+### Update channel list
+
+```sh
+npm run channels:parse --- --config=./sites/tv.boxbg.net/tv.boxbg.net.config.js --output=./sites/tv.boxbg.net/tv.boxbg.net.channels.xml
+```
+
+### Test
+
+```sh
+npm test --- tv.boxbg.net
+```
diff --git a/sites/tv.boxbg.net/tv.boxbg.net.channels.xml b/sites/tv.boxbg.net/tv.boxbg.net.channels.xml
new file mode 100644
index 00000000..03c7e347
--- /dev/null
+++ b/sites/tv.boxbg.net/tv.boxbg.net.channels.xml
@@ -0,0 +1,86 @@
+
+
+ 24kitchen
+ AMC
+ Animal Planet
+ AXN Black
+ AXN White
+ AXN
+ Balkanika MTV
+ Bloomberg TV Bulgaria
+ bTV Action
+ bTV Cinema
+ bTV Comedy
+ bTV Story
+ bTV
+ Cartoon Network
+ Cinemania
+ Cinemax 2
+ Cinemax
+ Comedy Central
+ Crime and Investigation
+ Da Vinci Learning
+ Diema Sport 2 HD
+ Diema Sport 3
+ Diema Sport HD
+ Discovery Channel
+ Disney Channel
+ Disney Junior
+ EKids
+ Epic Drama
+ Eurosport 2
+ Eurosport
+ Extreme Sports Channel
+ FilmBox Extra HD
+ FilmBox Stars
+ FilmBox
+ Food Network HD
+ HBO 3
+ HBO Comedy
+ HBO
+ HG TV
+ History
+ Investigation Discovery
+ JimJam
+ KinoNova
+ MAX Sport 1
+ MAX Sport 2
+ MAX Sport 3
+ MAX Sport 4
+ MovieSTAR
+ Nat Geo Wild
+ National Geographic Channel
+ Nick Jr.
+ Nickelodeon
+ NOVANEWS
+ PickboxTV
+ RING.BG
+ StarChannel
+ StarCrime
+ StarLife
+ The Voice
+ TLC Balkans
+ Travel Channel
+ TV1
+ Viasat Explorer
+ Viasat History
+ Viasat Nature
+ Viasat TV 1000
+ Vivacom Arena
+ Алфа
+ БНТ1
+ БНТ2
+ БНТ HD
+ БНТ Свят
+ България он еър
+ Диема Фемили
+ Диема
+ Евроком НКТВ
+ Нова Спорт
+ Нова телевизия
+ Планета HD
+ Планета Фолк
+ Планета
+ Фен ТВ
+ Хоби ТВ
+
diff --git a/sites/tv.boxbg.net/tv.boxbg.net.config.js b/sites/tv.boxbg.net/tv.boxbg.net.config.js
new file mode 100644
index 00000000..4d540118
--- /dev/null
+++ b/sites/tv.boxbg.net/tv.boxbg.net.config.js
@@ -0,0 +1,86 @@
+const axios = require('axios')
+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 = {
+ site: 'tv.boxbg.net',
+ url({ channel, date }) {
+ return `https://tv.boxbg.net/channel/${channel.site_id}?day=${date.format('DDMMYYYY')}`
+ },
+ parser({ content }) {
+ let programs = []
+ const items = parseItems(content)
+
+ items.forEach(item => {
+ programs.push({
+ title: parseTitle(item),
+ categories: parseCategories(item),
+ start: parseStart(item),
+ stop: parseStop(item)
+ })
+ })
+
+ return programs
+ },
+ async channels() {
+ const content = await axios
+ .get('https://tv.boxbg.net/')
+ .then(r => r.data)
+ .catch(console.error)
+ const $ = cheerio.load(content)
+
+ let channels = []
+ $('channel-cell').each((i, el) => {
+ const data = $(el).attr(':channel')
+ const channel = JSON.parse(data)
+
+ channels.push({
+ site_id: [channel.name, channel.id].join('/'),
+ name: channel.name,
+ lang: 'bg'
+ })
+ })
+
+ return channels
+ }
+}
+
+function parseTitle(item) {
+ return item.text
+}
+
+function parseCategories(item) {
+ return item.categories ? item.categories.split(',') : []
+}
+
+function parseStart(item) {
+ return dayjs.tz(item.start_at, 'YYYY-MM-DD HH:mm', 'Europe/Sofia')
+}
+
+function parseStop(item) {
+ return dayjs.tz(item.end_at, 'YYYY-MM-DD HH:mm', 'Europe/Sofia')
+}
+
+function parseItems(content) {
+ const $ = cheerio.load(content)
+
+ let items = []
+ $('.list-events > a').each((i, el) => {
+ const onclick = $(el).attr('@click.prevent')
+ const [, eventLink] = onclick.match(/eventLink\(\$event,(.*)\)/) || [null, null]
+
+ if (eventLink) {
+ const data = JSON.parse(eventLink)
+ items.push(data)
+ }
+ })
+
+ return items
+}
diff --git a/sites/tv.boxbg.net/tv.boxbg.net.test.js b/sites/tv.boxbg.net/tv.boxbg.net.test.js
new file mode 100644
index 00000000..401a15c5
--- /dev/null
+++ b/sites/tv.boxbg.net/tv.boxbg.net.test.js
@@ -0,0 +1,48 @@
+const { parser, url } = require('./tv.boxbg.net.config.js')
+const fs = require('fs')
+const path = require('path')
+const dayjs = require('dayjs')
+const utc = require('dayjs/plugin/utc')
+const customParseFormat = require('dayjs/plugin/customParseFormat')
+dayjs.extend(customParseFormat)
+dayjs.extend(utc)
+
+const date = dayjs.utc('2025-08-13', 'YYYY-MM-DD').startOf('d')
+const channel = { site_id: 'БНТ1/29' }
+
+it('can generate valid url', () => {
+ expect(url({ channel, date })).toBe('https://tv.boxbg.net/channel/БНТ1/29?day=13082025')
+})
+
+it('can parse response', () => {
+ const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'))
+
+ let results = parser({ content })
+ results = results.map(p => {
+ p.start = p.start.toJSON()
+ p.stop = p.stop.toJSON()
+
+ return p
+ })
+
+ expect(results.length).toBe(37)
+ expect(results[0]).toMatchObject({
+ title: '65 в ефир - /п/',
+ categories: [],
+ start: '2025-08-12T21:25:00.000Z',
+ stop: '2025-08-12T21:55:00.000Z'
+ })
+ expect(results[36]).toMatchObject({
+ title: 'Шетланд 3 - тв филм /5 епизод/ (14)',
+ categories: ['Сериал'],
+ start: '2025-08-13T20:25:00.000Z',
+ stop: '2025-08-13T21:25:00.000Z'
+ })
+})
+
+it('can handle empty guide', () => {
+ const content = fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'))
+ const results = parser({ content })
+
+ expect(results).toMatchObject([])
+})