Skip to content

Instantly share code, notes, and snippets.

@rtanglao
Last active November 25, 2025 16:59
Show Gist options
  • Select an option

  • Save rtanglao/ac2c2a2abc8bad09a252bf45abd1bd9e to your computer and use it in GitHub Desktop.

Select an option

Save rtanglao/ac2c2a2abc8bad09a252bf45abd1bd9e to your computer and use it in GitHub Desktop.
get cfmu podcasts :-) super hackey dev house :-)

roland@Rolands-MacBook-Pro /tmp % ./getfilenames.rb

Starting retrieval for IDs 5000 to 5090...

  • ID 5000: Command failed with error:
  • ID 5001: Command failed with error:
  • ID 5002: Command failed with error:
  • ID 5003: Filename is 'The Frequency- The Brief (News)+-+[[00002025_11_06_14_00_00]].mp3'
  • ID 5004: Filename is 'Breakfast of Champions+-+[[00002025_11_06_15_00_00]].mp3'
  • ID 5005: Filename is 'String Theory+-+[[00002025_11_06_17_00_00]].mp3'
  • ID 5006: Filename is 'Get Lit+-+[[00002025_11_06_17_30_00]].mp3'
  • ID 5007: Filename is 'CinemaScope+-+[[00002025_11_06_18_00_00]].mp3'
  • ID 5008: Filename is 'Classical Today+-+[[00002025_11_06_19_00_00]].mp3'
  • ID 5009: Filename is 'Music Duo+-+[[00002025_11_06_21_00_00]].mp3'
  • ID 5010: Filename is 'Inside the Music+-+[[00002025_11_06_22_00_00]].mp3'
  • ID 5011: Filename is 'Because Design Matters+-+[[00002025_11_06_23_00_00]].mp3'
  • ID 5012: Filename is 'Weird Hour+-+[[00002025_11_07_01_00_00]].mp3'
  • ID 5013: Filename is 'In Tha Kut+-+[[00002025_11_07_02_00_00]].mp3'
  • ID 5014: Filename is 'Places+-+[[00002025_11_07_03_30_00]].mp3'
  • ID 5015: Filename is 'Midnight Crisis+-+[[00002025_11_07_05_00_00]].mp3'
  • ID 5016: Filename is 'Tito!+-+[[00002025_11_07_06_00_00]].mp3'
  • ID 5017: Filename is 'thisisundergroundradio+-+[[00002025_11_07_07_00_00]].mp3'
  • ID 5018: Filename is 'Have A Nice Weekend+-+[[00002025_11_07_13_00_00]].mp3'
  • ID 5019: Filename is 'The Frequency- Morningfile (Talk)+-+[[00002025_11_07_14_00_00]].mp3'
  • ID 5020: Filename is 'The Waiting Room+-+[[00002025_11_07_15_00_00]].mp3'
  • ID 5021: Filename is 'Exploring Mind &amp Body+-+[[00002025_11_07_17_00_00]].mp3'
  • ID 5022: Filename is 'The Coolest Journey+-+[[00002025_11_07_17_30_00]].mp3'
  • ID 5023: Filename is 'Come Sunday+-+[[00002025_11_07_18_00_00]].mp3'
  • ID 5024: Filename is 'SciSection+-+[[00002025_11_07_18_30_00]].mp3'
  • ID 5025: Filename is 'I Heart Hamilton+-+[[00002025_11_07_19_00_00]].mp3'
  • ID 5026: Filename is 'Office Hours- Unplugged+-+[[00002025_11_07_20_00_00]].mp3'
  • ID 5027: Filename is 'indie in the city+-+[[00002025_11_07_20_30_00]].mp3'
  • ID 5028: Filename is 'ALieNNatioN+-+[[00002025_11_07_21_00_00]].mp3'
  • ID 5029: Filename is 'Tracking Impact+-+[[00002025_11_07_22_00_00]].mp3'
  • ID 5030: Filename is 'The Radio Show+-+[[00002025_11_07_23_00_00]].mp3'
  • ID 5031: Filename is 'Mac Jazz Ain&#8217t Dead+-+[[00002025_11_08_00_00_00]].mp3'
  • ID 5032: Filename is 'Hostile Airwaves+-+[[00002025_11_08_01_00_00]].mp3'
  • ID 5033: Filename is 'Hostile After Hours+-+[[00002025_11_08_03_00_00]].mp3'
  • ID 5034: Filename is 'Around Town+-+[[00002025_11_08_05_00_00]].mp3'
  • ID 5035: Filename is 'thisisundergroundradio+-+[[00002025_11_08_06_00_00]].mp3'
  • ID 5036: Filename is 'hidden hits+-+[[00002025_11_08_12_00_00]].mp3'
  • ID 5037: Filename is 'Weekend Wake Up+-+[[00002025_11_08_13_00_00]].mp3'
  • ID 5038: Filename is 'Freewheelin&#8217 Spotlight Show+-+[[00002025_11_08_14_30_00]].mp3'
  • ID 5039: Filename is 'Freewheelin&#8217 Folk Show+-+[[00002025_11_08_15_00_00]].mp3'
  • ID 5040: Filename is 'Speaking of Music+-+[[00002025_11_08_18_00_00]].mp3'
  • ID 5041: Filename is 'Declutter+-+[[00002025_11_08_18_30_00]].mp3'
  • ID 5042: Filename is 'Almost Famous Radio Show+-+[[00002025_11_08_19_30_00]].mp3'
  • ID 5043: Filename is 'Alternative Hour+-+[[00002025_11_08_20_30_00]].mp3'
  • ID 5044: Filename is 'Behind the Musician+-+[[00002025_11_08_21_30_00]].mp3'
  • ID 5045: Filename is 'The Switch+-+[[00002025_11_08_22_30_00]].mp3'
  • ID 5046: Filename is 'Leave Luck To Us+-+[[00002025_11_09_00_00_00]].mp3'
  • ID 5047: Filename is 'The Next Exit+-+[[00002025_11_09_00_30_00]].mp3'
  • ID 5048: Filename is 'LND x TWR+-+[[00002025_11_09_02_00_00]].mp3'
  • ID 5049: Filename is 'Zilla Radio+-+[[00002025_11_09_03_30_00]].mp3'
  • ID 5050: Command failed with error:
  • ID 5051: Filename is 'Weekly Mosaic+-+[[00002025_11_09_13_00_00]].mp3'
  • ID 5052: Filename is 'Hora da JOY+-+[[00002025_11_09_14_00_00]].mp3'
  • ID 5053: Filename is 'Armenian Radio Hour+-+[[00002025_11_09_15_00_00]].mp3'
  • ID 5054: Filename is 'La Vita e&#8217 Bella+-+[[00002025_11_09_16_00_00]].mp3'
  • ID 5055: Filename is 'Reel Roots+-+[[00002025_11_09_17_00_00]].mp3'
  • ID 5056: Filename is 'Contemporary Arabic+-+[[00002025_11_09_18_00_00]].mp3'
  • ID 5057: Filename is 'McMaster Film Production Club+-+[[00002025_11_09_19_00_00]].mp3'
  • ID 5058: Filename is 'Alexander the Great+-+[[00002025_11_09_20_00_00]].mp3'
  • ID 5059: Filename is 'Twoje Radio+-+[[00002025_11_09_21_00_00]].mp3'
  • ID 5060: Filename is 'Chords of Croatia+-+[[00002025_11_09_22_00_00]].mp3'
  • ID 5061: Filename is 'Centre Stage with Lyla Miklos+-+[[00002025_11_09_23_00_00]].mp3'
  • ID 5062: Filename is 'Lyrically Sound+-+[[00002025_11_10_00_00_00]].mp3'
  • ID 5063: Filename is 'Brick in the Wall+-+[[00002025_11_10_01_00_00]].mp3'
  • ID 5064: Filename is 'No Hope No Fear+-+[[00002025_11_10_02_00_00]].mp3'
  • ID 5065: Filename is 'Sounds from the Korean Underground+-+[[00002025_11_10_03_00_00]].mp3'
  • ID 5066: Filename is 'Octopus Army+-+[[00002025_11_10_04_00_00]].mp3'
  • ID 5067: Filename is 'Niche Album Nights+-+[[00002025_11_10_05_00_00]].mp3'
  • ID 5068: Filename is 'All You Need To Know+-+[[00002025_11_10_06_00_00]].mp3'
  • ID 5069: Filename is 'Sunday Overnights+-+[[00002025_11_10_06_30_00]].mp3'
  • ID 5070: Filename is 'Tune Love Bot+-+[[00002025_11_10_13_00_00]].mp3'
  • ID 5071: Filename is 'The Frequency- The Huddle (Sports)+-+[[00002025_11_10_14_00_00]].mp3'
  • ID 5072: Filename is 'Surtaal Radio+-+[[00002025_11_10_15_00_00]].mp3'
  • ID 5073: Filename is 'Off Main Street+-+[[00002025_11_10_17_00_00]].mp3'
  • ID 5074: Filename is 'Georgia On Your Mind+-+[[00002025_11_10_18_00_00]].mp3'
  • ID 5075: Command failed with error:
  • ID 5076: Filename is 'Peacemaker&#8217s Journey+-+[[00002025_11_10_20_00_00]].mp3'
  • ID 5077: Filename is '43% Noise+-+[[00002025_11_10_20_30_00]].mp3'
  • ID 5078: Filename is 'The Attic+-+[[00002025_11_10_21_30_00]].mp3'
  • ID 5079: Filename is 'The Science of Hope+-+[[00002025_11_10_22_30_00]].mp3'
  • ID 5080: Filename is 'Dusted Off+-+[[00002025_11_10_23_00_00]].mp3'
  • ID 5081: Filename is 'Furniture Music+-+[[00002025_11_11_00_00_00]].mp3'
  • ID 5082: Command failed with error:
  • ID 5083: Filename is 'Collective Rhythm Network+-+[[00002025_11_11_02_00_00]].mp3'
  • ID 5084: Command failed with error:
  • ID 5085: Command failed with error:
  • ID 5086: Command failed with error:
  • ID 5087: Command failed with error:
  • ID 5088: Command failed with error:
  • ID 5089: Filename is '933 CFMU+-+[[00002025_11_14_18_30_00]].mp3'
  • ID 5090: Command failed with error:

Script finished. roland@Rolands-MacBook-Pro /tmp % curl -sLJO --write-out "%{filename_effective}" -o /dev/null "http://player2.cfmu.ca/server/json.server.php?action=stream&type=song&auth=396df0b20de3f5888d900bb4a9562344&id=5084"

Nightbird+-+[[00002025_11_11_05_00_00]].mp3% roland@Rolands-MacBook-Pro /tmp % curl -sLJO --write-out "%{filename_effective}" -o /dev/null "http://player2.cfmu.ca/server/json.server.php?action=stream&type=song&auth=396df0b20de3f5888d900bb4a9562344&id=5085"

The Local Food Movement+-+[[00002025_11_11_13_30_00]].mp3% roland@Rolands-MacBook-Pro /tmp % curl -sLJO --write-out "%{filename_effective}" -o /dev/null "http://player2.cfmu.ca/server/json.server.php?action=stream&type=song&auth=396df0b20de3f5888d900bb4a9562344&id=5086" <- 5086

The Frequency- Morningfile (Talk)+-+[[00002025_11_11_14_00_00]].mp3%

  • LOOKS LIKE THE PRECEDING, 5086, IS THE LAST SHOW ON NOVEMBER 11, 2025

roland@Rolands-MacBook-Pro /tmp % curl -sLJO --write-out "%{filename_effective}" -o /dev/null "http://player2.cfmu.ca/server/json.server.php?action=stream&type=song&auth=396df0b20de3f5888d900bb4a9562344&id=5087" <-- 5087

  • LOOKS LIKE THE FOLLOWING, 5087, GOES OVER TO NOVEMBER 14, 2025
  • LOOKS LIKE NOVEMBER 12 AND 13 SHOWS ARE MISSING

Test Show Title+-+[[00002025_11_14_18_30_00]].mp3%

#!/usr/bin/env ruby
require 'open3'
# Define the range of IDs
start_id = 5000
end_id = 5090
puts "Starting retrieval for IDs #{start_id} to #{end_id}..."
# Iterate through the ID range
(start_id..end_id).each do |id|
sleep(10)
url = "http://player2.cfmu.ca/server/json.server.php?action=stream&type=song&auth=396df0b20de3f5888d900bb4a9562344&id=#{id}"
# Construct the curl command using the multi-argument form of Open3.capture2
# This avoids shell injection issues and handles quoting properly.
command = ["curl", "-sLJO", "--write-out", "%{filename_effective}", "-o", "/dev/null", url]
# Execute the command and capture the standard output (stdout)
stdout, stderr, status = Open3.capture3(*command)
if status.success?
# Strip any leading/trailing whitespace and print the filename
filename = stdout.strip
puts "ID #{id}: Filename is '#{filename}'"
else
puts "ID #{id}: Command failed with error: #{stderr.strip}"
end
end
puts "Script finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment