Old page
YouTube Links is a user script. You might want to
read this first: what is a user script?
Show video formats at the top of the watch page. Tag every video link so
that they can be downloaded easily.
The video links on the page are scanned in batches to avoid overloading
the network. This works out nicely because YouTube has a request flood
detector.
YouTube Features
On DASH videos (Adaptive Video Streaming)
YouTube now uses adaptive video streaming for 480p and 1080p videos (Oct
2013). What this means is that the video and audio streams are now separate.
They are indicated as M4V and M4A. They have to be
downloaded separately and mux'ed before playing. If using ffmpeg:
ffmpeg -i vid.m4v -i vid.m4a -vcodec copy -acodec copy vid.mp4
The filename is always videoplayback
. Before saving, select
and copy the page title first. Then right-click on the video link, save-as
and paste the title. Set the extension to either m4v
or
m4a
to distinguish between video and audio.
On VEVO videos
When a VEVO video is first accessed, the video links will not be shown
because the de-obfuscated code is gotten too late. You need to manually
refresh to see the links. This should happen just once — until YouTube
changes the de-obfuscated code again.
If the video links are still not shown, it could be because the new
de-obfuscated code is not recognized anymore. This happens once every few
months; it is a cat-and-mouse game. Post in the forum so that I know about
it. :lol:
On 60fps videos
YouTube now supports 60fps (Oct 2014). The 720p/1080p DASH videos have
itag 298/299 instead of 136/137. They can be downloaded as usual. However, I
have added HFR (High Frame Rate) to make it more obvious.
On 256kbps MP4 audio
Note: this is no longer available since 2016.
256kbps MP4 audio can now be downloaded! The link is only added for
the watch page because it requires an additional HTTP request.
Note that just because a file is encoded in 256kbps does not mean it is
really 256kbps. Check its spectrogram.
ffmpeg -i video.mp4 -vn audio.wav
sox audio.wav -n spectrogram
A real 256kbps audio file is not cut-off at 16kHz (128kbps) or 18kHz
(192kbps). Some 192kbps audio are upscaled too.
Settings
There are some high-level settings in the script. Search for var
userConfig = {
.
var userConfig = {
copyToClipboard: true,
filteredFormats: [],
keepFormats: [],
showVideoFormats: true,
showVideoSize: true,
tagLinks: true
};
Note: changes will be lost when the script is updated.
- copyToClipboard: copy filename to clipboard by clicking the video info tag
-
Added in v2.
Possible values: true / false
Default: false for Edge browser, else true
Edge browser honours the download attribute for
cross-origin resource and prompts to download with the correct filename.
Other browsers play the video instead.
The 720p/MP4 tag is exempted as clicking it will download the video.
- filteredFormats: filter out listed formats
-
Added in v1.71.
Possible values: 3GP, FLV, M4A, M4V, MP4, WEBM, ...
Default: none
To filter out WEBM videos, set it to [ "WEBM" ]
.
- keepFormats: always show these formats
-
Added in v1.94.
Possible values: 3GP, FLV, M4A, M4V, MP4, WEBM, ...
Default: none
To always show 3GP videos, set it to [ "3GP" ]
.
- showVideoFormats: show video formats at the top of the watch page
-
Added in v1.50, "btn" in v1.62.
Possible values: true / false / "btn"
Default: true
Set to false if you do not want the video formats.
The value "btn"
(with the quotes) will show a VidFmts
button at the top of the page. Click on the button to show the video
formats.
- showVideoSize: show video size
-
Added in v1.62.
Possible values: true / false
Default: true
Set to false if you do not want the video size. It will reduce network traffic slightly.
- tagLinks: tag all video links
-
Added in v1.00, "label" in v2.
Possible values: true / false / "label"
Default: true
Set to false if you do not want to tag the video links. It will reduce network traffic.
If set to "label"
, click on the tag to open pop-up menu.
User settings
From v2, settings can be changed without editing the script. There is
still no UI.
Steps:
- Go to any YouTube page
- Press F12 to open Development Tools
- Select Console tab
Set settings in this format:
localStorage["ujsYtLinks.cfg.<setting>"] = <value>
Examples:
localStorage["ujsYtLinks.cfg.tagLinks"] = false
localStorage["ujsYtLinks.cfg.showVideoFormats"] = "'btn'"
localStorage["ujsYtLinks.cfg.keepFormats"] = "[ '3GP' ]"
Delete the setting to get back the original behavior:
localStorage.removeItem("ujsYtLinks.cfg.<setting>")
Example:
localStorage.removeItem("ujsYtLinks.cfg.tagLinks")
Origin
YouTube Links greatly resembles YouTube HD Suite in both looks and functionality. I had
been using it for a long time and like how it worked. I especially like the
video link tagging; I could tell at a glance if a video was HD or not.
Nowadays, almost every video is at least 720p.
When the script broke after YouTube changed its page format on 3rd August
2011, I decided to learn how it works and write my own from scratch. The
first version was uploaded to userscripts.org on 12th Aug 2011.
Known Issues
- v2.06
-
None
Others
Check for update does not work in Firefox (since FF 29).
Changelog
- v2.06 (Apr 2019)
- * Update sig detection (sig-90)
- v2.05 (Feb 2019)
- + Add AV1 format
- v2.04 (Jan 2019)
- * Update sig detection (sig-87)
- v2.03 (Nov 2018)
- * Skip updating stale links on rapid page change
- * Update sig detection (regex causing YT to hang!)
- v2.02 (Oct 2018)
- # Bugfix: show payment-needed videos as n/a. (Previously JavaScript error)
- v2.01 (Sep 2018)
- * Add file extension when saving on Edge browser
- # Bugfix (v2): Able to save 720f/u720p/w720p MP4 video directly by clicking
- # Bugfix (1.96): [Material Design] Update video tags in search results
- v2 (Sep 2018)
- + Support Material Design dark theme
- + Support persistent user settings
- + Copy filename to clipboard by clicking the video info tag
- + Video tag: indicate wide video, show framerate if HFR
- + Add config option to open video tag pop-up menu on click (tagLinks "label")
- + Work on Greasemonkey 4
- * Label 5K, 6K videos
- * Show Live streams correctly; they cannot be downloaded
- * Show err for missing DASH streams
- # Bugfix (1.96): [Material Design] Show VidFmts btn
- # Bugfix (1.96): [Material Design] Fix double tag on playlists
- # Bugfix (1.62): Show video res properly, including portrait-mode videos
- # Bugfix (1.62): In VidFmts mode, hide top video links when changing video
- # Bugfix: Handle video title with & and " on Edge browser
- v1.96 (Sep 2018)
- + Support 2017 Material Design.
- * Update sig detection.
- * Show 3K for 1728p.
- # Bugfix (1.95): Restore page-change/dangling pop-up functionality. (JavaScript error on startup)
- v1.95 (May 2017)
- + Support Material Design (hackish).
- v1.94 (Feb 2017)
- + Add config option keepFormats.
- v1.93 (Jun 2016)
- * Update sig detection (sig-81).
- v1.92 (Apr 2016)
- + Add @connect for Tampermonkey.
- * Show "Opus" audio format.
- v1.91 (Apr 2015)
- * Update VEVO sig detection 3.
- v1.90 (Apr 2015)
- # Bugfix (1.40): Remove dangling header in non-watch pages.
- # Bugfix (1.10): Fix dangling pop-up on missed mouseout event.
- v1.88 (Apr 2015)
- * Update VEVO sig detection 2.
- v1.87 (Apr 2015)
- * Update VEVO sig detection.
- v1.86 (Apr 2015)
- * Add VP9/VOR format.
- v1.85 (Apr 2015)
- * Label 8K videos.
- v1.84 (Apr 2015)
- + Set download filename. Does not work in Firefox.
- v1.83 (Apr 2015)
- # Bugfix (1.32): Detect 4:3 AR properly.
- v1.82 (Nov 2014)
- # Fix VEVO videos on TamperMonkey.
- v1.81 (Nov 2014)
- * Update VEVO sig detection.
- v1.80 (Nov 2014)
- * Change HFR criteria to >45fps.
- + Tag video links in HTML 5 player video wall.
- + Add >=1080p videos from DASH manifest.
- + Remove <96kbps audio if there is at least one above.
- * Use SI units for file size (10^3 instead of 2^10).
- # Bugfix (1.62): calculate aspect ratio of portrait-mode videos correctly.
- # Bugfix (1.40): show bitrate properly (kbps instead of kB/s).
- # Bugfix (1.00): avoid running unnecessarily in iframe.
- v1.71 (Nov 2014)
- + Add HFR (High Frame Rate) if >30fps.
- * Rename 1.5k to 2K and 2k to 4K.
- + Able to filter formats.
- v1.70 (Oct 2014)
- + Add 256kbps M4A.
- v1.64 (Oct 2014)
- # Fix event handling on Firefox; broken after FF 29. Hovering and VidFmts btn now work.
- + Use video size from page if available. (Reduce network traffic)
- * Remove 144v/240v videos completely if 720p/1080p are present to eliminate unnecessary querying. (Reduce network traffic)
- v1.63 (Oct 2014)
- + Change link to Greasy Fork.
- # Fix video thumbnail text; broken after YouTube update.
- * Improve support for obfuscated-sig videos; broken after YouTube update.
- + Hide 144v and 240v if 720p/1080p are present.
- * Check for update every 5 days (not tested on Greasy Fork).
- v1.62 (Mar 2014)
Taken directly from http://userscripts-mirror.org/scripts/show/110007.html.
- * Use vertical res to map video res (eg ?x720 -> 720p). DASH videos have many odd-ball resolutions.
- * Map itags 80-82, 100-102 to 3D.
- + Add config option to not get video size.
- + Add config option to show VidFmts btn.
- v1.61 (Feb 2014)
- * Improved support for obfuscated-sig videos.
- v1.60 (Feb 2014)
- + Support obfuscated-sig videos.
- v1.50 (Jan 2014)
- + Add config option to not scan the formats for the current video.
- + Get video info only for links in the viewport. (Reduce network traffic)
- + Mark non-video <a> links so that they will be ignored. (Less overhead)
- * Removed special handling for Channel page.
- * Fail on DRM videos right away.
- # Bugfix (1.00): use page protocol (HTTP/HTTPS) to check for update.
- # Bugfix (1.00): fix scroll event handling.
- # Bugfix (1.00): don't add 'position: relative' if the parent node is already absolute/relative.
- v1.43 (Dec 2013)
- # Don't show video link on buttons.
- * Map 480x360 to 360f.
- v1.42 (Dec 2013)
- # Don't show video link on Prev, Next and 'Play All' buttons.
- * Fail on obfuscated-sig videos right away.
- v1.41 (Dec 2013)
- + Snap to standard resolutions. Some adaptive video streams have odd-ball resolutions.
- v1.40 (Dec 2013)
- + Show adaptive video streams (notably 480p and 1080p).
- + Reload the links when the user changes video; YouTube now reuses the same page.
- # Make it work on Chrome 27+.
- v1.36 (Jul 2013)
- * Support 87-sig videos.
- * Show error if unable to get file size.
- v1.35 (Jul 2013)
- * Support 85-sig videos.
- # Bugfix (1.23): check for update broken. Finally detected and fixed!
- v1.34 (Jul 2013)
- * Support 90/92-sig videos.
- v1.33 (Jul 2013)
- * Show "NA" for not-avail videos.
- + Support 81/83-sig VEVO videos; broken after YouTube update.
- v1.32 (Jan 2013)
- # Fix channel video; broken after YouTube update.
- * Move video links above the video again; shifted after YouTube update.
- + Group video links by video res.
- * Shortened video res (1280x720 -> 720p).
- * Handles 1.5k video res.
- v1.31 (Jan 2013)
- # Fix filename; broken after YouTube update.
- v1.30 (Oct 2012)
- + Show file size on Firefox and Chrome.
- v1.23 (Oct 2012)
- # Show available update on Chrome.
- # Bugfix (1.22): forgot to change version from 1.21 to 1.22!
- # Bugfix (1.00): check for update does not work in Chrome! Sort of fixed. However, Chrome 21 onwards does not allow direct installation of userscripts.
- v1.22 (Sep 2012)
- # Add signature to video link, or YouTube will reject it.
- * Show '3GP' instead of '?'.
- v1.21 (Sep 2011)
- # Bugfix (1.20): new version changes is shown as "undefined" if not present.
- # Bugfix (1.20): video formats tooltip is positioned wrongly in Chrome if page is scrolled.
- v1.20 (Aug 2011)
- + Show video formats for the current video in the user's channel.
- * Implement list of video formats when hover over a video link as a tooltip.
- + Show the new version's changes as tooltip in the update notification.
- * Slow down scanning for video links.
- # Bugfix (1.10): the list of video formats when hover over a video link may be clipped, depending on the page layout.
- # Bugfix (1.10): the list of video formats when hover over a video link may wrap in the user's channel page.
- v1.10 (Aug 2011)
- + Show all video formats when hover over the video links.
- v1.01 (Aug 2011)
- * Map : to - and " to ' instead of _ in filename.
- # Bugfix (1.00): font color is incorrect in playlists. This is because the page's CSS has higher specificity.
- # Bugfix (1.00): new video links on the page are not tagged if they are loaded via Ajax.
- # Bugfix (1.00): new version is displayed incorrectly — 1.01 will be shown as 1.0!
- # Bugfix (1.00): encoded HTML entities & and " are not handled properly in titles.
- # Bugfix (1.00): URL to update script is specified wrongly — 1.0 users will not see the update!
- v1.00 (Aug 2011)
First version.