I can get a url link and search for text that starts with file: but I'm having issues parsing it from there.
Example:
wget -qO- http://website.com/site/ | tr \" \\n | grep -w file:\* > output.txt
The wget command Gives me the output:
file: 'http://website.com/site/myStream/playlist.m3u8?wmsAuthSign=c2VydmVyXs',
I'm trying to get the output to look like.
http://website.com/site/myStream/playlist.m3u8?wmsAuthSign=c2VydmVyXs
My goal is to have a bash script that includes several source / list of url's that will be looped through and each processed / grep'd output url will be on it's own separate line.
http://website.com/site/myStream/playlist.m3u8?wmsAuthSign=c2VydmVyXs
As requested:
Here's an example of the output of what
wget -qO- http://website.com/site/
sends back.
player.setup({
file: 'http://website.com/site/myStream/playlist.m3u8?wmsAuthSign=c2VydmVyXs',
width: "100%",
aspectratio: "16:9",
});
grep. Depending on the actual HTML files you want to parse, you may get away withgrep, but there'll be plenty of variants your regular expression won't catch.wgetcommand before any processing with tr or grep?wget -qO- http://website.com/site/with no processing outputs.lynx -dumpwon't work for that at all.