0

I am trying to auto create m3u file for my IPTV software with the help of sed/awk or grep command,but don't have much experience in this. expert help required to do this. working on Windows-10 PC environment cmd.

I have raw file having approx 500 lines of video file links like

english.movie.com/movies/english/a/example.moviename1/example.moviename1.BRRip.Dual.mkv english.movie.com/movies/english/a/example.moviename2/example.moviename2.WEBRip.avi english.movie.com/movies/english/a/example.moviename3/example.moviename3.DVDRip.avi

I want to automate the procedure to write following lines in m3u file and include raw file link and its movie name in m3u file, m3u file lines are. single line example

#EXTINF:-1 xui-id="101" tvg-id="" tvg-name="example.moviename1" tvg-logo="" group-title="MoviesEnglish-A",example.moviename1 http://english.movie.com/movies/english/a/example.movienam1/example.moviename1.BRRip.Dual.mkv

and so on till raw file ends.

where in first line of m3u file.

xui-id, starts from lets say 101, what ever start number I set in start of script.

tvg-name, should be a movie name, which should be picked after 4th forward slash, and ends at 5th forward slash from raw file line.

I used following command to get movie name and its works.

awk -F / "{ print $5; }"

group-title, whatever name I set in start of script.

and again movie name should be picked after 4th forward slash and ends at 5th forward slash from raw file line after group-tile

in second line of m3u file. raw file line should be written after http:// ,to do so I use following command.

sed "s_.*_http://&_"

I think there should be some loop involve to fulfill my need, I am working on it and still not able to get results.

if my explanation of my question disturb you to understand my need, in this case please guide me.

6
  • You need to include your attempt at writing the script.
    – Destroy666
    Commented Apr 1, 2023 at 1:09
  • i did it, please check my questions again
    – Rizwan.A
    Commented Apr 1, 2023 at 19:07
  • I see only some parts + text descriptions of the rest, please post entire script in one piece, as much as you have.
    – Destroy666
    Commented Apr 1, 2023 at 20:16
  • I have no expertise to create script, thats why I am asking. I only able to use following 2 commands and its working with single line.
    – Rizwan.A
    Commented Apr 1, 2023 at 21:44
  • awk -F / "{ print $5; }" & sed "s_.*_http://&_"
    – Rizwan.A
    Commented Apr 1, 2023 at 21:45

0

You must log in to answer this question.

Browse other questions tagged .