This commit is contained in:
jxxghp
2025-06-24 08:19:10 +08:00
parent 4375e48840
commit 62e74f6fd1
5 changed files with 10 additions and 188 deletions

View File

@@ -598,8 +598,8 @@ class MetaVideo(MetaBase):
prev_token = None
prev_idx = self._index - 2
if prev_idx >= 0 and prev_idx < len(self.tokens._tokens):
prev_token = self.tokens._tokens[prev_idx]
if 0 <= prev_idx < len(self.tokens.tokens):
prev_token = self.tokens.tokens[prev_idx]
next_token = self.tokens.peek()
@@ -630,8 +630,8 @@ class MetaVideo(MetaBase):
match_start_idx = self._index - query_range
match_end_idx = self._index - 1
start_index = max(0, match_start_idx - query_range)
end_index = min(len(self.tokens._tokens), match_end_idx + 1 + query_range)
tokens_to_check = self.tokens._tokens[start_index:end_index]
end_index = min(len(self.tokens.tokens), match_end_idx + 1 + query_range)
tokens_to_check = self.tokens.tokens[start_index:end_index]
if any(tok and tok.upper() in web_tokens for tok in tokens_to_check):
self.web_source = platform_name

View File

@@ -1,4 +1,4 @@
from typing import Dict, Optional, List, Tuple
from typing import Optional, List, Tuple
from app.utils.singleton import Singleton
@@ -101,4 +101,4 @@ class StreamingPlatforms(metaclass=Singleton):
"""
if name is None:
return False
return name.upper() in self._lookup_cache
return name.upper() in self._lookup_cache

View File

@@ -36,3 +36,7 @@ class Tokens:
return None
else:
return self._tokens[index]
@property
def tokens(self):
return self._tokens