@@ -49,6 +49,7 @@ See [Environment variables](#environment-variables) for configuration options.
|
||||
| `LINEUP_ID` | Lineup ID; You can find this at https://tvlistings.gracenote.com/grid-affiliates.html?aid=orbebb | String | `USA-lineupId-DEFAULT` (Attenna) |
|
||||
| `TIMESPAN` | Either 3 or 6 hours of shows | Integer | 3 |
|
||||
| `PREF` | User Preferences, comma separated list. `m` for showing music, `p` for showing pay-per-view, `h` for showing HD | String | (empty) |
|
||||
| `COUNTRY` | Country code (default: `US`) | String | US |
|
||||
| `POSTAL_CODE` | Postal code of where shows are available. | Integer | 30309 |
|
||||
| `USER_AGENT` | Custom user agent string for HTTP requests. | String | Uses random if not specified |
|
||||
| `TZ` | Timezone | String | System default |
|
||||
@@ -62,6 +63,7 @@ See [Environment variables](#environment-variables) for configuration options.
|
||||
| `--lineupId` | Lineup ID; You can find this at https://tvlistings.gracenote.com/grid-affiliates.html?aid=orbebb | String | `USA-lineupId-DEFAULT` (Attenna) |
|
||||
| `--timespan` | Either 3 or 6 hours of shows | Integer | 3 |
|
||||
| `--pref` | User Preferences, comma separated list. `m` for showing music, `p` for showing pay-per-view, `h` for showing HD | String | (empty) |
|
||||
| `--country` | Country code (default: `US`) | String | US |
|
||||
| `--postalCode` | Postal code of where shows are available. | Integer | 30309 |
|
||||
| `--userAgent` | Custom user agent string for HTTP requests. | String | Uses random if not specified |
|
||||
| `--timezone` | Timezone | String | System default |
|
||||
|
||||
@@ -10,6 +10,10 @@ export const config = {
|
||||
process.env.TIMESPAN ||
|
||||
process.argv.find((arg) => arg.startsWith("--timespan="))?.split("=")[1] ||
|
||||
"3",
|
||||
country:
|
||||
process.env.COUNTRY ||
|
||||
process.argv.find((arg) => arg.startsWith("--country="))?.split("=")[1] ||
|
||||
"USA",
|
||||
postalCode:
|
||||
process.env.POSTAL_CODE ||
|
||||
process.argv
|
||||
|
||||
@@ -12,7 +12,8 @@ Options:
|
||||
--help Show this help message
|
||||
--lineupId=ID Lineup ID (default: USA-lineupId-DEFAULT)
|
||||
--timespan=NUM Timespan in hours (default: 3)
|
||||
--pref=LIST User preferences, comma separated. Can be m, p, and h (default: empty)
|
||||
--pref=LIST User preferences, comma separated. Can be m, p, and h (default: empty)'
|
||||
--country=CON Country code (default: USA)
|
||||
--postalCode=ZIP Postal code (default: 30309)
|
||||
--userAgent=UA Custom user agent string (default: Uses random if not specified)
|
||||
--timezone=TZ Timezone (default: America/New_York)
|
||||
|
||||
@@ -83,7 +83,7 @@ function buildUrl() {
|
||||
lineupId: config.lineupId,
|
||||
timespan: config.timespan,
|
||||
headendId: "lineupId",
|
||||
country: "USA",
|
||||
country: config.country,
|
||||
timezone: config.timezone,
|
||||
postalCode: config.postalCode,
|
||||
isOverride: "true",
|
||||
@@ -109,7 +109,7 @@ export async function getTVListings(): Promise<GridApiResponse> {
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch: ${response.status} ${response.statusText}`,
|
||||
`Failed to fetch: ${response.status} ${response.statusText}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user