1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00
svtplay-dl/lib/svtplay_dl/utils/fetcher.py
Johan Andersson c547125921 filter_files: increase the ratio to 0.7
0.6 was to low because it was good enough for the first
entry and the ads
2022-06-18 21:23:37 +02:00

12 lines
307 B
Python

from difflib import SequenceMatcher
def filter_files(m3u8):
files = []
good = m3u8.media_segment[1]["URI"]
for segment in m3u8.media_segment:
if SequenceMatcher(None, good, segment["URI"]).ratio() > 0.7:
files.append(segment)
m3u8.media_segment = files
return m3u8