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

fix: empty related videos when able to choose the topic of related videos #853

Merged
merged 4 commits into from Jan 10, 2021
Merged

fix: empty related videos when able to choose the topic of related videos #853

merged 4 commits into from Jan 10, 2021

Conversation

skick1234
Copy link
Contributor

@skick1234 skick1234 commented Jan 3, 2021

image

Fix empty related videos when the watch page contains autoplay feature

It happens in some regions or when using cookies.

closes #810
closes #848

@skick1234
Copy link
Contributor Author

info.nextVideo = info.related_videos[0] can close #848 too. But I think it's not neccesary.

Copy link
Owner

@fent fent left a comment

Choose a reason for hiding this comment

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

hi, thanks for another PR

how did you generate the watch.html page with autoplay on? is that something that can be turned by a cookie or user setting? i'd like to add it to test/files/refresh.js in case it needs to be updated in the future

test/info-extras-test.js Outdated Show resolved Hide resolved
@skick1234
Copy link
Contributor Author

skick1234 commented Jan 5, 2021

Actually, this is not because the autoplay feature is on.

When I logged in, related videos can be sort (e.g. All, Cats, Recently Uploaded). This makes related videos empty.

My autoplay json file
image
image

I tried to remove all the account-login cookies (keep PREF, ... cookies) but I cannot reproduce that. Maybe this is a user-only feature or a beta feature, idk.

regular json file
image
image

EDIT: This is Up Next Topics feature I think
https://twitter.com/TeamYouTube/status/1255929536618921985

@skick1234 skick1234 changed the title fix: empty related videos when autoplay is on fix: empty related videos when able to choose the topic of related videos Jan 5, 2021
@skick1234 skick1234 requested a review from fent January 5, 2021 13:12
@fent
Copy link
Owner

fent commented Jan 6, 2021

hmm, so the saved html and json pages can't be added to refresh.js since the new format won't be on there? are the json screenshots from requests in your browser?

@skick1234
Copy link
Contributor Author

hmm, so the saved html and json pages can't be added to refresh.js since the new format won't be on there?

I'm afraid that can't be done without an user cookie.

are the json screenshots from requests in your browser?

I logged from miniget response with my clone's cookie.

Copy link
Contributor Author

@skick1234 skick1234 left a comment

Choose a reason for hiding this comment

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

Reviewed

Copy link
Owner

@fent fent left a comment

Choose a reason for hiding this comment

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

i still think related-topics should be added to refresh.js, only for future maintenance. just add a note that it needs a requestOptions: { headers: 'YOUR_COOKIE' }.

btw, the watch.html file contains possibly identifying values from the account you used, things like ID_TOKEN and INNERTUBE_API_TOKEN. i'm actually not sure how compromising these are, but could be worth removing them if you have concerns. or maybe you used a throwaway account and it doesn't matter

@skick1234
Copy link
Contributor Author

I used my clone account to run refresh.js.

Maybe we should add a cookie to environment variables. Or just update it manually :>

@skick1234 skick1234 requested a review from fent January 10, 2021 06:54
Copy link
Owner

@fent fent left a comment

Choose a reason for hiding this comment

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

thank you!

@fent fent merged commit 6a9ca4f into fent:master Jan 10, 2021
@github-actions
Copy link

🎉 This PR is included in version 4.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new feature: next video
2 participants