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

Adjust parsing of channel page #113

Merged

Conversation

MarmadileManteater
Copy link
Contributor

@MarmadileManteater MarmadileManteater commented Nov 1, 2022

Adjust parsing of channel page to keep in line with YouTube layout updates

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

FreeTubeApp/FreeTube#2784

Description

The YT page that channel videos are extracted from has changed its layout, and this is causing parseChannelVideoResponse to not return any videos. Also, the community tab isn't always the 4th tab anymore, and this can cause errors. This PR aims to fix these things by updating the way that page is parsed.

Screenshots

before:

after:

Additional context

I assume this layout change was A-B tested because these issues occurred sporadically until recently.

Some users in the freetube matrix channel had discussed how they were able to change their backend preference to Invidious in order to solve this issue, but it seems that this issue is also effecting Invidious now (EX: https://invidious.namazso.eu/channel/UCXuqSBlHAE6Xw-yeJA0Tunw doesn't display any videos).

I ran the automated tests, and the only issue I ran into was with shorts missing their lengthSeconds. It doesn't seem like the reelItemRenderer displays the length of the video, so I am unsure what to do about this:

This should fix the error about not being able to read `contents`
that was being discussed in the matrix channel.

This is related to FreeTubeApp/FreeTube#2784.

I assume it was A-B tested because this error
occurred sporadically until this evening when
a switch was seemingly flipped.
@MarmadileManteater MarmadileManteater marked this pull request as draft November 1, 2022 06:59
auto-merge was automatically disabled November 1, 2022 06:59

Pull request was converted to draft

It seems there might still be some weirdness
going on.
I believe this is where "shorts" are now
@MarmadileManteater MarmadileManteater marked this pull request as ready for review November 1, 2022 08:00
app/helper.js Outdated Show resolved Hide resolved
Instead of finding it again

Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
@absidue
Copy link
Member

absidue commented Nov 1, 2022

Could you please fix the linting issues and take a look at the failing test?

auto-merge was automatically disabled November 1, 2022 12:42

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 1, 2022 12:43
@PrestonN
Copy link
Member

PrestonN commented Nov 1, 2022

I was notified that the one failing test is okay for this PR because that channel in particular doesn't have a videos tab any more due to the changes made to the site, so it should be okay to go ahead and merge this.

Thank you very much for the fix!

@PrestonN PrestonN disabled auto-merge November 1, 2022 14:15
@PrestonN PrestonN merged commit ef78148 into FreeTubeApp:development Nov 1, 2022
@MarmadileManteater
Copy link
Contributor Author

MarmadileManteater commented Nov 1, 2022

I actually had a fix for something I was about to push. It's okay. I can make another PR. The channelName and channelId moved inside of channel continuations, and it means that getChannelVideosMore throws.

@SJRouge91
Copy link

Hi there, could someone explain to me how to apply these fixes?? I just made an account to ask cause I'm having this same problem as well; it's the local API error that says "TypeError: cannot read properties of undefined (reading contents)" and no videos showing up when viewing a channel page, I'm using the portable version of Freetube, beta version 0.17.1, and local API/default settings on general settings. I apologize if this is the wrong place to post, but I'd really appreciate if someone could help.

@elesto
Copy link

elesto commented Nov 2, 2022

@SJRouge91

Hi there, could someone explain to me how to apply these fixes?? I just made an account to ask cause I'm having this same problem as well; it's the local API error that says "TypeError: cannot read properties of undefined (reading contents)" and no videos showing up when viewing a channel page, I'm using the portable version of Freetube, beta version 0.17.1, and local API/default settings on general settings. I apologize if this is the wrong place to post, but I'd really appreciate if someone could help.

wait for next update

@SJRouge91
Copy link

@SJRouge91

Hi there, could someone explain to me how to apply these fixes?? I just made an account to ask cause I'm having this same problem as well; it's the local API error that says "TypeError: cannot read properties of undefined (reading contents)" and no videos showing up when viewing a channel page, I'm using the portable version of Freetube, beta version 0.17.1, and local API/default settings on general settings. I apologize if this is the wrong place to post, but I'd really appreciate if someone could help.

wait for next update

Ok then thanks, I didn't know if an update was close to being released soon or not, would have used this workaround if I knew how to apply it.

@PikachuEXE
Copy link
Contributor

@SJRouge91
Or you can download latest nightly (use at your own risk) version at https://github.com/FreeTubeApp/FreeTube/actions/workflows/build.yml

Backup data before using it (I backup data on every new subscription made anyway)

@SJRouge91
Copy link

@SJRouge91 Or you can download latest nightly (use at your own risk) version at https://github.com/FreeTubeApp/FreeTube/actions/workflows/build.yml

Backup data before using it (I backup data on every new subscription made anyway)

I might just give that a try; I'm currently using the stable portable version of FT, so maybe I'll try installing the nightly exe version and see if that helps. Thanks. :)

@SJRouge91
Copy link

Oh wow, so I just finished installing the nightly beta 0.18.0 version, and the videos show up on the channels now! I'll probably just go ahead and use the beta version in the meantime. Thanks again for the rec to use the nightly one :) @PikachuEXE

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.

7 participants