Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 2025.01.7 #2653

Merged
merged 26 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .husky/check_channels.sh → .husky/channels_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
channels_changed="$(git diff --staged --name-only --diff-filter=ACMR -- 'sites/**/*.channels.xml' | sed 's| |\\ |g')"

if [ ! -z "$channels_changed" ]; then
echo "npx eslint $channels_changed"
npm run channels:lint -- $channels_changed
fi
7 changes: 7 additions & 0 deletions .husky/channels_validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

channels_changed="$(git diff --staged --name-only --diff-filter=ACMR -- 'sites/**/*.channels.xml' | sed 's| |\\ |g')"

if [ ! -z "$channels_changed" ]; then
npm run channels:validate -- $channels_changed
fi
5 changes: 3 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.husky/check_scripts.sh
.husky/check_channels.sh
.husky/scripts_lint.sh
.husky/channels_lint.sh
.husky/channels_validate.sh
1 change: 0 additions & 1 deletion .husky/check_scripts.sh → .husky/scripts_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
scripts_changed="$(git diff --staged --name-only --diff-filter=ACMR -- 'tests/**/*.ts' 'tests/**/*.js' 'scripts/**/*.ts' 'scripts/**/*.mts' 'scripts/**/*.js' 'sites/**/*.js' 'sites/**/*.ts' | sed 's| |\\ |g')"

if [ ! -z "$scripts_changed" ]; then
echo "npx eslint $scripts_changed"
npx eslint $scripts_changed
fi
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Options:
-l, --lang <code> Filter channels by language (ISO 639-2 code)
-t, --timeout <milliseconds> Override the default timeout for each request
-d, --delay <milliseconds> Override the default delay between request
-x, --proxy <url> Use the specified proxy (example: "socks5://username:password@127.0.0.1:1234")
--days <days> Override the number of days for which the program will be loaded
(defaults to the value from the site config)
--maxConnections <number> Limit on the number of concurrent requests (default: 1)
Expand Down
147 changes: 126 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@alex_neo/jest-expect-message": "^1.0.5",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@freearhey/core": "^0.5.0",
"@ntlab/sfetch": "^1.0.0",
"@freearhey/core": "^0.5.1",
"@ntlab/sfetch": "^1.2.0",
"@octokit/core": "^6.1.3",
"@octokit/plugin-paginate-rest": "^11.3.6",
"@octokit/plugin-rest-endpoint-methods": "^13.2.6",
Expand All @@ -67,7 +67,7 @@
"csv-parser": "^3.0.0",
"cwait": "^1.1.2",
"dayjs": "^1.11.10",
"epg-grabber": "^0.37.4",
"epg-grabber": "^0.38.0",
"epg-parser": "^0.3.1",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.0.0",
Expand Down Expand Up @@ -98,6 +98,7 @@
"serve": "^14.2.4",
"signale": "^1.4.0",
"skip-postinstall": "^1.0.0",
"socks-proxy-agent": "^8.0.5",
"srcset": "^4.0.0",
"table2array": "^0.0.2",
"tabletojson": "^2.0.7",
Expand Down
2 changes: 1 addition & 1 deletion scripts/commands/channels/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function main() {
const logger = new Logger()
const file = new File(options.config)
const dir = file.dirname()
const config = (await import(pathToFileURL(options.config))).default
const config = (await import(pathToFileURL(options.config).toString())).default
const outputFilepath = options.output || `${dir}/${config.site}.channels.xml`

let channels = new Collection()
Expand Down
2 changes: 2 additions & 0 deletions scripts/commands/epg/grab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ program
.option('-l, --lang <code>', 'Filter channels by language (ISO 639-2 code)')
.option('-t, --timeout <milliseconds>', 'Override the default timeout for each request')
.option('-d, --delay <milliseconds>', 'Override the default delay between request')
.option('-x, --proxy <url>', 'Use the specified proxy')
.option(
'--days <days>',
'Override the number of days for which the program will be loaded (defaults to the value from the site config)',
Expand All @@ -42,6 +43,7 @@ export type GrabOptions = {
lang?: string
days?: number
cron?: string
proxy?: string
}

const options: GrabOptions = program.opts()
Expand Down
17 changes: 9 additions & 8 deletions scripts/commands/sites/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ async function main() {
const data = new Collection()
sites.forEach((site: Site) => {
data.add([
`<a href="sites/${site.domain}">${site.domain}</a>`,
`${site.totalChannels} / ${site.markedChannels}`,
site.getStatus().emoji,
site.getIssues().all().join(', ')
{ value: `<a href="sites/${site.domain}">${site.domain}</a>` },
{ value: site.totalChannels, align: 'right' },
{ value: site.markedChannels, align: 'right' },
{ value: site.getStatus().emoji, align: 'center' },
{ value: site.getIssues().all().join(', ') }
])
})

logger.info('updating sites.md...')
const table = new HTMLTable(data.all(), [
{ name: 'Site' },
{ name: 'Channels *', align: 'center' },
{ name: 'Status' },
{ name: 'Notes' }
{ name: 'Site', align: 'left' },
{ name: 'Channels<br>(total / with xmltv-id)', colspan: 2, align: 'left' },
{ name: 'Status', align: 'left' },
{ name: 'Notes', align: 'left' }
])
const rootStorage = new Storage(ROOT_DIR)
const sitesTemplate = await new Storage().load('scripts/templates/_sites.md')
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/configLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ConfigLoader {
const fileUrl = pathToFileURL(filepath).toString()
const config = (await import(fileUrl)).default
const defaultConfig = {
days: 2,
days: 1,
delay: 0,
output: 'guide.xml',
request: {
Expand Down
Loading