mirror of https://github.com/falsovsky/RTPapd.git
fix download of items that dont have subtitles
This commit is contained in:
parent
a2e88c1bdd
commit
29beeba864
5
rtp.py
5
rtp.py
|
@ -76,6 +76,7 @@ while True:
|
|||
for item in items:
|
||||
if exists >= 5:
|
||||
sys.exit("A sair apos 5 falhas, ja devo ter tudo...")
|
||||
|
||||
# url
|
||||
link = item.find('a')
|
||||
# data
|
||||
|
@ -90,9 +91,13 @@ while True:
|
|||
|
||||
# parte ?
|
||||
pts = item.findAll('b',{'class': 'text-dark-gray'})
|
||||
try:
|
||||
pt = pts[1].contents[0]
|
||||
pt = pt.replace('...', '').strip()
|
||||
pt = pt.replace(' ', '_')
|
||||
pt = pt.replace('\n','')
|
||||
except IndexError:
|
||||
pt = ""
|
||||
|
||||
print "-- " + dt, pt
|
||||
|
||||
|
|
Loading…
Reference in New Issue