Skip to content

Instantly share code, notes, and snippets.

@mtfurlan
Created May 27, 2020 02:38
Show Gist options
  • Save mtfurlan/80dc5b5956b5f69a20485e990b3069e9 to your computer and use it in GitHub Desktop.
Save mtfurlan/80dc5b5956b5f69a20485e990b3069e9 to your computer and use it in GitHub Desktop.
parse google takeout youtube watch history to list of channels with number of videos
tidy ./Takeout/YouTube\ and\ YouTube\ Music/history/watch-history.html 2>/dev/null | perl -ne '$_ = $_ . <> if /youtube\.com\/channel[^<]*(?!<\/a><br>)$/m; if( /youtube.com\/channel\/[a-zA-Z0-9]*">([^<]*)/) {$data = $1; $data =~ s/\n/ /g; print "$data\n";} ' | sort | uniq -c | sort -bnr | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment