 welcome now we all know that we can easily you know do a search online and find live news streams such as this one from ABC and again I'm not I'm not promoting any particular news site here I'm just I just did a Google search and I grabbed the first one but let's say I want to stream the live stream using MPV that's my media player of choice it will avoid ads like this and right now I'm running incognito mode to make sure my ad blockers off so that you know you don't get stumped by this if you don't have an ad blocker but I'm gonna do here is I'm going to get a URL that I can stream with MPV so what I'm gonna do is I'm gonna open up my developers console by hitting either F12 and this is in Chrome a control shift high and you should be able to do something similar in Firefox or pretty much any web browser once you do that we're gonna go to the network tab click on media and refresh this page refresh the page make sure we get all the links now media will probably not work in the case of a live stream but it's a good place to start because a lot of times if you're playing a video on a website you can get the URL for the video by clicking on the media here and then finding it there because media will limit the output here to things that are just audio and video but since we're not getting anything we're gonna click all here and again we'll refresh the page just to make sure I guess it needs a refresh rate but just be safe refresh the page and here we're getting list of all stuff what we want to do is we want to narrow it down most time you're gonna have an M3U8 file so just type in M3U and that will give you a list of files here that are playlist but right now the video hasn't started yet that was just an ad so all those M3Us were actually for this ad here we're gonna wait and once the video starts playing we'll go ahead and click this record button so that we stop this from scrolling we're gonna find the first one these pings are just to ping the server so I'm gonna go to the first one after the video loaded that isn't a ping which would be this one and if the one that you click first doesn't work try another one I'm gonna say right click to say copy copy link is address I'm gonna go to my shell take an MPV and MPV and then inside quotation marks paste that URL and hopefully that is the right to playlist it will start playing the video start stringing the video using MPV with no ads give it a second there we go it worked so that's great let's try it on another website and then I'll talk a little bit more about that we're gonna go back here and we'll go to the next website in the list which is CBS news we'll click on this it will make sure we click record down here in our developer's tab let's go ahead click that and here it's going to start loading up stuff again we're still filtering I still have M3U filter in here and again it's loading little previews here let's go ahead and clear that out by clicking this here and then click watch and then we're gonna wait and you can see it started loading up this now we got the video here I'm gonna choose the first one here so this first one probably loaded at these other ones and these probably possibly different quality copies so it's gonna try to find the best quality copy for you I'm gonna say copy this first one and I'm gonna say MPV and paste it in here and now it starts playing and I'm streaming it using MPV I'm gonna hit Q to get it and also you'll know you can see it streaming because you can see the little timer here counting up and then it just jumped up when it's buffered more of the video we'll hit Q to get out of that but in both these cases you can see that this has a unique little random string here and especially this big long one here has a lot of different information there so lots of times when you load up on the web browser it's gonna generate a link for you specifically for you that maybe linked to your IP address so even if I send this to someone right away it may not work for them if they're coming from a different IP address it may also in many cases have a timeout so if you try it ten minutes later or an hour later or a day later depending on when it expires this link will not work anymore so I can't just save this as a command or as an alias and play it and you'll type in ABC news and have it stream it in this particular way what we have to do is we have to scrape the page so let's go back to here so CBS news calm we'll grab that URL and we'll do is I'll do W get and I'll give it that URL and I'm gonna say dash Q for quiet so it doesn't give us like the download percentage and whatnot I'm gonna do dash capital O and a dash that means pipe the standard output we're gonna do that and we get the HTML from the page next one is I'm gonna grep for M3 you and that will give us good we got some M3 you files there real quick there's different ways you can you know parse through this what I'm gonna do is I'm just gonna say TR which will change characters from one thing to another one is gonna change all quotation marks to new line characters boom that puts everything every quotation mark it starts a new line and then at this point instead of grepping M3 you here I'm just gonna move that here so I don't end up grepping it twice because that would just be counterproductive so I'm gonna grep for all I have M3 you now and we have four of them so I'm gonna do right now just to test them out because I don't know if all of these work or if one of them works or some of them work well I'm gonna do is I'm gonna say copy link address and I'm gonna say MPV I'm gonna paste in that first one I just copied and play it and you can see that's a very standard URL there were there's no special information in there and there you go you can see that we're streaming they're away right now you know playing commercials on the live TV and I guess this is what they do on their live stream so they'll be right back but it is streaming so I'm gonna do is I'm going to quit out of that and so you could very easily in this particular case we will do a W get I'm gonna tell you it's not always gonna be that easy because a lot of times this stuff loads with multiple different JavaScript files blah blah blah and you're gonna want to use something like Phantom JS is what I would normally use for something that but in this particular case of CBS news I was able to W get it and again I could take that and this W get command and I can put it in like this and I can say MPV which is now going to go to that website grab the MP3 or oh I want to add in so let me back up a second so this gives us four different URLs I can say head dash and one which would just give us the first then I can take that put it inside dollar sign parentheses and quotations and then I can say MPV and it will play that file and I should be able to save that as a command and then whenever I want that I can run that and it will should grab that M3 you and play that file I'm hoping that this is the proper one and this isn't just like a little thing to distract you it says we'll be right back I'm assuming in a couple minutes it will start being the live news again so we can actually come back to check that in a couple minutes if I don't forget so yeah so I should have you on the web browser but if you want on it in some cases it's that simple other cases it's not but you should always be able to find something in most cases in the web browser just by filtering here for M3 you and then grabbing again this first one here probably has information for all these other ones this is master six master one master two and I'm betting that these are different quality copies so if I was to right-click this I can say copy copy link and if I say MPV I can paste this in here and it's doing it but it's doing it at a lower quality where the first one gave us the best quality for that particular one so it looks like they're getting back so we'll come back to CBS in a minute to make sure that that W get command actually worked like I think it did let's go ahead and look at one other website real quick though we'll come here and we will go down so we did ABC news CBS news and let's do this MB to NBC dash to that's my local NBC news we'll click on that and here it's loading up and why are all these videos disgusting looking things on people's skin okay let's close that ad so we're not seeing any MP3s here or M3 use here let's go ahead and clear out that filter so we're seeing everything and we can see some of the video playback but I want to point out that's very simple if you look here you can see that this is a YouTube video so of course you can just click on this it brings up the YouTube URL and then if you have YouTube dash DL installed MPV will use that and I can just give it oh that's not the right MPV let's copy this so I can give MPV a YouTube URL as long as I have YouTube dash DL installed and it will automatically start streaming it so there we go now we're streaming and that was super simple and that URL should always work because that's their YouTube livestream unless their livestream URL changes but you should easily be able to grab that from the website so if a website if a local news channel especially using YouTube it makes it super duper simple to grab something like that just by using MPV as long as you have YouTube DL installed so there's that now real quick let's go back to this command here and see if we start streaming the loot news properly here there okay so just double checking that command works so things to think about it's very easy to get a stream file again most time they are m3u files so if you go to a website that streams make sure you could play again this is going to play a commercial because there's no ad block in place seems like it plays the same commercial every time it's for their app but once the video starts going you just have to find the right m3u file and it's probably going to be one of the first one loads up when the video starts anyone after that is actually going to be one of the first one loads so again I will stop that recording and right after these pings here I'm going to grab this first one and let's say copy copy the interest now not every media player can play playlist files like that but MPV is very good about that so again I can just paste that in there and it should once it takes buffering which this channel seems like it takes a little bit of buffering but again that URL will probably change really you can tell if it's a big complicated URL like that it probably has was generated specifically for you on your machine at this time so if you're doing it a different time on a different network from a different IP address it may not work that's why you need to scrape it and get the m3u file by scraping the site which will go more into scraping in future videos or you can watch some of my videos I've already done on it PhantomJS probably be a good one sometimes it's very easy use WGet as we did with the CBS channel but then again if they're using YouTube there's already tools out there the YouTube DL and MPV works with that to stream so there are three different examples of different ways to stream live videos from I use news as an example but I'm sure there's other channels that might stream live sport sporting events stuff like that just usually that stuff's behind a paywall which gets a little more complicated and I didn't want to you know we're not getting into logging into websites to stream stuff we're just using and then there's also DRM sometimes on sites but here are some examples of common news channels that we were very easily able to stream from anyway I hope you enjoy this video hope you find it useful and as always let me visit my website which is filmsbychris.com there you can search through all my videos and you can also support me go to the support section or check out the description of this video you can support me right here with PayPal or you can go to my patreon become a patreon supporter I do thank you for watching and as always I hope that you have a great day