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
11
rtp.py
11
rtp.py
|
@ -76,6 +76,7 @@ while True:
|
||||||
for item in items:
|
for item in items:
|
||||||
if exists >= 5:
|
if exists >= 5:
|
||||||
sys.exit("A sair apos 5 falhas, ja devo ter tudo...")
|
sys.exit("A sair apos 5 falhas, ja devo ter tudo...")
|
||||||
|
|
||||||
# url
|
# url
|
||||||
link = item.find('a')
|
link = item.find('a')
|
||||||
# data
|
# data
|
||||||
|
@ -90,9 +91,13 @@ while True:
|
||||||
|
|
||||||
# parte ?
|
# parte ?
|
||||||
pts = item.findAll('b',{'class': 'text-dark-gray'})
|
pts = item.findAll('b',{'class': 'text-dark-gray'})
|
||||||
pt = pts[1].contents[0]
|
try:
|
||||||
pt = pt.replace('...', '').strip()
|
pt = pts[1].contents[0]
|
||||||
pt = pt.replace(' ', '_')
|
pt = pt.replace('...', '').strip()
|
||||||
|
pt = pt.replace(' ', '_')
|
||||||
|
pt = pt.replace('\n','')
|
||||||
|
except IndexError:
|
||||||
|
pt = ""
|
||||||
|
|
||||||
print "-- " + dt, pt
|
print "-- " + dt, pt
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue