C
C
chegcheg2019-08-26 22:58:07
PHP
chegcheg, 2019-08-26 22:58:07

Parsing online video for display on Smart TV (iptv/m3u)?

Interested in possible options for implementing a parser of sites with online video for subsequent use in ForkPlayer (or another application with the ability to view IPTV) on Smart TV.
Necessary scenario on the example of parsing movies from some online cinema such as HDrezka:
1. We make a "playlist" on our host in advance with subcategories of the site in the form of m3u.
2. When opening any of the subcategories, the script parses the HTML of the required page.
2.1. A list of films with links to them is generated (we take the title of the film or any other information as a title), also in m3u (search by DOM can also be written in js).
2.2. At the end of the list, add a link to the next page, if available.
3. When you open a page with a movie, the script also parses HTML, looks for a link to the video, and generates a new m3u for issuing the video directly.
An important clarification: the video from the pages does not need to be downloaded anywhere. Just a direct link to them is enough.
PHP Simple HTML DOM Parser immediately comes to mind, but if I manage to parse individual pages and get their HTML, then the lack of knowledge in PHP does not allow me to implement structured content output in the desired format (m3u / XML?) and, importantly, with navigation by page, for direct viewing in the widget on TV.
Are there any tutorials or maybe ready-made solutions for creating such parsers?
Thank you all in advance for your replies!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alexkdpu, 2019-08-27
@alexkdpu

Here is a one-page PHP script for a movie pub for a forkplayer, I think you can understand the principle
https://github.com/alexkdpu/kino.pub_forkplayerPHP...
And here is a simple output
wiki.forkplayer.tv/wiki/PHP_JSON_%D0%B3%D0%B5 %D0%B...

T
ThunderCat, 2019-08-27
@ThunderCat

links to videos are most often absent in modern streaming services, the video is pulled from the storage in chunks, which are glued into a stream on the client using js. There are those who still give some kind of mp4, but there are only a few of them now. Plus, usually these are not sites where the videos themselves are shown, but third-party services that require a key to connect to their API. In short, not everything is so simple. For an example, look at chrome plugins for downloading videos from pages, although most of them are almost nothing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question