Fix parsing irregular episode index

This commit is contained in:
Feilong Ma 2017-07-31 05:26:00 -04:00
parent fca1ec8d9e
commit c4c78721de

View File

@ -245,7 +245,7 @@ def fetch_sid(cid, aid):
def collect_bangumi_epids(json_data): def collect_bangumi_epids(json_data):
eps = json_data['result']['episodes'] eps = json_data['result']['episodes']
eps = sorted(eps, key=lambda item: float(item['index'])) eps = sorted(eps, key=lambda item: float(item['index'].split('-')[0].split('+')[0]))
result = [] result = []
for ep in eps: for ep in eps:
result.append(ep['episode_id']) result.append(ep['episode_id'])