diff --git a/fHDHR/tools/__init__.py b/fHDHR/tools/__init__.py index 4c0940c..19a3459 100644 --- a/fHDHR/tools/__init__.py +++ b/fHDHR/tools/__init__.py @@ -3,7 +3,6 @@ import sys import ast import requests import xml.etree.ElementTree -import m3u8 UNARY_OPS = (ast.UAdd, ast.USub) BINARY_OPS = (ast.Add, ast.Sub, ast.Mult, ast.Div, ast.Mod) @@ -15,26 +14,6 @@ def clean_exit(): os._exit(0) -def m3u8_beststream(m3u8_url): - bestStream = None - videoUrlM3u = m3u8.load(m3u8_url) - if len(videoUrlM3u.playlists) > 0: - for videoStream in videoUrlM3u.playlists: - if bestStream is None: - bestStream = videoStream - elif ((videoStream.stream_info.resolution[0] > bestStream.stream_info.resolution[0]) and - (videoStream.stream_info.resolution[1] > bestStream.stream_info.resolution[1])): - bestStream = videoStream - elif ((videoStream.stream_info.resolution[0] == bestStream.stream_info.resolution[0]) and - (videoStream.stream_info.resolution[1] == bestStream.stream_info.resolution[1]) and - (videoStream.stream_info.bandwidth > bestStream.stream_info.bandwidth)): - bestStream = videoStream - if bestStream is not None: - return bestStream.absolute_uri - else: - return m3u8_url - - def sub_el(parent, name, text=None, **kwargs): el = xml.etree.ElementTree.SubElement(parent, name, **kwargs) if text: diff --git a/requirements.txt b/requirements.txt index 62a5b49..055bb2c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,3 @@ gevent flask image xmltodict -m3u8