Repository: m0ngr31/EPlusTV Branch: master Commit: 68c67fb062c6 Files: 162 Total size: 685.3 KB Directory structure: gitextract_rv9tbtv8/ ├── .dockerignore ├── .editorconfig ├── .eslintrc.json ├── .github/ │ └── workflows/ │ ├── push-docker-hub.yml │ └── release.yml ├── .gitignore ├── .husky/ │ └── pre-commit ├── .nvmrc ├── .prettierrc.json ├── Dockerfile ├── LICENSE ├── README.md ├── entrypoint.sh ├── index.tsx ├── package.json ├── services/ │ ├── adobe-helpers.ts │ ├── app-status.ts │ ├── b1g-handler.ts │ ├── bally-handler.ts │ ├── build-schedule.ts │ ├── caching.ts │ ├── cbs-handler.ts │ ├── channels.ts │ ├── config.ts │ ├── database.ts │ ├── debug.ts │ ├── espn-handler.ts │ ├── flo-handler.ts │ ├── fox-handler.ts │ ├── foxone-handler.ts │ ├── generate-m3u.ts │ ├── generate-xmltv.ts │ ├── gotham-channels.ts │ ├── gotham-handler.ts │ ├── hudl-handler.ts │ ├── init-directories.ts │ ├── jsdom-helper.ts │ ├── kbo-handler.ts │ ├── ksl-handler.ts │ ├── launch-channel.ts │ ├── midco-handler.ts │ ├── misc-db-service.ts │ ├── mlb-handler.ts │ ├── mw-handler.ts │ ├── networks.ts │ ├── nfl-handler.ts │ ├── nhltv-handler.ts │ ├── nwsl-handler.ts │ ├── outside-handler.ts │ ├── paramount-handler.ts │ ├── playlist-handler.ts │ ├── port.ts │ ├── providers/ │ │ ├── b1g/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── bally/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ └── index.tsx │ │ ├── cbs-sports/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── espn/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── espn-plus/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── flosports/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── fox/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── foxone/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── gotham/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ ├── TveLogin.tsx │ │ │ └── index.tsx │ │ ├── hudl/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ └── index.tsx │ │ ├── index.ts │ │ ├── kbo/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ └── index.tsx │ │ ├── ksl/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ └── index.tsx │ │ ├── midco/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── mlb/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── mw/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ └── index.tsx │ │ ├── nfl/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── nhl-tv/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── nwsl/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── outside/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── paramount/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── pwhl/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ └── index.tsx │ │ ├── victory/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── wnba/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ ├── CardBody.tsx │ │ │ ├── Login.tsx │ │ │ └── index.tsx │ │ ├── wsn/ │ │ │ ├── index.tsx │ │ │ └── views/ │ │ │ └── index.tsx │ │ └── zeam/ │ │ ├── index.tsx │ │ └── views/ │ │ └── index.tsx │ ├── pwhl-handler.ts │ ├── shared-helpers.ts │ ├── shared-interfaces.ts │ ├── template-handler.ts │ ├── tubi-helper.ts │ ├── user-agent.ts │ ├── victory-handler.ts │ ├── wnba-handler.ts │ ├── wsn-handler.ts │ ├── yt-dlp-helper.ts │ └── zeam-handler.ts ├── tsconfig.json └── views/ ├── Header.tsx ├── Layout.tsx ├── Links.tsx ├── Main.tsx ├── Options.tsx ├── Providers.tsx ├── Script.tsx ├── Style.tsx └── Tools.tsx ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ node_modules/ config/ tmp/ playroom/ run*.sh .DS_Store ================================================ FILE: .editorconfig ================================================ # http://editorconfig.org root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true [*.md] insert_final_newline = false trim_trailing_whitespace = false ================================================ FILE: .eslintrc.json ================================================ { "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2018, "sourceType": "module", "warnOnUnsupportedTypeScriptVersion": false }, "plugins": [ "@typescript-eslint", "sort-keys-custom-order-fix" ], "extends": [ "plugin:@typescript-eslint/recommended" ], "rules": { "sort-keys-custom-order-fix/sort-keys-custom-order-fix": "warn", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-explicit-any": "off", "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ "error" ], "object-shorthand": ["error", "always"] } } ================================================ FILE: .github/workflows/push-docker-hub.yml ================================================ name: ci on: push: tags: - '*' jobs: docker: runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - name: Checkout uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v2 - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Docker meta id: meta uses: docker/metadata-action@v3 with: images: | ${{ secrets.DOCKERHUB_USERNAME }}/eplustv tags: | type=raw,value=latest,enable=${{ endsWith(github.ref, 'master') }} type=ref,event=tag - name: Build and push uses: docker/build-push-action@v2 with: context: . platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Update repo description uses: peter-evans/dockerhub-description@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} repository: ${{ secrets.DOCKERHUB_USERNAME }}/eplustv - name: Login to new DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.NEW_DOCKERHUB_USERNAME }} password: ${{ secrets.NEW_DOCKERHUB_TOKEN }} - name: Docker new meta id: new_meta uses: docker/metadata-action@v3 with: images: | ${{ secrets.NEW_DOCKERHUB_USERNAME }}/eplustv tags: | type=raw,value=latest,enable=${{ endsWith(github.ref, 'master') }} type=ref,event=tag - name: Build and push new uses: docker/build-push-action@v2 with: context: . platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.new_meta.outputs.tags }} labels: ${{ steps.new_meta.outputs.labels }} - name: Update new repo description uses: peter-evans/dockerhub-description@v2 with: username: ${{ secrets.NEW_DOCKERHUB_USERNAME }} password: ${{ secrets.NEW_DOCKERHUB_PASSWORD }} repository: ${{ secrets.NEW_DOCKERHUB_USERNAME }}/eplustv ================================================ FILE: .github/workflows/release.yml ================================================ name: Create Release on Tag Push on: push: tags: - '*' jobs: create_release: runs-on: ubuntu-latest permissions: contents: write if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - name: Print a simple message run: echo "Checking out..." - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Print a simple message run: echo "Creating release..." - name: Print a simple message run: echo "Using release name and tag ${{ github.ref_name }}" #- name: Get latest commit message #id: get_commit_message #run: | # COMMIT_MESSAGE=$(git log -1 --pretty=%B) # echo "commit_message<> $GITHUB_OUTPUT # echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT # echo "EOF" >> $GITHUB_OUTPUT - name: Create Release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref_name }} release_name: ${{ github.ref_name }} #body: ${{ steps.get_commit_message.outputs.commit_message }} draft: false prerelease: false ================================================ FILE: .gitignore ================================================ # Created by https://www.toptal.com/developers/gitignore/api/node,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=node,visualstudiocode ### Node ### # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* .pnpm-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage *.lcov # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Snowpack dependency directory (https://snowpack.dev/) web_modules/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ .rts2_cache_es/ .rts2_cache_umd/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test .env.production # parcel-bundler cache (https://parceljs.org/) .cache .parcel-cache # Next.js build output .next out # Nuxt.js build / generate output .nuxt dist # Gatsby files .cache/ # Comment in the public line in if your project uses Gatsby and not Next.js # https://nextjs.org/blog/next-9-1#public-directory-support # public # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # TernJS port file .tern-port # Stores VSCode versions used for testing VSCode extensions .vscode-test # yarn v2 .yarn/cache .yarn/unplugged .yarn/build-state.yml .yarn/install-state.gz .pnp.* ### VisualStudioCode ### .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace # Local History for Visual Studio Code .history/ ### VisualStudioCode Patch ### # Ignore all local history of files .history .ionide # End of https://www.toptal.com/developers/gitignore/api/node,visualstudiocode tmp/ run*.sh .DS_Store config*/ playroom/ ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged ================================================ FILE: .nvmrc ================================================ 18 ================================================ FILE: .prettierrc.json ================================================ { "arrowParens": "avoid", "bracketSpacing": false, "embeddedLanguageFormatting": "auto", "htmlWhitespaceSensitivity": "css", "insertPragma": false, "printWidth": 120, "proseWrap": "preserve", "quoteProps": "as-needed", "requirePragma": false, "semi": true, "singleQuote": true, "tabWidth": 2, "trailingComma": "all", "useTabs": false } ================================================ FILE: Dockerfile ================================================ FROM alpine:latest RUN mkdir -p /etc/udhcpc ; echo 'RESOLV_CONF="no"' >> /etc/udhcpc/udhcpc.conf RUN apk add --update nodejs npm su-exec shadow yt-dlp RUN rm -rf /var/cache/apk/* RUN mkdir /app WORKDIR /app COPY . . RUN npm ci RUN chmod +x entrypoint.sh ENTRYPOINT ["./entrypoint.sh"] ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================

Current version: **4.15.6** # About This takes programming from various providers and transforms it into a "live TV" experience with virtual linear channels. It will discover what is on, and generate a schedule of channels that will give you M3U and XMLTV files that you can import into something like [Jellyfin](https://jellyfin.org) or [Channels](https://getchannels.com). ## Notes * This was not made for pirating streams. This is made for using your own credentials and have a different presentation than the streaming apps currently provide. * The Mouse might not like it and it could be taken down at any minute. Enjoy it while it lasts. ¯\\_(ツ)_/¯ # Using The server exposes 4 main endpoints: | Endpoint | Description | |---|---| | /channels.m3u | The channel list you'll import into your client | | /xmltv.xml | The schedule that you'll import into your client | | /linear-channels.m3u | The linear channel list you'll import into your client (only used when using the dedicated linear channels option) | | /linear-xmltv.xml | The linear schedule that you'll import into your client (only used when using the dedicated linear channels option) - Not needed for Channels DVR | # Running The recommended way of running is to pull the image from [Docker Hub](https://hub.docker.com/r/tonywagner/eplustv). ## Environment Variables | Environment Variable | Description | Required? | Default | |---|---|---|---| | BASE_URL | If using a reverse proxy, m3u will be generated with this as the base. | No | - | | PUID | Current user ID. Use if you have permission issues. Needs to be combined with PGID. | No | - | | PGID | Current group ID. Use if you have permission issues. Needs to be combined with PUID. | No | - | | PORT | Port the API will be served on. You can set this if it conflicts with another service in your environment. | No | 8000 | ### Available Providers #### Bally Available for free #### B1G+ Available to login with B1G+ credentials (or for free with certain ISP providers) #### CBS Sports Available to login with TV Provider. Please note that there is no token refresh option here. It will require re-authenticating every 30 days. #### ESPN Limited free content. Also available to login with TV Provider ##### Linear Channels Will create dedicated linear channels if using dedicated linear channels, otherwise will schedule events normally | Network Name | Description | |---|---| | ESPN | Set if your TV provider supports it | | ESPN2 | Set if your TV provider supports it | | ESPNU | Set if your TV provider supports it | | SEC Network | Set if your TV provider supports it | | ACC Network | Set if your TV provider supports it | | ESPNews | Set if your TV provider supports it | | ESPN Deportes | Set if your TV provider supports it | #### ESPN Account Formerly ESPN+. Still available to login with ESPN credentials, but does not provide access to events anymore. ##### Extras | Name | Description | |---|---| | ESPN+ PPV | Schedule ESPN+ PPV events | #### FloSports Available to login with FloSports credentials #### FOXOne Available to login with TV Provider - Direct Subscription or ESPN Subscription Not Currently Supported ##### Linear Channels Will create dedicated linear channels if using dedicated linear channels, otherwise will schedule events normally | Network Name | |---| | FOX | Set if your TV provider supports it | | MyNetwork TV | Set if your TV provider supports it | | FS1 | Set if your TV provider supports it | | FS2 | Set if your TV provider supports it | | B1G Network | Set if your TV provider supports it | | FOX Deportes | Set if your TV provider supports it | | FOX News Channel | Set if your TV provider supports it | | FOX Business Network | Set if your TV provider supports it | | TMZ | Set if your TV provider supports it | | Masked Singer | Set if your TV provider supports it | | FOX Soul | Set if your TV provider supports it | | FOX Weather | Set if your TV provider supports it | | FOX Live Now | Set if your TV provider supports it | #### FOX Sports Available to login with TV Provider ##### Linear Channels Some events are on linear channels and some aren't. If you use dedicated linear channels, only events that are on FOX will be scheduled normally. All other events will be scheduled to linear channels | Network Name | |---| | FS1 | Set if your TV provider supports it | | FS2 | Set if your TV provider supports it | | B1G Network | Set if your TV provider supports it | | FOX Soccer Plus | Set if your TV provider supports it | | FOX Deportes | Set if your TV provider supports it | #### Gotham Sports Available to login with Gotham Sports or TV Provider ##### Linear Channels Will create dedicated linear channels if using dedicated linear channels, otherwise will schedule events normally | Network Name | Description | |---|---| | MSG | MSG (If in your supported zone) | | MSGSN | MSG Sportsnet HD (If in your supported zone) | | MSG2 | MSG2 HD (If in your supported zone) | | MSGSN2 | MSG Sportsnet 2 HD (If in your supported zone) | | YES | Yes Network (If in your supported zone) | #### Hudl Various small college conferences, available for free #### KBO Available for free #### KSL Sports Available for free #### LOVB Use Victory+ instead #### Midco Sports Available to login with Midco Sports credentials #### MLB.tv Available to login with MLB.tv credentials ##### Extras | Name | Description | |---|---| | Only free games | If you have a free account, only 1 free game per day will be scheduled | ##### Linear Channels | Network Name | Description | |---|---| | Big Inning | Will create a dedicated linear channel if using dedicated linear channels, otherwise will schedule Big Inning normally | | MLB Network | Only available if you have MLB Network as part of your MLB.tv account or have linked TVE Provider that provides access | | SNY | Only available if you have SNY as part of your MLB.tv account or have linked TVE Provider that provides access | | SNLA | Only available if you have SNLA+ as part of your MLB.tv account or have linked TVE Provider that provides access | #### Mountain West Available for free #### NHL.tv Available to login with NHL.tv account (Europe only) #### NFL Available to login with NFL.com credentials This integration works with NFL+ or using other providers (TVE, Amazon Prime, Peacock, Sunday Ticket) to access games. ##### Extra Providers If you don't have an NFL+ subscription, you can use these providers to access games. | Provider Name | Description | |---|---| | Amazon Prime | Get TNF games from Amazon Prime | | Peacock | Get SNF games from Peacock | | TV Provider | Get in-market games from your TV Provider | | Sunday Ticket | Get out-of-market games from Youtube | ##### Linear Channels If you have access to NFL RedZone, it will be scheduled. If dedicated linear channels is set, it will be on its own channel | Network Name | Description | |---|---| | NFL Network | NFL+ or TV Provider access | | NFL RedZone | NFL+ Premium or TV Provider access | | NFL Channel | Free channel for all accounts | #### NWSL+ Available to login with NWSL+ credentials #### Outside TV Available to login with Outside TV credentials (free account) ##### Linear Channels Dedicated linear channels - Will only schedule when dedicated linear channels is set | Network Name | |---| | Outside | #### Paramount+ Available to login with Paramount+ credentials ##### Linear Channels Dedicated linear channels - Will only schedule when dedicated linear channels is set | Network Name | Description | |---|---| | CBS Sports HQ | Set if your TV provider supports it | | Golazo Network | Set if your TV provider supports it | #### PWHL Available for free #### Victory+ Available to login with Victory+ credentials. #### WNBA League Pass Available to login with WNBA League Pass credentials #### Women's Sports Network Available for free - only linear channel ##### Linear Channels | Network Name | Description | |---|---| | WSN | Women's Sports Network | #### Zeam Live Events Available for free ## Volumes | Volume Name | Description | Required? | |---|---|---| | /app/config | Used to store DB and application state | Yes | ## Docker Run By default, the easiest way to get running is: ```bash docker run -p 8000:8000 -v config_dir:/app/config tonywagner/eplustv ``` If you run into permissions issues: ```bash docker run -p 8000:8000 -v config_dir:/app/config -e PUID=$(id -u $USER) -e PGID=$(id -g $USER) tonywagner/eplustv ``` Open the service in your web browser at `http://:8000` ================================================ FILE: entrypoint.sh ================================================ #!/bin/sh if [ -z "$PUID" ] || [ -z "$PGID" ]; then exec npm start else adduser -u $PUID -D abc groupmod -g $PGID abc chown abc:abc -R /app exec su-exec abc npm start fi ================================================ FILE: index.tsx ================================================ import {Context, Hono} from 'hono'; import {serve} from '@hono/node-server'; import {serveStatic} from '@hono/node-server/serve-static'; import {BlankEnv, BlankInput} from 'hono/types'; import {html} from 'hono/html'; import moment from 'moment'; import _ from 'lodash'; import axios from 'axios'; import fs from 'fs'; import {createServer} from 'node:https'; import {generateM3u, generateEventChannelsM3u} from './services/generate-m3u'; import {initDirectories} from './services/init-directories'; import {generateXml} from './services/generate-xmltv'; import {launchChannel} from './services/launch-channel'; import {scheduleEntries} from './services/build-schedule'; import {espnHandler} from './services/espn-handler'; import {foxHandler} from './services/fox-handler'; import {foxOneHandler} from './services/foxone-handler'; import {mlbHandler} from './services/mlb-handler'; import {b1gHandler} from './services/b1g-handler'; import {floSportsHandler} from './services/flo-handler'; import {paramountHandler} from './services/paramount-handler'; import {nflHandler} from './services/nfl-handler'; import {gothamHandler} from './services/gotham-handler'; import {mwHandler} from './services/mw-handler'; import {pwhlHandler} from './services/pwhl-handler'; import {ballyHandler} from './services/bally-handler'; import {wsnHandler} from './services/wsn-handler'; import {nwslHandler} from './services/nwsl-handler'; import {midcoHandler} from './services/midco-handler'; import {hudlHandler} from './services/hudl-handler'; import {cbsHandler} from './services/cbs-handler'; import {nhlHandler} from './services/nhltv-handler'; import {victoryHandler} from './services/victory-handler'; import {kboHandler} from './services/kbo-handler'; import {kslHandler} from './services/ksl-handler'; import {zeamHandler} from './services/zeam-handler'; import {outsideHandler} from './services/outside-handler'; import {wnbaHandler} from './services/wnba-handler'; import { cleanEntries, clearChannels, removeAllEntries, removeChannelStatus, resetSchedule, latestRelease, } from './services/shared-helpers'; import {appStatus} from './services/app-status'; import {SERVER_PORT} from './services/port'; import {providers} from './services/providers'; import {version} from './package.json'; import {Layout} from './views/Layout'; import {Header} from './views/Header'; import {Main} from './views/Main'; import {Links} from './views/Links'; import {Style} from './views/Style'; import {Providers} from './views/Providers'; import {Script} from './views/Script'; import {Tools} from './views/Tools'; import {Options} from './views/Options'; import {CBSSports} from './services/providers/cbs-sports/views'; import {MntWest} from './services/providers/mw/views'; import {Hudl} from './services/providers/hudl/views'; import {Paramount} from './services/providers/paramount/views'; import {FloSports} from './services/providers/flosports/views'; import {MlbTv} from './services/providers/mlb/views'; import {FoxSports} from './services/providers/fox/views'; import {FoxOne} from './services/providers/foxone/views'; import {B1G} from './services/providers/b1g/views'; import {NFL} from './services/providers/nfl/views'; import {ESPN} from './services/providers/espn/views'; import {ESPNPlus} from './services/providers/espn-plus/views'; import {Gotham} from './services/providers/gotham/views'; import {WSN} from './services/providers/wsn/views'; import {PWHL} from './services/providers/pwhl/views'; import {Bally} from './services/providers/bally/views'; import {Nwsl} from './services/providers/nwsl/views'; import {Midco} from './services/providers/midco/views'; import {NHL} from './services/providers/nhl-tv/views'; import {Victory} from './services/providers/victory/views'; import {KBO} from './services/providers/kbo/views'; import {KSL} from './services/providers/ksl/views'; import {Zeam} from './services/providers/zeam/views'; import {Outside} from './services/providers/outside/views'; import {WNBA} from './services/providers/wnba/views'; import { initMiscDb, resetLinearStartChannel, setLinear, setNumberofChannels, setProxySegments, setStartChannel, usesLinear, setXmltvPadding, setHideStudio, setEventFilters, getLatestVersion, getLastModified, setLastModified, } from './services/misc-db-service'; // Check for SSL environment variables const sslCertificatePath = process.env.SSL_CERTIFICATE_PATH; const sslPrivateKeyPath = process.env.SSL_PRIVATEKEY_PATH; // Set timeout of requests to 1 minute axios.defaults.timeout = 1000 * 60; const notFound = (c: Context) => { return c.text('404 not found', 404, { 'X-Tuner-Error': 'EPlusTV: Error getting content', }); }; const shutDown = () => process.exit(0); const getUri = (c: Context): string => { if (process.env.BASE_URL) { return process.env.BASE_URL; } const protocol = c.req.header('x-forwarded-proto') || 'http'; const host = c.req.header('host') || ''; return `${protocol}://${host}`; }; const checkVersion = async () => { const latest_version = await getLatestVersion(); const latest_release = await latestRelease(); if ( latest_release && (latest_release != '') && (latest_version != latest_release) && (version != latest_release.slice(1)) ) { console.log(`=== Newer version ${latest_release} available, consider updating ===`); } } const schedule = async () => { await checkVersion(); console.log('=== Getting events ==='); await Promise.all([ espnHandler.getSchedule(), foxHandler.getSchedule(), foxOneHandler.getSchedule(), mlbHandler.getSchedule(), b1gHandler.getSchedule(), floSportsHandler.getSchedule(), mwHandler.getSchedule(), wsnHandler.getSchedule(), pwhlHandler.getSchedule(), ballyHandler.getSchedule(), hudlHandler.getSchedule(), nflHandler.getSchedule(), nwslHandler.getSchedule(), midcoHandler.getSchedule(), paramountHandler.getSchedule(), gothamHandler.getSchedule(), cbsHandler.getSchedule(), nhlHandler.getSchedule(), victoryHandler.getSchedule(), kboHandler.getSchedule(), kslHandler.getSchedule(), zeamHandler.getSchedule(), outsideHandler.getSchedule(), wnbaHandler.getSchedule(), ]); console.log('=== Done getting events ==='); console.log('=== Building the schedule ==='); await cleanEntries(); await scheduleEntries(); console.log('=== Done building the schedule ==='); }; const app = new Hono(); app.use('/node_modules/*', serveStatic({root: './'})); app.use('/favicon.ico', serveStatic({root: './'})); app.route('/', providers); app.get('/', async c => { return c.html( html`${(
); ================================================ FILE: views/Tools.tsx ================================================ import type {FC} from 'hono/jsx'; export const Tools: FC = () => (

Tools