Repository navigation
[ReadingTime] Do not estimate a reading time for YouTube videos - #580
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
YouTube feeds do not provide the duration of their videos, only their description. The reading time estimated from that description, usually "<1 m", says nothing about how long it takes to watch the video and is misleading next to the reading times of the other articles. As agreed in the issue, no reading time is shown any longer for articles linking to a YouTube video (youtube.com/watch, /shorts/ and /live/, on www., m., music. or no subdomain, and youtu.be). The link is read from the `data-link` attribute of the article, with a fallback to the link of its title for FreshRSS versions older than 1.28. The cell of the reading time is kept empty, so that the columns of the list of articles stay aligned. Document it in the README, and bump the extension to 1.7.0. Fixes FreshRSS#35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
YouTube feeds do not provide the duration of their videos, only their description, so ReadingTime showed a meaningless estimate for them (usually
<1 m). As suggested in the issue, the extension now simply ignores YouTube videos.Changes:
youtube.com/watch,/shorts/and/live/(onwww.,m.,music.or no subdomain) andyoutu.bedata-linkattribute of the article, with a fallback to the link of its title for FreshRSS versions older than 1.28 (which do not havedata-link)Other articles, including YouTube links that are not videos (e.g. a channel page), are unchanged.
Fixes #35
Validation
Ran the old and new
readingtime.jsin jsdom on a page mimicking the normal view (300 words per minute, words metric):https://www.youtube.com/watch?v=…<1 mhttps://www.youtube.com/shorts/…<1 mhttps://youtu.be/…<1 mhttps://m.youtube.com/watch?v=…<1 mhttps://youtube.com/live/…<1 mhttps://www.youtube.com/watch?v=…withoutdata-link(FreshRSS < 1.28)<1 mhttps://example.net/post(900 words)3 m3 mhttps://example.net/youtube.com/watch?v=x<1 m<1 mhttps://www.youtube.com/channel/…(600 words)2 m2 mhttps://notyoutube.com/watch?v=…(600 words)2 m2 mEvery article still gets exactly one reading time cell, and
freshrss:load-moredoes not add duplicates.eslintandmarkdownlintpass.