Correct conversion of a playlist for IPTV from M3U8 to M3U format

Every user who has a computer or any other smart device, including Smart TV, has encountered the problem of conversion. It consists in the fact that the files are incompatible with each other, so the device cannot “read” them. To fix this, they need to be converted or, in other words, changed format. This is a simple procedure that involves converting one format to another. But in order to do this, you need a special program, otherwise the file will not be converted.

Such programs can be installed on your computer and used frequently. And if a person accidentally needs to convert a file, then you can use online services. This is much more convenient, especially if a person encounters such a problem for the first time in his life and still has little understanding of how exactly it works. For example, a similar method is often used to give the desired format to a playlist that will be used to broadcast new IPTV television.

How does m3u playlist converter work?

Surely you have already realized that converters are used for the convenience of the users themselves. With their help, you can create a playlist with the desired content and format. So now there will be no problem if you like the playlist, but are not satisfied with its format. From now on, each user will customize the formatting for themselves.

For example, the site only has sheets in the m3u extension. But this is not suitable, although many media players are designed specifically for this format. That's not the point. We urgently need to figure out how to turn the m3u format into WebTV List.txt or any other that is on the conversion list.

The procedure is as follows, with some amendments depending on which program you use:

  • Take the m3u or m3u8 playlist. It is important that all links to IPTV channels in it are working. We should check this fact right now, otherwise the generator may not work as we need, and the procedure will be useless;
  • Next, the person opens the generator. You can take any one you want. As a rule, this will not change the process;
  • When the program opens, copy the contents of the m3u sheet and paste it into the window that opens;
  • Click to start the conversion process.

The online converter can be found at https://vip-tv.org.ua/html/konverter.htm

If there is a lot of content, then the program converts it slowly, and if there is little, then the process will go quite quickly. Having received the components of the future WebTV List.txt file, they need to be copied and saved. As you can see, the procedure is very simple and straightforward. This file type is suitable for watching IPTV on WV Premium.

Script to automatically convert m3u to m3u8

Relatively recently moved to GNU/Linux. While converting playlists from foobar2000 to .m3u, I noticed that there are also .m3u8. It turns out that this is the same .m3u, but in UTF-8 encoding. It’s a mess, I thought, and decided to put everything in kosher form, i.e. convert .m3u lists to .m3u8, because I store all files in UTF-8. I have quite a lot of these same playlists (more than 100), so I decided to write a script in Bash. Since the music was copied from an NTFS partition to an ext4 partition - the encoding of all files (playlists) was CP1251, and the rights of all files included the “executable” bit - I also decided to fix this. So, what does the written script do:

  • sets standard file permissions
  • sets standard folder permissions
  • converts all playlists from .m3u to .m3u8

“Quiet” and verbose execution modes are implemented, careful transformation of lists is provided (old ones will be deleted only if the transformation is successful);
A bug with incorrect naming of Russian files has been identified and fixed (my Debian Squeeze uses dash as sh, and it was stupid - bash definitely works correctly). The script listing below should be saved as “m3migr” and made executable (“chmod +x m3migr”). Run - "./m3migr <directory_with_music>" - silent mode, or "./m3migr -v <directory_with_music>" - will output all actions to the console.

The playlists obtained after conversion were tested on Amarok 2.3.0 - everything works.

Actually, the script itself:

#!/bin/bash # NOTE: do not use /bin/sh - spoils Russian file names # Script for automatic migration of music files from Windows # Converts .m3u to .m3u8 and sets standard # permissions on all files # —————— ————— FUNCTIONS ———————————— # Function for converting an m3u playlist to m3u8 (UTF-8) convert_m3u() { old_filename=”$1″ # .m3u new_filename=”${1}8 ″ # .m3u8 if [ “$is_verbose” = “true” ]; then printf "convert \"${old_filename}\" to \"${new_filename}\"\\n" fi iconv -f CP1251 -t UTF-8 "$old_filename" > "$new_filename" ls_tmp=$(ls - s "$new_filename") new_file_size=${ls_tmp%% *} if [ -f "$new_filename" ] && [ -n "$new_file_size" ] && [ "$new_file_size" -gt 0 ]; then rm -f "$old_filename" rm -f "${old_filename}~" rm -f "${new_filename}~" fi } # Function for setting file permissions chmod_file() { if [ -f "$1" ]; then # for files if [ "$is_verbose" = "true" ]; then printf "change mode for file \"${1}\"\\n" fi chmod 644 "$1" # - rw- r- r- fi } # Function for setting directory rights chmod_dir() { if [ -d " $1" ]; then # for directories if [ "$is_verbose" = "true" ]; then printf “change mode for dir \”${1}\”\\n” fi chmod 755 “$1″ # d rwx- rx rx fi } # —————————- PROGRAM BODY ———— ———————- is_verbose="false" # Checking passed arguments if [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then is_verbose=”true” shift fi if [ -d “$1″ ]; then music_dir=”$1” else printf “usage: m3migr [{-v | —verbose}] music_dir\\n" exit 1 fi printf "Launch application...\\n" sleep 1 printf "Changing file permissions...\\n" cur_file="" find "$1" -name "*" -type f -print | while read cur_file do chmod_file "$cur_file" done sleep 1 printf "Changing permissions for directories...\\n" cur_dir="" find "$1" -name "*" -type d -print | while read cur_dir do chmod_dir "$cur_dir" done sleep 1 printf "Convert all m3u playlists to m3u8...\\n" cur_file="" find "$1" -name "*.m3u" -type f -print | while read cur_file do convert_m3u "$cur_file" done printf "\\nOK!\\n" exit 0

List of used literature

1. Neil Matthew, Richard Stones. Linux Programming Fundamentals, 4th Edition. Chapter 2 2. Notes on Bash on LOR 3. Habrahabr. Bash Basics, Part 1 4. Habrahabr. Bash Basics, Part 2

Options for converting files

The IPTV playlist converter can work online. This is much more convenient and allows you to use different programs depending on your mood, capabilities and more. Each program has its own characteristics, nuances and operating rules. But the principle is the same - change one format to another. And doing this online is much easier.

The converter uses the following options for conversion:

  • Conversion with or without channel names;
  • IPTV playlist format: IPTV playlist.m3u or IPTV playlist.m3u8;
  • Specify which device you are using: Samsung, OpenBox, Enigma2, LG;
  • Availability of player: WMPlayer, MPClassic, etc.;
  • What to convert to: Playlist.xspf, Playlist.pls, etc.

You also need to indicate other parameters that are no less important. But not all tq converters have them, so we will not consider the exact procedure. Let's just say that before converting you need to remove the line #EXTM3U.

PlaylistBox Features and Benefits

  • Convenient import into your account via link or file.
  • No restrictions. Download yourself at least all the playlists on the Internet.
  • An excellent graphics editor. The notepad will no longer hurt your eyes! In addition, this editor has categories, icons and EPGs.
  • Hosting your playlists. Once you have compiled your playlist, you can not only download it, but also receive a link to it.
  • There is support in the TG channel.

In simple words - you download all the playlists that you have and assemble your IDEAL one

playlist in minutes!

Additionally

After creating a playlist, you can add categories to it, as well as TV channel icons and TV program display.

Adding data by channel

Categories and headings are necessary to make it easier to navigate the created file.

They are done this way:

  1. Between the name of the TB channel and the link to it, make an empty line (click after the name and press Enter).

  2. Indicate the category in the resulting line - #EXTGRP: name of the subgroup. For example, sports or educational.

  3. Repeat for all other channels. You can also just copy the category line and paste it for the next channel (if the category is the same). It will be faster.

This is how the category is displayed in the player:

Adding a TV guide

The EPG is responsible for the TV program and display of channel icons. This is the file from which the schedule of TV channels and their logos will be obtained. The installation process only takes a couple of minutes.

TV guides:

  • https://epg.it999.ru/edem.xml.gz;
  • https://iptv-content.webhop.net/guide.xml;
  • https://webarmen.com/my/iptv/xmltv.xml.gz.

It is best to use the first file, because... it supports the largest number of channels and always displays the correct TV schedule, and keep the rest as backup. The files are compatible with any playlist that can be downloaded on the Internet.

Detailed EPG setup:

  1. Copy any EPG link.
  2. Open the playlist file.
  3. Change the first line to: #EXTM3U url-tvg=”add the copied EPG link here.”

The playlist is displayed like this:

Applications for editing playlists

A special IPTV editor helps automate the work with m3u files, and therefore makes it easier, eliminating the need to perform many manual actions. There are 3 programs that are very practical and convenient.

My Playlist TV

This is a very easy to use program. Designed for organizing channels in a playlist. If you need to edit a large playlist or are simply tired of doing everything manually, the program will help. You just need to select the channels and perform batch deletion or reordering.

This is what she looks like:

SS IPTV

The most popular among similar players. He has his own official website. The player can set up his own list through the portal. To work in the SS IPTV editor, you just need to move the channel with the cursor to any other position or remove it completely.

All actions are best performed from a PC, and changes will be applied automatically.

This is what the program looks like:

Playlist Creator

An editor used as an organizer for custom lists. It is very convenient to select relevant elements and move them up or down the list.

You can combine 2, 3 or more playlists into a pair of actions, and then select the desired channels among them in editing mode.

Program interface:

Creating an m3u playlist yourself

The easiest and most natural way to create m3u playlists is to use the standard tools of popular applications: notepad and AIMP player.

In a standard notepad

To create a playlist, you'll need a notepad. Use the one you like best. This could be a standard Windows notepad, the popular Notepad++, or any other.

  1. Download the program if necessary, or open a notepad on your PC.
  2. Click on “File” in the upper left corner to create a new file.

  3. Save a blank file with any name, add a period and enter "m3u". For example, playlist-movies.m3u. Click “Save”. Fill it with channels and movies. This is discussed in detail below in the “Correctly filling out data” section.

In AIMP player

AIMP is a program that is considered the best among PC players. Here you can create a music playlist. You can do this in the following way:

  1. Launch the program.
  2. Open your files folder. To start creating playlists, simply drag the individual files, albums or ready-made lists you are interested in into the player window (above).

  3. All audio files will be added to the list. Information about the number of songs and total playing time will be displayed at the bottom.

If you drag a new file directly onto an existing list, a panel with buttons will pop up so you can choose what to add.

The following adding options are available for selection:

  • to the current position (where the arrow is, the file will be inserted there);
  • to the beginning or end (add either the very first song or the very last);
  • in random order (add to any place);
  • cancel adding (the panel will close).

This way you can not only add the necessary files and folders, but also arrange them in a specific order.

Creating a playlist on an Android device

It is not possible to create and edit playlists using Android smartphones.

You can only create a playlist on PC and then save on your phone. To do this, connect the device to the computer using a cable. The phone must be configured so that the computer recognizes it as a storage device.

Copy the finished file to the folder on your smartphone where media files, audio and video content are stored. The completed playlist will open on your smartphone using any player that supports m3u.

Rating
( 1 rating, average 4 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]