kompot / nhl-tv-geeky-streams

Best way to download NHL games. NHL.TV, NHL LIVE, or WatchESPN account is required.
MIT License
36 stars 7 forks source link

Can't access - error with ESPN.com #76

Closed Lazar911 closed 1 month ago

Lazar911 commented 1 year ago

I get the following error message when starting up the docker container and trying to access the program:

yarn run v1.22.19 $ ./node_modules/.bin/ts-node src/index.ts /app/node_modules/axios/lib/core/AxiosError.js:89 AxiosError.call(axiosError, error.message, code, config, request, response); ^ AxiosError: getaddrinfo EAI_AGAIN site.api.espn.com at Function.AxiosError.from (/app/node_modules/axios/lib/core/AxiosError.js:89:14) at RedirectableRequest.handleRequestError (/app/node_modules/axios/lib/adapters/http.js:606:25) at RedirectableRequest.emit (node:events:514:28) at RedirectableRequest.emit (node:domain:488:12) at ClientRequest.eventHandlers. (/app/node_modules/follow-redirects/index.js:14:24) at ClientRequest.emit (node:events:514:28) at ClientRequest.emit (node:domain:488:12) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at TLSSocket.emit (node:domain:488:12) { hostname: 'site.api.espn.com', syscall: 'getaddrinfo', code: 'EAI_AGAIN', errno: -3001, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [ 'xhr', 'http' ], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function], Blob: [class Blob] }, validateStatus: [Function: validateStatus], headers: Object [AxiosHeaders] { Accept: 'application/json, text/plain, /', 'Content-Type': undefined, 'User-Agent': 'axios/1.6.1', 'Accept-Encoding': 'gzip, compress, deflate, br' }, baseURL: 'https://site.api.espn.com/apis/site/v2/sports/hockey/nhl', url: '/scoreboard', params: { dates: '20231119' }, method: 'get', data: undefined }, request: <ref *1> Writable { _writableState: WritableState { state: 802924, highWaterMark: 16384, defaultEncoding: 'utf8', length: 0, corked: 0, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, pendingcb: 0, errored: null,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError],
  socket: [Function: handleRequestSocket]
},
_eventsCount: 3,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: Infinity,
  protocol: 'https:',
  path: '/apis/site/v2/sports/hockey/nhl/scoreboard?dates=20231119',
  method: 'GET',
  headers: [Object: null prototype],
  agents: [Object],
  auth: undefined,
  family: undefined,
  beforeRedirect: [Function: dispatchBeforeRedirect],
  beforeRedirects: [Object],
  hostname: 'site.api.espn.com',
  port: '',
  agent: undefined,
  nativeProtocols: [Object],
  pathname: '/apis/site/v2/sports/hockey/nhl/scoreboard',
  search: '?dates=20231119'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: true,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [TLSSocket],
  _header: 'GET /apis/site/v2/sports/hockey/nhl/scoreboard?dates=20231119 HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'User-Agent: axios/1.6.1\r\n' +
    'Accept-Encoding: gzip, compress, deflate, br\r\n' +
    'Host: site.api.espn.com\r\n' +
    'Connection: keep-alive\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/apis/site/v2/sports/hockey/nhl/scoreboard?dates=20231119',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: [Function: emitRequestTimeout],
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'site.api.espn.com',
  protocol: 'https:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kHighWaterMark)]: 16384,
  [Symbol(kRejectNonStandardBodyWrites)]: false,
  [Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'https://site.api.espn.com/apis/site/v2/sports/hockey/nhl/scoreboard?dates=20231119',
[Symbol(kCapture)]: false

}, cause: Error: getaddrinfo EAI_AGAIN site.api.espn.com at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'site.api.espn.com' } } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It seems that there is an issue with ESPN.com and not with the NHL.TV servers. Are the ESPN servers needed? I only access games via NHL.TV, so it would be nice to only have this option and ignoe ESPN...

Thanks :)

rseanhall commented 1 year ago

You can update your config.yaml to ignore ESPN:

# preferred provider
# 'nhltv' or 'espn'
preferredProvider: nhltv

# when false, will only show feeds from preferredProvider.
showOtherProviders: false
Lazar911 commented 1 year ago

You can update your config.yaml to ignore ESPN:

# preferred provider
# 'nhltv' or 'espn'
preferredProvider: nhltv

# when false, will only show feeds from preferredProvider.
showOtherProviders: false

Thanks for the reply.

My settings are exactly the same, but I still get the error. Don't know why ESPN servers are being contacted although the settings are set to prefer NHL.TV and ignore ESPN? Or am I missing something/getting something wrong here?

rseanhall commented 1 year ago

Are you sure? Lines starting with # are a comment. The line preferredProvider: nhltv is commented out by default, you have to uncomment it.

Lazar911 commented 1 year ago

Thanks, was indeed commented. But when I uncomment it, I get basically the same error, but referred to NHL.TV/NHL.com...

The end of the error message says:

cause: Error: getaddrinfo EAI_AGAIN nhltv.nhl.com at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) { errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'nhltv.nhl.com' } } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

rseanhall commented 1 year ago

You have internet connectivity issues, it's not the app's fault.

chgoljc commented 11 months ago

I wanted to know if the above was solved. I am getting this same error (base) MacBook-Pro:~ lesliecervantes$ cd /Users/lesliecervantes/Desktop/nhl-tv-geeky-streams-master (base) MacBook-Pro:nhl-tv-geeky-streams-master lesliecervantes$ yarn start --startDate 2022-11-02 yarn run v1.22.19 $ ./node_modules/.bin/ts-node src/index.ts --startDate 2022-11-02 AxiosError: getaddrinfo ENOTFOUND statsapi.web.nhl.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { hostname: 'statsapi.web.nhl.com', syscall: 'getaddrinfo', code: 'ENOTFOUND', errno: -3008, config: { transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }, adapter: [Function: httpAdapter], transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: [Function] }, validateStatus: [Function: validateStatus], headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.27.2' }, baseURL: 'https://statsapi.web.nhl.com/api/v1', url: '/schedule', params: { startDate: '2022-11-01', endDate: '2022-11-01', expand: 'schedule.game.content.media.epg,schedule.teams,schedule.linescore' }, method: 'get', data: undefined }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,

},
_events: [Object: null prototype] {
  response: [Function: handleResponse],
  error: [Function: handleRequestError],
  socket: [Function: handleRequestSocket]
},
_eventsCount: 3,
_maxListeners: undefined,
_options: {
  maxRedirects: 21,
  maxBodyLength: 10485760,
  protocol: 'https:',
  path: '/api/v1/schedule?startDate=2022-11-01&endDate=2022-11-01&expand=schedule.game.content.media.epg,schedule.teams,schedule.linescore',
  method: 'GET',
  headers: [Object],
  agent: undefined,
  agents: [Object],
  auth: undefined,
  hostname: 'statsapi.web.nhl.com',
  port: null,
  nativeProtocols: [Object],
  pathname: '/api/v1/schedule',
  search: '?startDate=2022-11-01&endDate=2022-11-01&expand=schedule.game.content.media.epg,schedule.teams,schedule.linescore'
},
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
  _events: [Object: null prototype],
  _eventsCount: 7,
  _maxListeners: undefined,
  outputData: [],
  outputSize: 0,
  writable: true,
  destroyed: false,
  _last: true,
  chunkedEncoding: false,
  shouldKeepAlive: false,
  maxRequestsOnConnectionReached: false,
  _defaultKeepAlive: true,
  useChunkedEncodingByDefault: false,
  sendDate: false,
  _removedConnection: false,
  _removedContLen: false,
  _removedTE: false,
  strictContentLength: false,
  _contentLength: 0,
  _hasBody: true,
  _trailer: '',
  finished: true,
  _headerSent: true,
  _closed: false,
  socket: [TLSSocket],
  _header: 'GET /api/v1/schedule?startDate=2022-11-01&endDate=2022-11-01&expand=schedule.game.content.media.epg,schedule.teams,schedule.linescore HTTP/1.1\r\n' +
    'Accept: application/json, text/plain, */*\r\n' +
    'User-Agent: axios/0.27.2\r\n' +
    'Host: statsapi.web.nhl.com\r\n' +
    'Connection: close\r\n' +
    '\r\n',
  _keepAliveTimeout: 0,
  _onPendingData: [Function: nop],
  agent: [Agent],
  socketPath: undefined,
  method: 'GET',
  maxHeaderSize: undefined,
  insecureHTTPParser: undefined,
  joinDuplicateHeaders: undefined,
  path: '/api/v1/schedule?startDate=2022-11-01&endDate=2022-11-01&expand=schedule.game.content.media.epg,schedule.teams,schedule.linescore',
  _ended: false,
  res: null,
  aborted: false,
  timeoutCb: null,
  upgradeOrConnect: false,
  parser: null,
  maxHeadersCount: null,
  reusedSocket: false,
  host: 'statsapi.web.nhl.com',
  protocol: 'https:',
  _redirectable: [Circular *1],
  [Symbol(kCapture)]: false,
  [Symbol(kBytesWritten)]: 0,
  [Symbol(kEndCalled)]: true,
  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype],
  [Symbol(errored)]: null,
  [Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'https://statsapi.web.nhl.com/api/v1/schedule?startDate=2022-11-01&endDate=2022-11-01&expand=schedule.game.content.media.epg,schedule.teams,schedule.linescore',
[Symbol(kCapture)]: false

} } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

chgoljc commented 11 months ago

statsapi.web.nhl.com

This site can’t be reachedCheck if there is a typo in statsapi.web.nhl.com.

chgoljc commented 11 months ago

It now works this was the api I had to use: https://api-web.nhle.com/v1/schedule/2023-11-04

the difference is the date versus one on script on the site

rseanhall commented 11 months ago

@chgoljc Your issue is the same as https://github.com/kompot/nhl-tv-geeky-streams/issues/73. This is a different issue where the docker container couldn't reach any websites.

chgoljc commented 11 months ago

Thank you I was using both mthods yarn and docker. Finally got the yarn to work