YouTube Playlist – How to Get Complete Listing of All Videos

youtubeyoutube-channelyoutube-playlist

Here's a concrete example:

https://www.youtube.com/user/AmazonWebServices/videos

I estimate one would have to scroll that page for many hours before getting it to show all the videos in that collection.

I'm looking for a faster way to generate a two-column table consisting of the title and the url for all the videos in that collection.

As this example illustrates, strategies that involve scrolling are unacceptably slow for cases like this one.

(Solutions that involve the Unix command line and/or some scripting are acceptable, as long as the commands and/or source code are provided in the answer.)


EDIT: I apologize: I should have specified that my OS is Linux.

EDIT2: Here's what I ultimately did, based on the accepted answer (at the Unix shell prompt):

% youtube-dl --get-id --get-title https://www.youtube.com/user/AmazonWebServices/videos | \
     | perl -pe 's/^(?=\S{11}$)/\t/ || s/\r?\n\z//' > videos.tsv

The youtube-dl command above returns lines of titles alternating with video IDs. The perl one-liner, either inserts a tab or deletes the line-terminating sequence, as the case may be, resulting in the desired 2-column listing. (I'll probably tweak this a bit further to reverse the order of the columns, but this is an inessential detail.)

NB: Although the above procedure still takes a long time (mine has been running for about 15 minutes and has yielded ~1000 lines, but it's still going strong). Nonetheless, once one types the command above, the rest is pretty much "hands-free". It certainly beats manually scrolling through the page.

Best Answer

youtube-dl --get-id --get-title https://www.youtube.com/user/AmazonWebServices/videos > list.txt

  • run/execute BATCH.cmd by double-clicking
  • wait until cmd window closes (it can take even half an hour - depends on your internet speed)
  • when done you will get a non-coma-non-space separated bulk of text:

  • to get it formated open it in WordPad or MS Word

  • copy it and paste it into the spreadsheet column A - https://docs.ggl.com/spreadsheets/d/
  • where cell B1: =FILTER(A:A; ROW(A:A)=EVEN(ROW(A:A)))
  • and where cell C1: =FILTER(A:A; ROW(A:A)=ODD(ROW(A:A)))

  • and then on another sheet create your construct
  • cell A2: =IF(Sheet2!B1<>"";"https://www.youtube.com/watch?v="&Sheet2!B1;)
  • cell B2: =IF(Sheet2!C1<>""; Sheet2!C1;)