Make empty result false

This commit is contained in:
dirkf 2022-11-15 18:34:50 +00:00 committed by GitHub
parent 8479922ba1
commit 23fe05b4f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ from ..utils import (
ExtractorError, ExtractorError,
get_first, get_first,
int_or_none, int_or_none,
LazyList,
merge_dicts, merge_dicts,
OnDemandPagedList, OnDemandPagedList,
orderedSet, orderedSet,
@ -284,10 +285,10 @@ class PanoptoIE(PanoptoBaseIE):
@classmethod @classmethod
def _extract_from_webpage(cls, url, webpage): def _extract_from_webpage(cls, url, webpage):
return map( return LazyList(map(
lambda u: cls.url_result(u, cls.ie_key()), lambda u: cls.url_result(u, cls.ie_key()),
orderedSet(m.group('url') for m in itertools.chain( orderedSet(m.group('url') for m in itertools.chain(
*(re.finditer(embed_re, webpage) for embed_re in cls._EMBED_REGEX)))) *(re.finditer(embed_re, webpage) for embed_re in cls._EMBED_REGEX)))))
def _mark_watched(self, base_url, video_id, delivery_info): def _mark_watched(self, base_url, video_id, delivery_info):
duration = traverse_obj(delivery_info, ('Delivery', 'Duration'), expected_type=float) duration = traverse_obj(delivery_info, ('Delivery', 'Duration'), expected_type=float)