Greasy Fork is available in English.

Youtube: expand description and long comments; show all the replies

Video description, long comments and list of subscriptions are expanded automatically; all the replies are shown after pressing "Show more replies" button

< Feedback op Youtube: expand description and long comments; show all the replies

Recensie: Goed - het script werkt zoals het hoort

§
Geplaatst: 02-08-2023

seems like it's not working?

max44Maker
§
Geplaatst: 02-08-2023

Working for me, but not working for you because your account got an amended UI, I suppose. Unfortunately, I can fix it only when Youtube desides to apply new UI to my account too.

§
Geplaatst: 02-08-2023

Sorry, I didn't explain clearly. It seems that only the YouTube description expansion is not working properly.

max44Maker
§
Geplaatst: 02-08-2023

Cannot reproduce it. Could you please give me a link to any video where description expansion is not working properly?

§
Geplaatst: 03-08-2023

I recorded a video and uploaded it to YouTube:
https://youtu.be/eJ5RAJ7_Gck

In the video, you can see that the YouTube description doesn't expand, but the comments can correctly expand in their entirety. (Without installing a script, it is not possible to expand all the comments.)

max44Maker
§
Geplaatst: 03-08-2023

I see. My 1st guess was that maybe the language is the reason, but I tried many languages and the script still works. Now I have to check the compatability with other scripts installed in your browser.

P.S. Thank you for the script "Restore Youtube Username", because yt-handles are totally unreadable

§
Geplaatst: 03-08-2023

I changed the YouTube language setting to English and disabled all other scripts, and the situation remains the same.

max44Maker
§
Geplaatst: 03-08-2023

Oh, so the only reason I can imagine is the amended UI.

§
Geplaatst: 07-08-2023

I think I have identified the problem.

In this line:
btnClick = $("div#description ytd-text-inline-expander tp-yt-paper-button#expand[role='button']:not([hidden=''])");

after that,
btnClick.length will be equal to 0

so the .click() event won't be triggered.


I added this part by myself:

var button = document.querySelector('yt-interaction[id="description-interaction"]');
if (button != null) {
button.click();
}

And it worked fine.
Could you take a look for reference?

max44Maker
§
Geplaatst: 08-08-2023

It's a great idea, thank you. I did not hit on this solution. It works for me too, so I replaced my code by yours.

Please check the new version.

§
Geplaatst: 08-08-2023

thanks

Reactie plaatsen

Log in om antwoord te geven.