Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Fix for channels with no secondary links #61

Merged
merged 5 commits into from
Mar 15, 2022

Conversation

SuperFurryCoder
Copy link
Contributor

I had a channel with only primary links, causing the error:

debug TypeError: Cannot read property 'map' of undefined
debug at Function.getChannelInfo (///node_modules/yt-channel-info/app/youtube-grabber.js:40:68)

The structure of 'links' at that point was:
{
primaryLinks: [ { navigationEndpoint: [Object], icon: [Object], title: [Object] } ]
}
rather than:
{
primaryLinks: [ { navigationEndpoint: [Object], icon: [Object], title: [Object] } ],
secondaryLinks: [ { navigationEndpoint: [Object], icon: [Object], title: [Object] } ]
}

Not sure if you need to create empty secondaryLinks array instead at that point, but this fix works fine for me.

@PrestonN PrestonN enabled auto-merge (squash) February 28, 2022 22:57
@ChunkyProgrammer
Copy link
Member

ChunkyProgrammer commented Feb 28, 2022

Empty secondaryLinks array is already created here
btw

secondaryLinks: []

This fix looks good to me. Thanks for taking the time to create a PR.

app/youtube-grabber.js Outdated Show resolved Hide resolved
@ChunkyProgrammer
Copy link
Member

They don't seem to be active on GitHub so i will commit the change

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
@PikachuEXE
Copy link
Contributor

@ChunkyProgrammer Ya but why remove the blank line, just removing the spaces is fine 😬

@ChunkyProgrammer
Copy link
Member

Idk i just did the "commit suggestion" feature on github

Copy link
Contributor

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I guess it's GH fault

@PrestonN PrestonN merged commit 243483f into FreeTubeApp:development Mar 15, 2022
ChunkyProgrammer added a commit to Kylof61034/yt-channel-info that referenced this pull request Mar 15, 2022
commit 243483f
Author: SuperFurryCoder <100633427+SuperFurryCoder@users.noreply.github.com>
Date:   Tue Mar 15 20:07:14 2022 +0000

    Fix for channels with no secondary links (FreeTubeApp#61)

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * remove unnecessary space

    Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

    Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
    Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

commit 3291db3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 13 14:02:57 2022 -0500

    Bump follow-redirects from 1.14.7 to 1.14.8 (FreeTubeApp#60)

    Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
    - [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
    - [Commits](follow-redirects/follow-redirects@v1.14.7...v1.14.8)

    ---
    updated-dependencies:
    - dependency-name: follow-redirects
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PrestonN pushed a commit that referenced this pull request Aug 24, 2022
* added typescript type definitions

* Update typescript declarations

* Add isOfficialArtist to channel object

* Use multi-line comments

Co-authored-by: Alexandra <bug.graph@gmail.com>

* remove playlist url from getChannelVideos

* Squashed commit of the following:

commit 243483f
Author: SuperFurryCoder <100633427+SuperFurryCoder@users.noreply.github.com>
Date:   Tue Mar 15 20:07:14 2022 +0000

    Fix for channels with no secondary links (#61)

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * Update youtube-grabber.js

    * remove unnecessary space

    Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

    Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
    Co-authored-by: PikachuEXE <pikachuexe@gmail.com>

commit 3291db3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Sun Feb 13 14:02:57 2022 -0500

    Bump follow-redirects from 1.14.7 to 1.14.8 (#60)

    Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
    - [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
    - [Commits](follow-redirects/follow-redirects@v1.14.7...v1.14.8)

    ---
    updated-dependencies:
    - dependency-name: follow-redirects
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add getChannelStats and getChannelHome

* fix HttpsProxyAgent reference

* include types file in "files"

Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
Co-authored-by: Alexandra <bug.graph@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants