diff --git a/scripts/update-readme.js b/scripts/update-readme.js
new file mode 100644
index 00000000..9ccd63b5
--- /dev/null
+++ b/scripts/update-readme.js
@@ -0,0 +1,78 @@
+const markdownInclude = require('markdown-include')
+const path = require('path')
+const fs = require('fs')
+const countries = require('./countries.json')
+const file = require('./file.js')
+
+async function main() {
+ console.log('Starting...')
+ file
+ .list(['ad'], [])
+ .then(files => {
+ files = files.map(str => str.match(/channels\/(.*).xml/i)[1])
+ generateTable(files)
+ generateReadme()
+ })
+ .finally(() => {
+ console.log('Finish')
+ })
+}
+
+function generateTable(files) {
+ console.log('Generating countries table...')
+
+ const output = []
+ for (const country of countries) {
+ if (files.includes(country.code)) {
+ output.push({
+ country: `${country.flag} ${country.name}`,
+ guide: `https://iptv-org.github.io/epg/guides/${country.code}.epg.xml
`
+ })
+ }
+ }
+
+ const table = generateHtmlTable(output, {
+ columns: [
+ { name: 'Country', align: 'left', nowrap: true },
+ { name: 'EPG', align: 'left', nowrap: true }
+ ]
+ })
+
+ fs.writeFileSync(path.resolve('./.readme/_countries.md'), table)
+}
+
+function generateHtmlTable(data, options) {
+ let output = '
${column.name} | ` + } + output += '
---|
${item[prop]} | ` + i++ + } + output += '