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

Youtube subscriptions fails if channel is deleted #14805

Open
1 task done
notaLonelyDay opened this issue Mar 16, 2024 · 0 comments
Open
1 task done

Youtube subscriptions fails if channel is deleted #14805

notaLonelyDay opened this issue Mar 16, 2024 · 0 comments
Labels
RSS bug Something isn't working

Comments

@notaLonelyDay
Copy link
Contributor

Routes

/youtube/subscriptions

Full routes

/youtube/subscriptions

Related documentation

https://docs.rsshub.app/routes/social-media#subscriptions

What is expected?

Expected list of subdcriptions

What is actually happening?

Error in /youtube/subscriptions: TypeError: Cannot read properties of undefined (reading '0')
image

I was subscribed to invalid channel, https://www.youtube.com/channel/UCIi2Tk2POJkRgWHD7HGBa7Q

request:
https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails&id=UCIi2Tk2POJkRgWHD7HGBa7Q&key=API_KEY

response in https://developers.google.com/oauthplayground:

{
  "kind": "youtube#channelListResponse", 
  "etag": "RuuXzTIr0OoDqI4S0RU6n4FqKEM", 
  "pageInfo": {
    "resultsPerPage": 5, 
    "totalResults": 0
  }
}

logs to find it:
image

response in app:

{
  config: {
    url: 'https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails&id=UCIi2Tk2POJkRgWHD7HGBa7Q&key=****',
    method: 'GET',
    userAgentDirectives: [ [Object] ],
    paramsSerializer: [Function (anonymous)],
    headers: {
      'x-goog-api-client': 'gdcl/7.0.1 gl-node/21.7.1',
      'Accept-Encoding': 'gzip',
      'User-Agent': 'google-api-nodejs-client/7.0.1 (gzip)'
    },
    params: {
      part: 'contentDetails',
      id: 'UCIi2Tk2POJkRgWHD7HGBa7Q',
      key: '****'
    },
    validateStatus: [Function (anonymous)],
    retry: true,
    responseType: 'unknown',
    errorRedactor: [Function: defaultErrorRedactor]
  },
  data: {
    kind: 'youtube#channelListResponse',
    etag: 'RuuXzTIr0OoDqI4S0RU6n4FqKEM',
    pageInfo: { totalResults: 0, resultsPerPage: 5 }
  },
  headers: {
    'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000',
    'cache-control': 'private',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-type': 'application/json; charset=UTF-8',
    date: 'Sat, 16 Mar 2024 00:43:28 GMT',
    server: 'scaffolding on HTTPServer2',
    'transfer-encoding': 'chunked',
    vary: 'Origin, X-Origin, Referer',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'SAMEORIGIN',
    'x-xss-protection': '0'
  },
  status: 200,
  statusText: 'OK',
  request: {
    responseURL: 'https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails&id=UCIi2Tk2POJkRgWHD7HGBa7Q&key=****'
  }

There are broken channels, that has no items, so they should be skipped here:
https://github.com/DIYgod/RSSHub/blob/master/lib/routes/youtube/subscriptions.ts#L59C160-L59C163

Deployment information

Self-hosted

Deployment information (for self-hosted)

docker-compose latest

Additional info

_

This is not a duplicated issue

  • I have searched existing issues to ensure this bug has not already been reported
@notaLonelyDay notaLonelyDay added the RSS bug Something isn't working label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant