Skip to content

A JavaScript library to fetch free live TV stream URLs from CBC.ca / CBC News

License

Notifications You must be signed in to change notification settings

MarketingPipeline/CBC-News-Streams.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CBC-News-Streams.js

A JavaScript library for fetching free live IPTV stream URLs from CBC News
Show your support!

A pure JavaScript library for easily fetching free live stream urls (m3u format) for live TV channels from CBC.ca

Note: CBC content is geo-restricted to Canada 🇨🇦

Example and usage

How to fetch all channels
// CBC-News-Streams.js Example - get all channels. 
import {CBC_News_Streams} from 'https://cdn.jsdelivr.net/gh/MarketingPipeline/CBC-News-Streams.js@v1.0.0/dist/cbc-news-streams.min.js' 

try {
    console.log(await CBC_News_Streams().getAllChannels()) // returns a JSON array of objects.
} catch (error) {
    console.log(error.message)
}

This will return an array of all channel details & stream URLs.






How to fetch single channel
/// CBC-News-Streams.js Example - get single channel example.
import {CBC_News_Streams} from 'https://cdn.jsdelivr.net/gh/MarketingPipeline/CBC-News-Streams.js@v1.0.0/dist/cbc-news-streams.min.js' 

try {
    console.log(await CBC_News_Streams().getChannel("Toronto")) // returns a JSON object.
} catch (error) {
    console.log(error.message)
}

This will return a single JSON object with channel details + the stream URL.

Contributing GitHub

Want to improve this project? Create a pull request with detailed changes / improvements! If approved you will be added to the list of contributors of this awesome project!

See also the list of contributors who participate in this project.

License GitHub

This project is licensed under the MIT License - see the LICENSE file for details.