Merge branch 'add-acm-queue-cover' of https://github.com/wbradley93/calibre

This commit is contained in:
Kovid Goyal 2024-12-05 10:04:58 +05:30
commit 95ee35c0ff
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -23,3 +23,16 @@ class QueueAcmOrg(BasicNewsRecipe):
feeds = [ feeds = [
("All Queue Content", "https://queue.acm.org/rss/feeds/queuecontent.xml"), ("All Queue Content", "https://queue.acm.org/rss/feeds/queuecontent.xml"),
] ]
def get_cover_url(self):
soup = self.index_to_soup('https://queue.acm.org/')
imgs = soup.find_all(
'img',
attrs={
'src': lambda x: x
and x.startswith('/app/')
},
)
if len(imgs) > 0:
self.cover_url = 'https://queue.acm.org/' + imgs[0]['src']
return getattr(self, 'cover_url', self.cover_url)