From fd8270d72ccc7febaf5d923bdf76816feaca8048 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Oct 2022 15:12:00 +0530 Subject: [PATCH] Update eenadu_ap --- recipes/eenadu_ap.recipe | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/recipes/eenadu_ap.recipe b/recipes/eenadu_ap.recipe index 353611cb8e..c204b4e71c 100644 --- a/recipes/eenadu_ap.recipe +++ b/recipes/eenadu_ap.recipe @@ -41,6 +41,25 @@ class eenadu_ap(BasicNewsRecipe): classes('sshare-c tags andbeyond_ad fnt20 arti more2 offset-tb1 msb-list') ] + def get_cover_url(self): + from datetime import date + cover = 'https://img.kiosko.net/' + str( + date.today().year + ) + '/' + date.today().strftime('%m') + '/' + date.today( + ).strftime('%d') + '/in/eenadu.750.jpg' + br = BasicNewsRecipe.get_browser(self) + try: + br.open(cover) + except: + index = 'https://es.kiosko.net/in/np/eenadu.html' + soup = self.index_to_soup(index) + for image in soup.findAll('img', src=True): + if image['src'].endswith('750.jpg'): + return 'https:' + image['src'] + self.log("\nCover unavailable") + cover = None + return cover + def parse_index(self): section_list = [ ('ఆంధ్రప్రదేశ్ తాజా వార్తలు', 'andhra-pradesh'),