Created
April 23, 2020 19:39
-
-
Save sometimesweremakemistakes/af34fbf187e125d1778b7287d9ec82cb to your computer and use it in GitHub Desktop.
Simple stream URL getter for loveradio.ru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const streamPatterns = [ | |
/stream.loveradio.ru:80\/[^">\s]+/g, | |
/stream2.n340.com:80\/[^">\s]+/g | |
] | |
http.get('http://www.loveradio.ru/player.htm', (response) => { | |
let data = '' | |
response.on('data', (chunk) => { | |
data += chunk | |
}) | |
response.on('end', () => { | |
streamPatterns.forEach((pattern) => { | |
let links = data.match(pattern) | |
if(!links) return | |
console.log(`Stream links:\n\n${links.join('\n\n')}`) | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment