Skip to content

Instantly share code, notes, and snippets.

@b-ggs
Created April 14, 2018 18:32
Show Gist options
  • Save b-ggs/937445b86ae2fb2ef02faf2e806c4f15 to your computer and use it in GitHub Desktop.
Save b-ggs/937445b86ae2fb2ef02faf2e806c4f15 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# gem install yt -v 0.28.0
# echo YOUTUBE_API_KEY > token.txt
require 'yt'
Yt.configure do |config|
config.api_key = File.read('token.txt').chomp
end
channel = Yt::Channel.new id: 'UCjEh8dlo4GAiM49YpxruY8w'
file = File.open('songs.txt', 'w+')
channel.videos.each do |video|
next unless video.title.include?('TWITCH FAIL COMPILATION')
video = Yt::Models::Video.new(id: video.id)
video.description.split("\n").each do |line|
next unless line.downcase.include?('outro song')
song = line.gsub(/outro song:/i, '').strip
next if song == ''
puts song
file.puts(song)
end
end
file.close
# Output:
# https://www.youtube.com/watch?v=ZaMSNLWjMus
# https://www.youtube.com/watch?v=8t5_Kdl8-pQ
# https://www.youtube.com/watch?v=7_sJ7tFF9bw
# https://www.youtube.com/watch?v=BEbplQjDCjc
# https://www.youtube.com/watch?v=ftmoJkLNAOM
# https://www.youtube.com/watch?v=97ew6kWQDxU
# https://youtu.be/ov8Q1nNeKh4
# https://www.youtube.com/watch?v=_PtVL3dufdk
# https://www.youtube.com/watch?v=soQV04lXyGE
# https://www.youtube.com/watch?v=6_YDsCY7JhA
# https://www.youtube.com/watch?v=NAwhtwrn-N4
# https://www.youtube.com/watch?v=5M-lBOhYOMk
# https://www.youtube.com/watch?v=Iukuy1KOF_Y
# https://www.youtube.com/watch?v=SHrDdyg-9NE
# https://www.youtube.com/watch?v=JxR1edApBJw
# https://www.youtube.com/watch?v=E3WYLoXNczw
# https://www.youtube.com/watch?v=EvGAcilZXfU
# https://www.youtube.com/watch?v=Xo-rUF8o_v0
# https://www.youtube.com/watch?v=eNjkAUBTQaI
# https://youtu.be/SOBte-td854
# https://www.youtube.com/watch?v=-8oDawGEbUI
# https://www.youtube.com/watch?v=iCyd13w7fUk
# https://www.youtube.com/watch?v=2hS5Dv6KcgE
# https://www.youtube.com/watch?v=ltqznMg5IZc
# https://www.youtube.com/watch?v=CQ-yrHEEog8
# https://www.youtube.com/watch?v=opqkVXUHzaw
# https://www.youtube.com/watch?v=8z27DeDNT4Q
# https://www.youtube.com/watch?v=zIyJCf0Z1OU
# https://www.youtube.com/watch?v=0zbmZ1OjKwI
# https://www.youtube.com/watch?v=VSu-pX1oPMg
# https://www.youtube.com/watch?v=XF5fhfhoLYY
# https://www.youtube.com/watch?v=VVzo-1ttoIY
# https://www.youtube.com/watch?v=SplMj3dnPOA
# https://www.youtube.com/watch?v=e74DvZdxwHk
# https://www.youtube.com/watch?v=2g1RovKEIj8
# https://www.youtube.com/watch?v=yKoa-FY96LA&t
# https://www.youtube.com/watch?v=XWNizC2vF1Q
# Travis Thompson - Joyride
# Marvin Divine - Make A Way
# J-Wright - Blow Smoke
# Dubby of Team Loko - Kant Hang
# Jez Dior - Leather
# SOL - Cest La Vie
# Alex Jordahl - Wifey Now
# Cyrus - 200 On The Sweats
# Croosh - Pride
# Shelton Harris - Don't Tell Me
# Young Lungs - Northbound
# Young Lungs - Last Winter
# Bazanji - Real Now
# Bugus - Incredible
# Bugus - Don't Hit My Phone
# Ollie - Forever
# Arizona Zervas - Blvd
# Witt Lowry - Blood in The Water
# Bazanji - Good News
# Croosh - Only Time
# Hendersin - All Night
# Tobilla - What a night
# Nolan Santo - Bluffin
# Justin Stone - Do it
# E-dubble - Wait
# GAYBOICLIQUE - NASA
# Sydnee B - Blow It All
# Arizona Zervas - Dear God
# Alex Jordahl - Wifey Now
# Indy - Right Now
# Rowlan - Read Along
# Young Lungs - 97 Leo
# Croosh - Options
# Rowlan - Born Hustler
# J-Wright - Involved
# Chris Buxton - Swerve
# Jutes - Dont Mind
# Nate Good - Up For Whatever
# Justin Stone - Gone
# Cam Meekins - 324
# Sydnee D - Layin' Low
# Rowlan - Up Thinking
# Nolan Santo - You Heard Me
# Bugus - Proud Of Us
# Chime and Adam Tell - Whole
# No-Uh - I think
# Rowlan - Something Real
# John Kenza - Wicked
# Chris Buxton - Selena
# Justin Stone - Like This
# Justin Stone - Like This
# Young Lungs - Last Winter
# Driver - The Eye of Truth
# Tove Lo - Habits
# Future James - Life Could Be A Dream
# D.R.A.M. - Broccoli ( Party Remix )
# Oliver - New Year's Day
# Moe Shop - Natural
# San Holo - Light
# Vanic X K.Flay - Cant Sleep
# Chance The Rapper - Somewhere in Paradise
# Ollie - Roll With Me
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment