📜 ⬆️ ⬇️

IPTV from MGTS: channel search

It may seem to you.
SP Jones, How to write a great research paper

In Moscow, MGTS holds events to replace copper wiring with optics using GPON technology. As a result, MGTS subscribers are able to use not only telephone, but also Internet access, and also watch IP television. To watch TV programs, MGTS offers to rent a set-top box, which will provide viewing.

Below, I will tell you how, using the available tools of Debian Linux, to find channels that can be viewed without a prefix.

Recently, I began to hear the new word GPON more often from acquaintances and colleagues — the story was accompanied by heartbreaking details: they say, people from MGTS come to your house, they cut the old copper telephone wire, nail a box around the entrance door, through which now the phone works, and if desired, the Internet, and even television.

It got to the point that, being a guest, I saw this very TV through GPON with my own eyes - there was a console with the inscription MTS on TV, and in the corridor a white box ZTE ZXA10 F660 flashed with light bulbs. The prefix with the ZTE F660 connected an ordinary two-pair Cat5 cable with RJ45 connectors at the ends; From the description of ZTE F660, it became clear that Ethernet is used to transfer data to the console. There was a seditious thought: “Well, how can I connect a laptop instead of a console — can I watch TV?”.
')
Searches led me to a suitable forum . It turned out that the issue of watching TV without a prefix torments not only me:
Is it possible to watch TV channels directly on the computer? Most providers download the playlist and open it in the client, for example, VLC. In MGTS GPON, everything is sharpened to use the set-top box and the TV ... technical support from the issue falls into a stupor. If someone had a setup experience, share, pls.


From the reading of the forum, it became clear that if the ZTE F660 is configured “by default”, then to watch TV, you must connect to the LAN4 socket, and you also need to acquire this very “playlist” (there is no official “playlist” from MGTS).

We managed to find several “playlists”: for example, right here .

It turned out that only some channels from the "playlists" work. And some work half-heartedly - instead of a picture, it shows garbage, but the sound is broadcast normally (such channels are encrypted, you need to pay separately to view them).

The thought arose that the “playlist” is a changeable thing, and it is worth making your own by searching the appropriate ranges of IP addresses based on the contents of the old “playlists”. In order not to perform a manual search, a simple bash script was written. The script enumerates the addresses from which it is possible to broadcast, and, in case of success, pulls out one frame of the telecast:

#!/bin/bash for i in $(seq 1 255); do IP=239.255.2.$i URL=udp://@$IP:5500 echo "== $URL ==" mplayer -ac none -really-quiet -vo png -frames 1 $URL 2>/dev/null mv 00000001.png $IP.png done 


For each of the IP addresses for which it was possible to catch a TV channel, a file with the name of the form $IP.png will be created.



Further, it is easy to erase those files that correspond to encrypted (or unwanted channels) and generate your own M3U “playlist”:

 ( echo '#EXTM3U' ; \ ls -1 *png | sort -V | sed "s/^\(.*\)\.png/#EXTINF:-1,\1\nudp:\/\/@\1\:5500/" ) > playlist 


I got this list with 28 open channels:

 #EXTM3U #EXTINF:-1,5  udp://@239.255.2.18:5500 #EXTINF:-1,Russian Musicbox udp://@239.255.2.37:5500 #EXTINF:-1, udp://@239.255.2.47:5500 #EXTINF:-1, udp://@239.255.2.52:5500 #EXTINF:-1, udp://@239.255.2.54:5500 #EXTINF:-1,Disney udp://@239.255.2.57:5500 #EXTINF:-1, udp://@239.255.2.58:5500 #EXTINF:-1,  udp://@239.255.2.59:5500 #EXTINF:-1, udp://@239.255.2.61:5500 #EXTINF:-1, udp://@239.255.2.62:5500 #EXTINF:-1, udp://@239.255.2.63:5500 #EXTINF:-1, 2 udp://@239.255.2.65:5500 #EXTINF:-1, 1 udp://@239.255.2.67:5500 #EXTINF:-1,  udp://@239.255.2.68:5500 #EXTINF:-1,3 udp://@239.255.2.90:5500 #EXTINF:-1, udp://@239.255.2.91:5500 #EXTINF:-1, udp://@239.255.2.95:5500 #EXTINF:-1,  udp://@239.255.2.97:5500 #EXTINF:-1,! udp://@239.255.2.98:5500 #EXTINF:-1, udp://@239.255.2.100:5500 #EXTINF:-1, 24 udp://@239.255.2.109:5500 #EXTINF:-1, love udp://@239.255.2.112:5500 #EXTINF:-1,2x2 udp://@239.255.2.115:5500 #EXTINF:-1,PRO  udp://@239.255.2.119:5500 #EXTINF:-1, HD udp://@239.255.2.120:5500 #EXTINF:-1,HD life udp://@239.255.2.156:5500 #EXTINF:-1,  HD udp://@239.255.2.185:5500 #EXTINF:-1, udp://@239.255.2.210:5500 


The use of the method described above confirms the empirical Pareto's law as best as possible: with small efforts (writing the simplest script and taking a few minutes to view the “gallery of pictures”) we managed to get a completely practical result (M3U “playlist”).

Of course, I would like to receive a “playlist” with a minimum investment of manual labor. You can do this, for example, by viewing the traffic of the network set-top box immediately after it is turned on and making efforts to decipher the protocol by which the set-top box receives data about the channel list. But that's another story ...

PS Before publishing, I decided to run a script sorting through addresses, once more and found at least three new channels:

 #EXTINF:-1,  udp://@239.255.2.86:5500 #EXTINF:-1,  udp://@239.255.2.233:5500 #EXTINF:-1, udp://@239.255.2.249:5500 

Source: https://habr.com/ru/post/230471/


All Articles