fix crash
This commit is contained in:
parent
0c202b968f
commit
ae00abcdb2
|
@ -54,17 +54,20 @@ for td, table in itertools.izip(td_list, table_list):
|
||||||
|
|
||||||
info_r = requests.get(info_url + str(u2torrent.id), cookies=cookies)
|
info_r = requests.get(info_url + str(u2torrent.id), cookies=cookies)
|
||||||
|
|
||||||
info_soup = BeautifulSoup(info_r.text)
|
try:
|
||||||
|
info_soup = BeautifulSoup(info_r.text)
|
||||||
|
|
||||||
info_name = info_soup.find("span", {'class': 'title'}, text="[name]").parent.find("span", {'class': 'value'})
|
info_name = info_soup.find("span", {'class': 'title'}, text="[name]").parent.find("span", {'class': 'value'})
|
||||||
u2torrent.folder = info_name.text
|
u2torrent.folder = info_name.text
|
||||||
|
|
||||||
u2torrent.name = u2torrent.title.split('][')[0].replace('[', '')
|
u2torrent.name = u2torrent.title.split('][')[0].replace('[', '')
|
||||||
|
|
||||||
print u2torrent.name + " : " + u2torrent.folder
|
print u2torrent.name + " : " + u2torrent.folder
|
||||||
|
|
||||||
torrents.append(json.JSONDecoder().decode(u2torrent.json()))
|
torrents.append(json.JSONDecoder().decode(u2torrent.json()))
|
||||||
count += 1
|
count += 1
|
||||||
|
except AttributeError:
|
||||||
|
print "Fetch folder name failed: " + u2torrent.title
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
torrents_dict["count"] = count
|
torrents_dict["count"] = count
|
||||||
|
|
Loading…
Reference in New Issue