Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions svtcrawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ def sanitize_description(value):
cleaned = PyQuery(value)
cleaned = cleaned.remove('span.playMetaText')
cleaned.remove('span.playMetaText')
cleaned.remove('span.playCount')
cleaned.remove('time')
cleaned.remove('strong')

return cleaned.html().split('<span>')[-1:][0].replace('</span>', '')
desc = cleaned.html()

if desc is None: return ""

return desc.split('<span>')[-1:][0].replace('</span>', '').strip()

class Category:
def __init__(self, title, url, html_class, thumbnail):
Expand Down Expand Up @@ -358,7 +363,7 @@ def __init__(self, max_timestamp, min_timestamp, skip_urls):
self.baseurl = 'http://www.svtplay.se'
self.url = 'http://www.svtplay.se/program'
self.category_url = 'http://www.svtplay.se%s/?tab=titlar&sida=1000'
self.news_url = 'http://www.svtplay.se%s/?tab=regionalNews&sida=1000'
self.news_url = 'http://www.svtplay.se%s/?tab=regionala&sida=1000'
self.max = max_timestamp
self.min = min_timestamp
if type(skip_urls) == 'str':
Expand Down