Vsetv.net allows to watch Ukrainian TV channels in browser.
I am developing a channel for playing these videos via plex server (I want to play it on my Samsung Smart TV).
On the homepage they have list of channels - I parse it and output into menu - this works fine.
I have also create a URL service to handle urls like vsetv.net/stbua.html, this service parses html content and extracts actual stream url which looks like this.
I can play fine video from this url using web browser or vlc player if I am on the same external IP.
I tried different approaches for sending the url to plex player but neither of them works fine:
def MediaObjectsForURL(url):
Log.Debug("Media objects requested: %s" % (url))
return [
MediaObject(
video_codec = VideoCodec.H264,
audio_codec = AudioCodec.AAC,
# container = Container.MP4,
video_resolution = 576,
audio_channels = 2,
optimized_for_streaming = True,
parts = [
# PartObject(key = HTTPLiveStreamURL(Callback(PlayVideo, url=url)))
PartObject(key = Callback(PlayVideo, url=url))
]
)
]
def PlayVideo(url):
content = HTTP.Request(url).content
video_url = RE_VIDEO_URL.search(content).group('video_url')
Log.Debug("Requested url: %s, Playing url: %s" % (url, video_url))
# return IndirectResponse(VideoClipObject, key=video_url)
return IndirectResponse(VideoClipObject, HTTPLiveStreamURL(url=video_url))
# return Redirect(video_url)
# return HTTP.Request(video_url).content
Please help me make it working.
