YouTube/Technical details

From Archiveteam
Jump to navigation Jump to search

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.)

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_-]+ Artist top tracks Broken [1]
AV[A-Za-z0-9_-]{32} Artist on /artist?a= Broken [2] 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 [3] The ID is a date in YYYYMMDD format and refers to a Saturday. Known values range from 20110910 to 20121201.
BLCM<channelID> Broken
CL<videoID> Semi-broken In some cases, the playlist exists even though the video doesn't [4]; for these, the list parameter also works on the watch page. In other cases, the playlist doesn't exist but the video does [5].
EC([0-9A-F]{16}|[A-Za-z0-9_-]{32}) Courses Unviewable, playnext and watch functional [6] IDs are also fully functional with PL: [7]
EL([A-Za-z0-9_-]{11}|[A-Za-z0-9_-]{22}) Movies & Shows Broken [8] Some of the short IDs are video IDs, others are not. Even though the contents seem entirely unrelated (e.g. [9] vs [10]), it's highly unlikely that these are random collisions since there are quite a lot of them. The longer IDs do not appear to be channel IDs.
FL<channelID> Favourites Fully functional [11]
HL[0-9]{10} Unviewable, playnext broken [12] [13] 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 [14] Frequently associated with feature=plcp
LL<channelID> Likes Dead Made private in December 2019
LM Liked music[2]
LM<channelID> Broken
LP<videoID> Auto-generated channels Broken [15] [16] [17] It isn't always clear whether there is any relation between the two video IDs in the watch URL, e.g. [18] (vs [19]) or [20] (vs [21])
MC([0-9]{8})? Music Charts Broken [22] [23] 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 [24] [25] [26] <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 [27] Same ID as AV
MLCA<channelID> Broken There is no known direct example of this on YouTube, only via RDAMPL on YouTube Music: [28]
OLAK5uy_[klmn][A-Za-z0-9_-]{32} Albums Fully functional [29]
PL[0-9A-F]{16} Normal playlist (old) Fully functional [30]
PL[A-Za-z0-9_-]{32} Normal playlist Fully functional [31]
PU<channelID> Popular uploads Unviewable, playnext and watch functional [32]
RD<videoID> Mix aka radio Unviewable, playnext and watch functional [33]
RD[0-4][0-9]<videoID> Mix Broken [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] 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 ([61] [62]).
RDAMVM[A-Za-z0-9_-]{22} Mix Unviewable, playnext and watch functional [63] [64]
RDAMPL<playlistID>
RDAO[A-Za-z0-9_-]{22} Artist mix Unviewable, playnext and watch functional [65] [[66]
RDCLAK5uy_[klmn][A-Za-z0-9_-]{32} Music Fully functional [67] Extensively used on https://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ aka https://www.youtube.com/music
RDCMUC<channelID> Channel mix Unviewable, playnext and watch functional [68]
RDEM[A-Za-z0-9_-]{22} Artist mix? Unviewable, playnext and watch functional [69]
RDGMEM[A-Za-z0-9_-]{22} Genre mix? Unviewable, playnext broken, watch functional [70]
RDGMEM[A-Za-z0-9_-]{22}VM<videoID> Genre mix? Unviewable, playnext and watch functional [71] [72]
RDHC<videoID> Artist mix? Broken [73]
RDKM[A-Za-z0-9_-]{22} Mix Unviewable, playnext and watch functional [74] [75]
RDLV<videoID> Mix Unviewable, playnext broken, watch functional [76]
RDMM My Mix Tied to the account accessing YouTube
RDMM<videoID> My Mix Unviewable, playnext and watch functional [77] [78]
RDQM<videoID> Mix Unviewable, playnext and watch functional [79] [80] Works even if the target video is unavailable as in the example.
RDTMAK5uy_[klmn][A-Za-z0-9_-]{32} YouTube Music (music.youtube.com) only?
SL Season (TV series?) Broken [81]
SL<videoID> Season (TV series?) Broken [82]
SP([0-9A-F]{16}|[A-Za-z0-9_-]{32}) Fully functional [83] [84] Behaves exactly as the same ID with PL and already did so in 2012 (see example). Original purpose/distinction from PL unknown.
TLGG[A-Za-z0-9_-]{22} Temporary list Produced by https://www.youtube.com/watch_videos?video_ids=<videoID>,<videoID>,... and https://www.youtube-nocookie.com/embed/<videoID>?playlist=<videoID>,<videoID>,...
TLPQ[A-Za-z0-9_-]{22}
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 [85]
UUSH<channelID> User shorts Fully functional [86]
WL Watch Later Tied to the account accessing YouTube

Further prefixes that are known or suspected to have existed but whose exact format isn't known yet: BP, MLCA, MQ, TT

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 2021:

  • www.youtube.com (main site)
  • m.youtube.com (mobile site)
  • youtu.be (short URLs)
  • www.youtube-nocookie.com (embeds only)
  • 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.

  1. https://stackoverflow.com/questions/35731554/every-youtube-video-has-two-links[IAWcite.todayMemWeb] (Note that the details in the analysis are incorrect as it uses the ASCII value of k; in the base64 alphabet, it decodes to 0b100100.)
  2. https://old.reddit.com/r/youtube/comments/9qw4sg/youtube_liked_music_playlist/[IAWcite.todayMemWeb]