modify some scripts.

This commit is contained in:
2025-03-09 16:52:32 +08:00
parent d9fc5be383
commit 4d5f9521ef

View File

@ -298,6 +298,8 @@ def parse_credits_table(table, distributor_list):
# rows = table.find_all('tr', class_='we')
for row in rows:
#tr_class = row.get('class', '') # 获取 class 属性,如果没有则返回空字符串
tr_class = ' '.join(row.get('class', [])) # 获取 class 属性,如果没有则返回空字符串
cols = row.find_all('td')
if len(cols) >= 6:
title = cols[0].text.strip()
@ -305,6 +307,8 @@ def parse_credits_table(table, distributor_list):
href = href_a['href'] if href_a else ''
year = cols[1].text.strip()
distributor = cols[2].text.strip().lower()
href_d = cols[2].find('a')
href_dist = host_url + href_d['href'] if href_d else ''
notes = cols[3].text.strip()
rev = cols[4].text.strip()
formats = cols[5].text.strip()
@ -318,9 +322,11 @@ def parse_credits_table(table, distributor_list):
'href' : href,
'year': year,
'distributor': distributor,
'distributor_href': href_dist,
'notes': notes,
'rev': rev,
'formats': formats
'formats': formats,
'tr_class': tr_class
})
return movies, distributor_count