YouTube/Technical details
This page documents some of the publicly known technical details of YouTube.
ID formats
In most places, IDs are expressed as base64 using the modified character set A-Za-z0-9-_
.
Videos
Videos have a 64-bit ID. Because an 11-character base64 string is equivalent to 66 bit, the last character of a video ID can only take one of 16 values.
Video ID regex pattern: [A-Za-z0-9_-]{10}[AEIMQUYcgkosw048]
In the past, YouTube also accepted requests with video IDs that had their last character mangled.[1] For example, an ID ending in A
could also be requested with B
, C
, or D
instead, and likewise for the other characters (the final one being 9
, -
, or _
instead of 8
). This stopped working sometime between 2020-01-07 and 2020-08-16, and now YouTube only accepts requests where the last two bits of the base64 ID are zero.
Channels
Channels have a 128-bit ID. In base64, this turns into a 22-character string where the last character can take 4 values.
Channel ID regex pattern: [A-Za-z0-9_-]{21}[AQgw]
(Note that this does not include the UC
prefix used e.g. in /channel/
URLs. The channel ID appears without that prefix in several places, most notably some playlist IDs.)
Additionally, all channels created before approximately 2012-03-14[2] and some channels created between approximately 2012-03-14 and approximately 2014-11-24[3] have usernames associated with them. These usernames are permanently associated with the channels and cannot be changed or removed from them[4]. They are accessed by using /user/
URLs. If a username has not been claimed as a custom URL, the root URL matching that username will redirect to the channel associated with that username. For example: youtube.com/apple
redirects to youtube.com/user/Apple
.
The username system has since been replaced with a custom URL system. These custom URLs are case and diacritic insensitive and can always be accessed from the root URL matching that custom URL as well as under /c/
. (Note that these URL patterns were different until approximately 2017-05-31 as /c/
URLs used to be associated with Google+ while root URLs were only associated with YouTube[5].) These URLs are not permanently associated with a channel and can be changed[6].
Username and custom URLs can be resolved to UCIDs by using a youtubei endpoint instead of downloading the full channel page by using a script like this one.
Playlists
Over the years, there has been a large number of playlist types, many of which have since gone the way of the dodo. This section attempts to document them all.
In the table below, pattern is a regex with the additional syntax of <videoID>
to indicate that the ID contains a video ID (and likewise for channel and playlist IDs).
Pattern | Purpose | Status | Examples | Notes |
---|---|---|---|---|
AL[A-Za-z0-9_-]{32} |
Artist playlist (Top tracks, albums) | Broken | [1] [2] | All known IDs for 'Top tracks' start with 94UKMTqg-9[A-D]|HTd1VmZQRN[o-r]|YL4kY05133[o-r]|zxNYRMVOCR[g-j] and for 'Albums' with GLx1orRGw4[U-X]|Nb4maWNoT6[Q-T]
|
AV[A-Za-z0-9_-]{32} |
Artist on /artist?a= (AV = 'Artist Videos') |
Broken | [3] | All known IDs start with 4oVf-d_DwK[A-D]|AYMcY2vx8G[Q-T]|GxdCwVVULX[c-f]|TGnpyrBl25[w-z]|acdYuOj0G3[s-v]|osme4KCrHq[o-r] , with the G one being by far the most common.
|
BB[0-9]{8} |
Billboard top 20 | Unviewable, playnext broken, list param on watch page not functional but not removed by JS | [4] | The ID is a date in YYYYMMDD format and refers to a Saturday. Known values range from 20110910 to 20121201.
|
BLCM<channelID> |
Channel Mix | Fully functional | [5] | The title is "Latest <Channel name>" while the description is always "Recent videos from this channel, updated weekly". These only work for logged in users. |
BLEM[A-Za-z0-9_-]{22} |
Weekly Topic Mix | Fully functional | [6] | The title is "<Topic> weekly" and the description is "Topical videos, selected for you and updated weekly". These only work for logged in users. |
CL([A-Za-z0-9_-]{11}|[A-Za-z0-9_-]{22}) |
Season clips/previews | Fully functional | [7] [8] | In some cases, the playlist exists even though the video doesn't [9]; for these, the list parameter also works on the watch page. In other cases, the playlist doesn't exist but the video does [10]. |
EC([0-9A-F]{16}|[A-Za-z0-9_-]{32}) |
Courses | Unviewable, playnext and watch functional | [11] | IDs are also fully functional with PL : [12]
|
EL([A-Za-z0-9_-]{11}|[A-Za-z0-9_-]{22}) |
Season episodes | Fully functional | [13] [14] | Some of the short IDs are video IDs, others are not. Even though the contents seem entirely unrelated (e.g. [15] vs [16]), it's highly unlikely that these are random collisions since there are quite a lot of them. The longer IDs are unique season playlist IDs (not to be confused with the season IDs seen on the /show/ pages). Both short and long IDs can usually be used for CL playlists.
|
FL<channelID> |
Favourites | Fully functional | [17] | |
HL[0-9]{10} |
Unviewable, playnext broken | [18] [19] | Frequently associated with feature=mh_lolz . All WBM snapshots with this are either video pages or /embed/videoseries , and even the older snapshots provide no insight into this playlist type.
| |
LE<channelID>[APU] |
Live events | Broken | [20] | Frequently associated with feature=plcp
|
LL<channelID> |
Likes | Private | Made private in December 2019, also accessible via LL when logged in.
| |
LM |
Liked music | Private | [21] | Tied to the account accessing YouTube. |
LM<channelID> |
Broken | |||
LP<videoID> |
Auto-generated channels | Broken | [22] [23] [24] | It isn't always clear whether there is any relation between the two video IDs in the watch URL, e.g. [25] (vs [26]) or [27] (vs [28]) |
MC([0-9]{8})? |
Music Charts | Broken | [29] [30] | Daily/weekly global top 100 songs. Dates are Tuesdays, known range is 20110621 to 20110816. |
MC<CC>(\.[0-9]{8}(\.[0-9]+)?)? |
Music Charts | Broken | [31] [32] [33] | <CC> is a country code; known values are AT, CH, DE, RU, and US. Dates are Tuesdays, known range 20110906 to 20140617. The final digits are a genre ID.
|
ML |
||||
ML[A-Za-z0-9_-]{32} |
Artist mix | Broken | [34] | Same ID as AV
|
MLCA<channelID> |
Library artist mix | Unviewable, playnext and watch functional | [35] | Tied to the account accessing YouTube. The channel should be added to the music library via Youtube Music. |
MLCT |
Library tracks | Unviewable, playnext and watch functional | [36] | Tied to the account accessing YouTube. The playlist includes all the tracks added to your Youtube Music library. |
OLAK5uy_[klmn][A-Za-z0-9_-]{32} |
Albums | Fully functional | [37] | |
PL[0-9A-F]{16} |
Normal playlist (old) | Fully functional | [38] | |
PL[A-Za-z0-9_-]{32} |
Normal playlist | Fully functional | [39] | The 32-character ID consists of a 10-character channel-specific unique ID which is common for all the playlists on a channel and a 22-character playlist-specific ID. Thus, the full playlist ID can be represented as PL[A-Za-z0-9_-]{10}[A-Za-z0-9_-]{22}. It is possible that all the other playlist types IDs which use 32 characters have a similar structure. |
PPSV |
Mobile downloads, offline videos | Tied to the account accessing YouTube; 'Private Playlist Saved Videos'? | ||
PU<channelID> |
Popular uploads | Unviewable, playnext and watch functional | [40] | |
RD<videoID> |
Mix aka radio | Unviewable, playnext and watch functional | [41] | |
RD[0-4][0-9]<videoID> |
Mix | Broken | [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] | By far the most common prefix among known URLs is RD02 . All other confirmed values are listed in the examples, but given the apparent existence of links around the web, it is likely that more existed. They were discontinued in early July 2014 ([69] [70]).
|
RDAMVM<videoID> |
Mix | Unviewable, playnext and watch functional | [71] [72] | |
RDAMPL<playlistID> |
||||
RDAO[A-Za-z0-9_-]{22} |
Artist shuffle mix | Unviewable, playnext and watch functional | [73] [[74] | Same ID as RDEM
|
RDCLAK5uy_[klmn][A-Za-z0-9_-]{32} |
Compilation | Fully functional | [75] | Extensively used on https://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ aka https://www.youtube.com/music |
RDCMUC<channelID> |
Channel radio mix | Unviewable, playnext and watch functional | [76] | Similar to BLCM |
RDEM[A-Za-z0-9_-]{22} |
Artist/genre mix | Unviewable, playnext and watch functional | [77] | Same ID as BLEM
|
RDGMEM[A-Za-z0-9_-]{22} |
Genre/mood mix | Unviewable, playnext broken, watch functional | [78] | Can use the same ID as RDEM
|
RDGMEM[A-Za-z0-9_-]{22}VM<videoID> |
Genre/mood mix | Unviewable, playnext and watch functional | [79] [80] | This type behaves like an RDEM and RD hybrid |
RDHC<videoID> |
Artist mix? | Broken | [81] | |
RDKM[A-Za-z0-9_-]{22} |
Topic Radio Mix | Unviewable, playnext and watch functional | [82] [83] | Same ID as RDEM
|
RDLV<videoID> |
Mix | Unviewable, playnext broken, watch functional | [84] | |
RDMM |
My Mix | Tied to the account accessing YouTube | ||
RDMM<videoID> |
My Mix | Unviewable, playnext and watch functional | [85] [86] | |
RDQM<videoID> |
Video Mix | Unviewable, playnext and watch functional | [87] [88] | Works even if the target video is unavailable as in the example. |
RDSH |
Shorts Mix? | |||
RDTMAK5uy_[klmn][A-Za-z0-9_-]{32} |
Tailor-made mix | Fully functional | [89] | Requires authentication |
RDVM<videoID> |
Video Mix | Unviewable, playnext and watch functional | [90] [91] | |
RLTD<channelID> |
Stories (Reel?) | Unviewable, playnext broken | [92] | |
SL |
Season (TV series?) | Broken | [93] | |
SL<videoID> |
Season (TV series?) | Broken | [94] | |
SP([0-9A-F]{16}|[A-Za-z0-9_-]{32}) |
Series playlist | Fully functional | [95] [96] [97] | Behaves exactly as the same ID with PL and already did so in 2012 (see example).
|
TL[A-Za-z0-9_-]{11} |
Broken | [98] [99] [100] | Details unclear, possibly also temporary: [101] [102], [103] [104] | |
TL[A-Za-z0-9_-]{22} |
'Templist' | [105] [106] [107] [108] | ||
TL[A-Za-z0-9_-]{32} |
[109] [110] [111] [112] | |||
TLGC[A-Za-z0-9_-]{22} |
[113] [114] | When decoded, the last eight characters are a date in DDMMYYYY format. However, the timezone is unclear; TLGC1QbHtr1DxEMxNDEwMjAxNg turns out as 15102016 , even though the list clearly existed at 2016-10-14 13:27 UTC.
| ||
TLGG[A-Za-z0-9_-]{22} |
Temporary list | Fully functional | [115] [116] | Produced by https://www.youtube.com/watch_videos?video_ids=<videoID>,<videoID>,... and https://www.youtube-nocookie.com/embed/<videoID>?playlist=<videoID>,<videoID>,... . When the full ID (including the prefix) is decoded, the last eight characters are the date of the list's creation in DDMMYYYY format. Lists appear to expire after two days.
|
TLPP[A-Za-z0-9_-]{22} |
Temporary list | Also produced by /watch_videos (example: [117] → [118]), most likely dependent on one of the query parameters.
| ||
TLPP[A-Za-z0-9_-]{30} |
[119] [120] | |||
TLPP[A-Za-z0-9_-]{54} |
UNCONFIRMED. No known working example. The oldest snapshots with such IDs in the Wayback Machine ([121] [122]) do not show a playlist. However, there are 117 unique such URLs in the WBM as of 2021-12-07, so this is unlikely that this is just random noise. When decoded, the last eight characters appear to be a date in DDMMYYYY format.
| |||
TLPQ[A-Za-z0-9_-]{22} |
Queue | Private | Created when a video is added to the queue | |
UL<videoID> |
User uploads | Watch functional | Only valid on watch pages. Triggers display of uploads by the same user as the watched video. The ID in the list parameter must be a valid video ID from any channel; in the past, any 11 characters were accepted, and even further in the past, a sole UL worked as well.
| |
UU<channelID> |
User/channel uploads | Fully functional | [123] | |
UULV<channelID> |
User livestreams | Fully functional | [124] | |
UUMO<channelID> |
User Uploads Members Only | Fully functional | [125] | |
UUSH<channelID> |
User shorts | Fully functional | [126] | |
WL |
Watch Later | Private | Tied to the account accessing YouTube | |
WL([0-9A-F]{16}|[A-Za-z0-9_-]{32}) |
User's Watch Later | Broken | [127] | WL list of a channel, but actually internally a normal PL playlist as evidenced by the profile page corresponding to the example: [128]. Later, these started to redirect to /my_watch_later_videos instead: [129]. No working example is known for the 32-char version; the oldest known snapshots in the WBM are from late 2012 and already don't display a playlist: [130] [131].
|
WL<channelID> |
User's Watch Later | Broken | No known direct example, but there are plenty of URLs in the WBM that were captured after this was discontinued that contain valid channel IDs, e.g. [132]. |
Further prefixes that have been claimed elsewhere to have existed but whose details aren't known yet: BP
('Branded Playlist'), MQ
, QL
('Quicklist'), SV
('Station'), LRYR
('2022 recap' for music, private for each user), TT
, MLPT
URL formats
A large number of URL formats have been in use over the years, too many to be listed here. User:JustAnotherArchivist's youtube-extract script contain regex patterns for most of the ones that were at least somewhat common.
Domains
Domains actively serving content as of 2022:
- www.youtube.com (main site)
- m.youtube.com (mobile site)
- youtu.be (short URLs)
- www.youtube-nocookie.com (embeds only)
- gaming.youtube.com (video game-centric videos)
- music.youtube.com (YouTube Music)
- www.youtubekids.com (YouTube Kids)
- tv.youtube.com (YouTube TV)
- i.ytimg.com (static images like thumbnails; avatars are on subdomains of ggpht.com as they are shared between Google services)
- subdomains of googlevideo.com (video content)
- studio.youtube.com (the place where creators upload their videos and manage their channels, also has an instance of youtubei)
- youtube.googleapis.com (can load embeds with titles and thumbnails but doesn't actually support playback anymore)
- youtubei.googleapis.com (primarily hosts youtubei for mobile apps)
- www.googleapis.com/youtube/v3/* (official public, rate-limited data API)
A long time ago, there were YouTube domains under a number of ccTLDs. Nowadays, these all redirect to the main site: youtube.at, by, ca, co.uk, cz, de, dk, ee, es, fi, fr, gr, hr, hu, it, lt, lv, no, pl, pt, ro, rs, ru, se, si, sk.
In addition, there are some subdomains under youtube.com which redirect to the main site but add the gl
parameter to the query string, which changes the interface language: br.youtube.com and likewise for es, it, jp, pl, ru, uk.
Format codes
Technically, most video and audio formats that YouTube serves are in are separated video and audio files that are merged together on the user end, meaning by the web browser or application which plays back or downloads a video. The list of formats can be obtained using yt-dlp -F [video ID or URL]
(inherited from youtube-dl
). Each of the formats is preceded by a format code that can be specified after the -f
parameters.
The only format codes which contained both video and audio tracks in the same file used to be 37, 22 and 18. Format code 37 served videos in 1080p if the uploaded video was at least in that resolution, format code 22 served videos in 720p, and format code 18 serves videos in 360p, and they were in the H.264 format and with an AAC audio track and up to 30 frames per second.
In YouTube's early days of 1080p playback support around 2009 and 2010, it was common practice to add &fmt=37
at the end of the URL to force a video in 1080p to be played in that resolution. This format had long since disappeared though (approximately around 2015) and as a result, there are very few YouTube videos archived by the Wayback Machine that are available in 1080p. Here's a rare example of one.
In mid-2024, YouTube got rid of format code 22. Given that the Wayback Machine mainly used format code 22 to archive YouTube videos in 720p (see the itag=22
in the googlevideo.com URLs) especially following the removal of code 37 in circa 2015, it has only been archiving YouTube videos in up to 360p since the removal of format code 22. If you believe a video is worth preserving in a quality beyond 360p, you are recommended to download it in your preferred resolution.
Format codes 22 and 18 serve(d) high frame rate videos (50 or 60 frames per second) with 25 or 30 frames per second respectively, to maintain compatibility.
Date indicator
The date indicated under a video is either the date a video was uploaded or the date the visibility was changed to "public" for the first time.
If a video is in draft stage or private or unlisted without ever having been public, the date indicated is the upload date. The exact moment has not been examined yet, but it is likely the moment the video finishes processing.
If the visibility is changed to "public" for the first time, the date will be set to the current date and the ability to run a premiere (two-minute countdown) is removed for that individual video. If a public video is changed back to unlisted or private, the indicated date will remain at the first publication date.
As this video by YouTube explains, a video set to "public" for the first time is treated as a new video.
Age restriction
For many years, bypassing the age restriction on YouTube videos used to be as simple as editing the URL.[7] Of course, tools for downloading YouTube videos used to make use of the embedding feature, but since September 2020, YouTube no longer allows embedding age-restricted videos.[8]
Since mid-2024, it is no longer possible to access age-restricted YouTube videos at all without logging into a Google account with an adult birth date. Until then, YouTube downloading tools bypassed this limitation through alternative interfaces. However, in 2024, YouTube closed all methods of accessing age-restricted videos without requiring a Google account with an adult birth date.[9][10]
Other resources
References
- ↑ https://stackoverflow.com/questions/35731554/every-youtube-video-has-two-links[IA•Wcite•.today•MemWeb] (Note that the details in the analysis are incorrect as it uses the ASCII value of
k
; in the base64 alphabet, it decodes to0b100100
.) - ↑ https://blog.youtube/news-and-events/seeing-familiar-faces-on-youtube/[IA•Wcite•.today•MemWeb]
- ↑ https://blog.youtube/news-and-events/want-your-url-to-match-your-channel/[IA•Wcite•.today•MemWeb]
- ↑ https://support.google.com/youtube/answer/6180214[IA•Wcite•.today•MemWeb]
- ↑ https://blog.youtube/news-and-events/improving-custom-urls-on-youtube/[IA•Wcite•.today•MemWeb]
- ↑ https://support.google.com/youtube/answer/2657968[IA•Wcite•.today•MemWeb]
- ↑ How To Watch 18+ Year Old/Blocked Videos On YOUTUBE! - adrianisen (2010-11-25)
- ↑ Age-restricted YouTube videos will no longer play when embedded on third-party sites - 9to5google (2020-09-22)
- ↑ Is There a way to effectively download age restricted videos from youtube in 2024? jdownloader is not working - Reddit (2021-10-21)
- ↑ [ie/youtube] Remove broken age-restriction workaround (#11297) · yt-dlp/yt-dlp@ec2f4bf · GitHub