Difference between revisions of "YouTube/Technical details"

From Archiveteam
Jump to navigation Jump to search
(→‎Playlists: Add alternative TLGG generation)
(→‎Playlists: More types, more details)
Line 24: Line 24:
! Pattern !! Purpose !! Status !! Examples !! Notes
! Pattern !! Purpose !! Status !! Examples !! Notes
|-
|-
| <code>AL[A-Za-z0-9_-]+</code> || || Broken || ||
| <code>AL[A-Za-z0-9_-]+</code> || Artist top tracks || Broken || [https://web.archive.org/web/20120831092547/http://www.youtube.com:80/playlist?list=AL94UKMTqg-9BtoHHLzycCLF-wvV_ST0Ih&] ||
|-
|-
| <code>AV[A-Za-z0-9_-]{32}</code> || || Broken || || IDs do not appear to be <code>PL</code> ones
| <code>AV[A-Za-z0-9_-]{32}</code> || Artist on <code>/artist?a=</code> || Broken || [https://web.archive.org/web/20120309232750/https://www.youtube.com/artist?a=GxdCwVVULXftjkN-p_QIMzXdCKPB-HqD&feature=playlist-comment] ||
|-
|-
| <code>CL&lt;videoID&gt;</code> || || || ||
| <code>BB[0-9]{8}</code> || Billboard top 20 || Unviewable, playnext broken, list param on watch page not functional but not removed by JS || [https://web.archive.org/web/20120504170738/http://www.youtube.com/playlist?list=BB20120505] || The ID is a date in <code>YYYYMMDD</code> format and refers to a Saturday. Known values range from 20110910 to 20121201.
|-
|-
| <code><nowiki>EC([0-9A-F]{16}|[A-Za-z0-9_-]{32})</nowiki></code> || Courses || Unviewable, playnext and watch functional || || IDs are also fully functional with <code>PL</code>
| <code>BLCM&lt;channelID&gt;</code> || || Broken || ||
|-
|-
| <code>EL&lt;videoID&gt;</code> || || || ||
| <code>CL&lt;videoID&gt;</code> || || Semi-broken || || In some cases, the playlist exists even though the video doesn't [https://www.youtube.com/playlist?list=CLuSOli2NxJmY]; for these, the list parameter also works on the watch page. In other cases, the playlist doesn't exist but the video does [https://www.youtube.com/playlist?list=CL2yzd6Rg4La0].
|-
|-
| <code>FL&lt;channelID&gt;</code> || Favourites || Fully functional || ||
| <code><nowiki>EC([0-9A-F]{16}|[A-Za-z0-9_-]{32})</nowiki></code> || Courses || Unviewable, playnext and watch functional || [https://www.youtube.com/playlist?list=EC00615559FE621D9B&playnext=1] || IDs are also fully functional with <code>PL</code>: [https://www.youtube.com/playlist?list=PL00615559FE621D9B]
|-
|-
| <code>HL[0-9]{10}</code> || || Unviewable, playnext broken || ||
| <code><nowiki>EL([A-Za-z0-9_-]{11}|[A-Za-z0-9_-]{22})</nowiki></code> || Movies & Shows || Broken || [https://web.archive.org/web/20201005211732/https://www.youtube.com/playlist?list=EL-j8hXkzEaYPcAIWdiNEPag&disable_polymer=1] || Some of the short IDs are video IDs, others are not. Even though the contents seem entirely unrelated (e.g. [https://web.archive.org/web/20201024024006/https://www.youtube.com/playlist?list=EL-fNI2W9J9t8&disable_polymer=1] vs [https://www.youtube.com/watch?v=-fNI2W9J9t8]), 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.
|-
|-
| <code>LE[A-Za-z0-9_-]{23}</code> || || || ||
| <code>FL&lt;channelID&gt;</code> || Favourites || Fully functional || [https://www.youtube.com/playlist?list=FLK8sQmJBp8GCxrOtXWBpyEA] ||
|-
| <code>HL[0-9]{10}</code> || || Unviewable, playnext broken || [https://web.archive.org/web/20131106013330/http://www.youtube.com/watch?v=U2-a80nzPAE&list=HL1371590912] [https://web.archive.org/web/20160916111948/http://www.youtube.com/watch?v=Q0gVRten4ss&list=HL1364024750] || Frequently associated with <code>feature=mh_lolz</code>. All WBM snapshots with this are either video pages or <code>/embed/videoseries</code>, and even the older snapshots provide no insight into this playlist type.
|-
| <code>LE&lt;channelID&gt;[APU]</code> || Live events || Broken || [https://web.archive.org/web/20121112140027/http://www.youtube.com/watch?v=rKjbt2wHbhM&list=LED7-53gvqiYTqPmz0EFCTqAP] || Frequently associated with <code>feature=plcp</code>
|-
|-
| <code>LL&lt;channelID&gt;</code> || Likes || Dead || || Made private in December 2019
| <code>LL&lt;channelID&gt;</code> || Likes || Dead || || Made private in December 2019
|-
|-
| <code>LP&lt;videoID&gt;</code> || || Broken || ||
| <code>LM</code> || || || ||
|-
| <code>LM&lt;channelID&gt;</code> || || Broken || ||
|-
| <code>LP&lt;videoID&gt;</code> || Auto-generated channels || Broken || [https://web.archive.org/web/20120831185200/http://www.youtube.com/playlist?list=LP4qRk91tndwg&feature=playlist-comment] [https://web.archive.org/web/20121208025243/https://www.youtube.com/playlist?list=LP-25gYsgSHAs&feature=playlist-comment] [https://web.archive.org/web/20120719164200/https://www.youtube.com/watch?v=DOoXhCyq1-s&list=LP-PgXFUOYEqE&index=1&feature=plcp] || It isn't always clear whether there is any relation between the two video IDs in the watch URL, e.g. [https://web.archive.org/web/20160624202428/http://www.youtube.com/watch?v=2kFbrjfPM_M&list=LP8mCexcOt47s&index=1&feature=plcp] (vs [https://www.youtube.com/watch?v=8mCexcOt47s]) or [https://web.archive.org/web/20121018174159/https://www.youtube.com/watch?v=bxaB85-qAnY&list=LPC_Omnjyzg0A&index=1&feature=plcp] (vs [https://www.youtube.com/watch?v=C_Omnjyzg0A])
|-
|-
| <code>MC[0-9]{8} || || || || Values appear to be dates
| <code>MC[0-9]{8} || || || || Values appear to be dates
Line 104: Line 112:
| <code>UL&lt;videoID&gt;</code> || 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 <code>UL</code> worked as well.
| <code>UL&lt;videoID&gt;</code> || 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 <code>UL</code> worked as well.
|-
|-
| <code>UU&lt;channelID&gt;</code> || User/channel uploads || Fully functional || ||
| <code>UU&lt;channelID&gt;</code> || User/channel uploads || Fully functional || [https://www.youtube.com/playlist?list=UUZM0q3tj_RstUAUM4ox3R3g] ||
|-
|-
| <code>UUSH&lt;channelID&gt;</code> || User shorts || Fully functional || ||
| <code>UUSH&lt;channelID&gt;</code> || User shorts || Fully functional || [https://www.youtube.com/playlist?list=UUSHK8sQmJBp8GCxrOtXWBpyEA] ||
|-
|-
| <code>WL</code> || Watch Later || || || Tied to the account accessing YouTube
| <code>WL</code> || Watch Later || || || Tied to the account accessing YouTube

Revision as of 14:02, 30 November 2021

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}[048AEIMQUYcgkosw]

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]
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
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} Values appear to be dates
MCUS
ML[A-Za-z0-9_-]{32} Broken IDs do not appear to be PL ones
OLAK5uy_[klmn][A-Za-z0-9_-]{32}
PL[0-9A-F]{16} Normal playlist (old) Fully functional
PL[A-Za-z0-9_-]{32} Normal playlist Fully functional
PU<channelID> Popular uploads Unviewable, playnext and watch functional
RD<videoID> Mix aka radio Unviewable, playnext and watch functional
RD[0-4][0-9]<videoID>
RDAMVM[A-Za-z0-9_-]{22} Artist mix?
RDAO[A-Za-z0-9_-]{22} Artist mix
RDAMPL<playlistID>
RDCLAK5uy_[klmn][A-Za-z0-9_-]{32}
RDCMUC<channelID> Channel mix
RDEM[A-Za-z0-9_-]{22} Artist mix?
RDGMEM[A-Za-z0-9_-]{22} Genre mix?
RDGMEM[A-Za-z0-9_-]{22}VM<videoID> Genre mix?
RDHC<videoID>
RDKM[A-Za-z0-9_-]{22}
RDLV<videoID>
RDMM My Mix Tied to the account accessing YouTube
RDMM<videoID>
RDQM<videoID>
RDTMAK5uy_[klmn][A-Za-z0-9_-]{32}
SL
SL<videoID> Broken
SP([0-9A-F]{16}|[A-Za-z0-9_-]{32}) Fully functional Behaves exactly as the same ID with PL
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 [22]
UUSH<channelID> User shorts Fully functional [23]
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)

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.