support when description is missing
This commit is contained in:
parent
7a2b21f1b6
commit
dd9f980cc1
1 changed files with 4 additions and 1 deletions
|
|
@ -94,7 +94,10 @@ class VideoPage(BasePage):
|
||||||
|
|
||||||
video.title = self.parser.select(div, 'span.title', 1).text
|
video.title = self.parser.select(div, 'span.title', 1).text
|
||||||
video.author = self.parser.select(div, 'a.name', 1).text
|
video.author = self.parser.select(div, 'a.name', 1).text
|
||||||
video.description = self.parser.select(div, 'div#video_description', 1).text
|
try:
|
||||||
|
video.description = self.parser.select(div, 'div#video_description', 1).text
|
||||||
|
except BrokenPageError:
|
||||||
|
video.description = u''
|
||||||
for script in self.parser.select(self.document.getroot(), 'div.dmco_html'):
|
for script in self.parser.select(self.document.getroot(), 'div.dmco_html'):
|
||||||
if 'id' in script.attrib and script.attrib['id'].startswith('container_player_'):
|
if 'id' in script.attrib and script.attrib['id'].startswith('container_player_'):
|
||||||
text = script.find('script').text
|
text = script.find('script').text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue