Open t3knoid opened 7 years ago
Here's a preliminary script that scrapes the m3u index file and reading its content
` import requests from lxml import html
search_str = "\/index.m3u8" index_feed = 'https://player.mediaklikk.hu/playernew/player.php?video=mtv2live'
pageContent=requests.get( index_feed ) tree = html.fromstring(pageContent.content)
script=tree.xpath( '/html/body/script[3]/text()')[0]
lines = script.split('\n')
found_line = [s for s in lines if (search_str in s)][0]
url_parts=found_line.split('"') m3u8_index = 'https:%s' % url_parts[3].replace('\', '')
m3u8_index_pageContent=requests.get( m3u8_index ) if pageContent.status_code == 200: print '%s' % m3u8_index_pageContent.content`
Use the following URL:
This part of the returned html contains the URL to the m3u8 file: See the "playlist" list.
` var pl = jwplayer('player'); var _contentId = null;
} );
`