How to remove png logo from m3u file

549 Views Asked by At

I have a m3u file and the lines are formatted like this below. I want to get rid of the "tvg-logo="https://i.imgur.com/TVint.png", but every line has different URL and name for the png of course.

I guess i have to use sed or vi for this.

Which sed or vi code warrior can help me out?

--- example line below ---

EXTINF:-1 tvg-name="TV International" tvg-id="TV International" group-title="INT" tvg-logo="https://i.imgur.com/TVint.png",TV International
https://TVlive1-lh.tv.net/i/tv_live04@423398/index_4000_tv-b.m3u8
1

There are 1 best solutions below

0
On
sed -ri 's@(^.*)( tvg-logo.*\")(,.*$)@\1\3@' file.m3u

Use regular expressions with -r and then split the string into three sections (specified in parenthesis). Substitute the line for only the first, followed by the third sections.