def get_latest_episode(self, url, media=False):
storage_path = join(self.file_system.path, 'feedcache')
LOGGER.debug("storage_path:%s" % storage_path)
storage = shelve.open(storage_path)
ttl = 60 * 60
link = ""
try:
fc = cache.Cache(storage, timeToLiveSeconds=ttl)
parsed_data = fc.fetch(url)
print "parsed_data.feed.title:", parsed_data.feed.title
for entry in parsed_data.entries:
pprint(entry)
if media:
media_content = entry.media_content
if media_content:
link = entry.media_content[0]['url']
else:
link = entry.link
if link:
break
finally:
storage.close()
return link
__init__.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录