From c9674ddfede5b322496e79ec2a265d0af192d2f8 Mon Sep 17 00:00:00 2001 From: newt-sc <47229722+newt-sc@users.noreply.github.com> Date: Fri, 24 Dec 2021 16:32:58 +0200 Subject: [PATCH] release: v1.37.0 --- CHANGELOG.md | 3 +++ a4kStreaming/explorer.py | 26 ++++++++++++++++++++++---- addon.xml | 5 ++++- packages/addons.xml | 5 ++++- packages/addons.xml.crc | 2 +- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e545933..0ec9747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* [v1.37.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.37.0): + * .m2ts resolve support for RD + * [v1.36.0](https://github.com/newt-sc/a4kStreaming/releases/tag/plugin.video.a4kstreaming%2Fplugin.video.a4kstreaming-1.36.0): * Change RD resolve order diff --git a/a4kStreaming/explorer.py b/a4kStreaming/explorer.py index 1e96520..befc9e5 100644 --- a/a4kStreaming/explorer.py +++ b/a4kStreaming/explorer.py @@ -2409,15 +2409,28 @@ def resolve_rd(resolve_files='videos'): if resolve_files == 'videos': title_name = provider_params.title.title.lower() + has_mt2s = False for file_id in result['debrid_files'].keys(): file = result['debrid_files'][file_id] - is_video = core.os.path.splitext(file['filename'])[1].upper() in video_ext + ext = core.os.path.splitext(file['filename'])[1].upper() + is_video = ext in video_ext + if ext == '.M2TS': + has_mt2s = True + break is_enough_size = int(file['filesize']) > size is_sample = 'sample' not in title_name and 'sample' in file['filename'].lower() if is_video and is_enough_size and not is_sample: file_ids.append(file_id) - if len(file_ids) == len(all_files): - file_ids = [] + if has_mt2s: + fsize = None + fid = None + for file_id in result['debrid_files'].keys(): + file = result['debrid_files'][file_id] + if fsize is None or fsize < int(file['filesize']): + fsize = int(file['filesize']) + fid = file_id + if fid: + file_ids = [fid] if result['ref'].mediatype == 'episode' and (len(file_ids) == 0 or resolve_files == 'exact'): resolve_files = 'exact' @@ -2448,7 +2461,12 @@ def resolve_rd(resolve_files='videos'): if resolve_files == 'videos': request = core.debrid.realdebrid_delete(auth, id) core.request.execute(core, request) - return resolve_rd(resolve_files='all') + if len(file_ids) < len(all_files): + return resolve_rd(resolve_files='all') + elif result['ref'].mediatype == 'episode': + return resolve_rd(resolve_files='exact') + else: + return files elif resolve_files == 'all' and result['ref'].mediatype == 'episode': request = core.debrid.realdebrid_delete(auth, id) core.request.execute(core, request) diff --git a/addon.xml b/addon.xml index 7d35a52..690d436 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ @@ -32,6 +32,9 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[v1.37.0]: + * .m2ts resolve support for RD + [v1.36.0]: * Change RD resolve order diff --git a/packages/addons.xml b/packages/addons.xml index 5f6ff6e..3bf75b5 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,7 +4,7 @@ @@ -35,6 +35,9 @@ Designed for low-end devices and Estuary skin. screenshot-06.jpg +[v1.37.0]: + * .m2ts resolve support for RD + [v1.36.0]: * Change RD resolve order diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index 3b03e0e..4ae42ac 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -aa674a50992422a3a66f0f1803516a8f8f0a9c25 \ No newline at end of file +7e96aca401e0d44cf508b5240d0657822b176e1d \ No newline at end of file