mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 15:16:58 -05:00
Merge pull request #34 from deathbybandaid/dev
Cleanup Requirements for all repos
This commit is contained in:
commit
e5383b8e81
@ -3,7 +3,6 @@ import sys
|
|||||||
import ast
|
import ast
|
||||||
import requests
|
import requests
|
||||||
import xml.etree.ElementTree
|
import xml.etree.ElementTree
|
||||||
import m3u8
|
|
||||||
|
|
||||||
UNARY_OPS = (ast.UAdd, ast.USub)
|
UNARY_OPS = (ast.UAdd, ast.USub)
|
||||||
BINARY_OPS = (ast.Add, ast.Sub, ast.Mult, ast.Div, ast.Mod)
|
BINARY_OPS = (ast.Add, ast.Sub, ast.Mult, ast.Div, ast.Mod)
|
||||||
@ -15,26 +14,6 @@ def clean_exit():
|
|||||||
os._exit(0)
|
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):
|
def sub_el(parent, name, text=None, **kwargs):
|
||||||
el = xml.etree.ElementTree.SubElement(parent, name, **kwargs)
|
el = xml.etree.ElementTree.SubElement(parent, name, **kwargs)
|
||||||
if text:
|
if text:
|
||||||
|
|||||||
@ -3,4 +3,3 @@ gevent
|
|||||||
flask
|
flask
|
||||||
image
|
image
|
||||||
xmltodict
|
xmltodict
|
||||||
m3u8
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user