A web extension for Chrome & Firefox that calculates & displays the total duration of a YouTube playlist.

The extension is available for download at:
[!NOTE]
The sorting feature is only enabled for playlists containing 100 videos or less. This is because for larger playlists (>100 videos), YouTube only loads the next 100 videos after you scroll to the bottom of the page. This can often produce inconsistent & inaccurate sorting results, so it has been disabled for now.
If YouTube changes its DOM structure in a way that none of the extension’s strategies can recognize, the extension displays a red-bordered diagnostic indicator inside the playlist summary panel. This indicator includes:
?ytpdc-debug=true.)To help diagnose issues before they appear as failures, open the playlist page
with ?ytpdc-debug=true appended to the URL. The extension will log detailed
strategy information to the browser console.
The extension uses a layered strategy system to survive YouTube DOM changes:
Strategies are prioritized by the detected variant: the strategy most likely to succeed runs first. If it finds everything needed, no further strategies are executed.
This section will explain how to get the project setup locally for development.
To work with this project, you will need the following dependencies:
This project is hosted at: https://github.com/nrednav/youtube-playlist-duration-calculator
You can clone the project locally via:
HTTPS:
git clone https://github.com/nrednav/youtube-playlist-duration-calculator.git
SSH:
git clone git@github.com:nrednav/youtube-playlist-duration-calculator.git
To install the project’s dependencies:
cd youtube-playlist-duration-calculator/
npm install
Build the extension for a specific browser using:
npm run build:chrome
npm run build:firefox
This will output the extension files into a sub-directory named dist within
the youtube-playlist-duration-calculator directory.
Run the project in development mode with:
npm run dev
This will do the following:
VITE_TARGET_BROWSER
To install & run the extension manually, follow these steps:
Firefox:
npm run build:firefoxweb-ext tool from Mozilla
web-ext run from within dist/ directory
web-ext sign
dist directory too.xpi file generated within a sub-directory
named web-ext-artifactsabout:addons via the address barInstall Add-on From File.xpi file generated in a previous stepChrome:
npm run build:chromechrome://extensions via the address barDeveloper ModeLoad Unpacked Extensiondist sub-directory within the
youtube-playlist-duration-calculator directoryTo verify the extension works, visit any YouTube playlist overview page & verify that you see the duration calculated & displayed within the playlist information panel located on the left-hand side of the page.
If you wish to request a new feature or report a bug, please open an issue by clicking here. Note that the “Report this issue” link in the extension’s failure banner points to a no-account Google Form instead, for users who do not have a GitHub account.
For a list of locales currently supported by the extension, please see public/_locales
Additional translations are most welcome! Please see docs/translations.md for more details.
If you found this extension helpful and would like to help support its development: