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

web.magentatv.de #2555

Closed
freearhey opened this issue Dec 30, 2024 · 6 comments · Fixed by #2564
Closed

web.magentatv.de #2555

freearhey opened this issue Dec 30, 2024 · 6 comments · Fixed by #2564
Labels
broken guide There's a problem with the guide status:down The guide doesn't work

Comments

@freearhey
Copy link
Collaborator

Site

web.magentatv.de

Description

npm test --- web.magentatv.de

> test
> run-script-os web.magentatv.de


> test:default
> TZ=Pacific/Nauru npx jest --runInBand web.magentatv.de

 FAIL  sites/web.magentatv.de/web.magentatv.de.test.js
  ● Test suite failed to run

    Cannot find module 'node-fetch' from 'sites/web.magentatv.de/web.magentatv.de.config.js'

    Require stack:
      sites/web.magentatv.de/web.magentatv.de.config.js
      sites/web.magentatv.de/web.magentatv.de.test.js

      3 | const utc = require('dayjs/plugin/utc')
      4 | const customParseFormat = require('dayjs/plugin/customParseFormat')
    > 5 | const fetch = require('node-fetch')
        |               ^
      6 | const { upperCase } = require('lodash')
      7 |
      8 | let X_CSRFTOKEN

      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (sites/web.magentatv.de/web.magentatv.de.config.js:5:15)
      at Object.<anonymous> (sites/web.magentatv.de/web.magentatv.de.test.js:1:34)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        4.052 s
Ran all test suites matching /web.magentatv.de/i.
npm run grab --- --site=web.magentatv.de

> grab
> npx tsx scripts/commands/epg/grab.ts --site=web.magentatv.de

starting...
config:
  output: guide.xml
  maxConnections: 1
  gzip: false
  site: web.magentatv.de
loading channels...
  found 348 channel(s)
run #1:
node:internal/modules/cjs/loader:1249
  const err = new Error(message);
              ^

Error: Cannot find module 'node-fetch'
Require stack:
- /Users/Arhey/Code/iptv-org/epg/sites/web.magentatv.de/web.magentatv.de.config.js
    at node:internal/modules/cjs/loader:1249:15
    at nextResolveSimple (/Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:942)
    at /Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-DCnOAxY2.cjs:2:2550
    at /Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-DCnOAxY2.cjs:2:1624
    at resolveTsPaths (/Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:760)
    at /Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-DCnOAxY2.cjs:3:1038
    at m._resolveFilename (file:///Users/Arhey/Code/iptv-org/epg/node_modules/tsx/dist/register-RyGUjI6j.mjs:1:789)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:219:24) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/Arhey/Code/iptv-org/epg/sites/web.magentatv.de/web.magentatv.de.config.js'
  ]
}

Node.js v22.12.0
@freearhey freearhey added broken guide There's a problem with the guide status:down The guide doesn't work labels Dec 30, 2024
@chr-hertel
Copy link

works for me

image

image

was able to create a guide.xml based on web.magentatv.de

@lomenzel
Copy link

lomenzel commented Jan 2, 2025

i get the same error as the author

@BellezaEmporium
Copy link
Contributor

Node has "fetch" pre-built in the newer versions (18>), maybe should we rely on the natives ?

@michaelfeinbier
Copy link
Contributor

michaelfeinbier commented Jan 2, 2025

Indeed it does not work with newer versions of Node - on first glance at the plugin I don't think fetch should be needed here since axios is already loaded which should be able to do the trick

Edit: I made it work using pure axios - will push a PR in a bit

@michaelfeinbier
Copy link
Contributor

If you have a chance, please give #2564 a try and let me know if that works for you

@shawly
Copy link

shawly commented Jan 6, 2025

It indeed works again, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken guide There's a problem with the guide status:down The guide doesn't work
Development

Successfully merging a pull request may close this issue.

6 participants