Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions astrbot/core/platform/sources/line/line_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def _component_to_message_object(
@staticmethod
async def _resolve_image_url(segment: Image) -> str:
candidate = (segment.url or segment.file or "").strip()
if candidate.startswith("http://") or candidate.startswith("https://"):
if candidate.startswith("https://"):
return candidate
try:
return await segment.register_to_file_service()
Expand All @@ -115,7 +115,7 @@ async def _resolve_image_url(segment: Image) -> str:
@staticmethod
async def _resolve_record_url(segment: Record) -> str:
candidate = (segment.url or segment.file or "").strip()
if candidate.startswith("http://") or candidate.startswith("https://"):
if candidate.startswith("https://"):
return candidate
try:
return await segment.register_to_file_service()
Expand All @@ -137,7 +137,7 @@ async def _resolve_record_duration(segment: Record) -> int:
@staticmethod
async def _resolve_video_url(segment: Video) -> str:
candidate = (segment.file or "").strip()
if candidate.startswith("http://") or candidate.startswith("https://"):
if candidate.startswith("https://"):
return candidate
try:
return await segment.register_to_file_service()
Expand All @@ -148,9 +148,7 @@ async def _resolve_video_url(segment: Video) -> str:
@staticmethod
async def _resolve_video_preview_url(segment: Video) -> str:
cover_candidate = (segment.cover or "").strip()
if cover_candidate.startswith("http://") or cover_candidate.startswith(
"https://"
):
if cover_candidate.startswith("https://"):
return cover_candidate

if cover_candidate:
Expand Down Expand Up @@ -191,7 +189,7 @@ async def _resolve_video_preview_url(segment: Video) -> str:

@staticmethod
async def _resolve_file_url(segment: File) -> str:
if segment.url and segment.url.startswith(("http://", "https://")):
if segment.url and segment.url.startswith("https://"):
return segment.url
try:
return await segment.register_to_file_service()
Expand Down