Skip to content

Commit b0d17de

Browse files
committed
从 TMDB 相对链接中解析数值 ID。
1 parent 4c979c4 commit b0d17de

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

app/modules/themoviedb/tmdbapi.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,7 @@ def _parse_tmdb_id_from_link(link: str) -> Optional[int]:
404404
return int(match.group(1))
405405
except Exception:
406406
return None
407-
# 兜底:取最后段再取数字前缀
408-
last = link.rsplit("/", 1)[-1]
409-
num_match = re.match(r"^(\d+)", last)
410-
return int(num_match.group(1)) if num_match else None
407+
return None
411408

412409
@staticmethod
413410
def __get_names(tmdb_info: dict) -> List[str]:

0 commit comments

Comments
 (0)