View Single Post
Old 10-03-2022, 05:08 AM   #7
unkn0wn
Guru
unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.
 
Posts: 627
Karma: 85520
Join Date: May 2021
Device: kindle
Is this the same error type?

https://www.mobileread.com/forums/sh...72&postcount=2

Quote:
this is SSLCertVerificationError.

you can fix this by visiting the cited image link in internet explorer or edge. (its working)

Spoiler:
Could not fetch image https://resources.arcamax.com/newspi...01/2350141.gif
Traceback (most recent call last):
File "mechanize\_urllib2_fork.py", line 1236, in do_open
File "http\client.py", line 1282, in request
File "http\client.py", line 1328, in _send_request
File "http\client.py", line 1277, in endheaders
File "http\client.py", line 1037, in _send_output
File "http\client.py", line 975, in send
File "http\client.py", line 1454, in connect
File "ssl.py", line 512, in wrap_socket
File "ssl.py", line 1070, in _create
File "ssl.py", line 1341, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)


https://www.mobileread.com/forums/sh...58&postcount=5
maybe it worked for me because I visited this link in edge. (I don't think I did cause I use firefox mostly)

did you somehow visit the http link type for it to work?

I suggested the above changes so that it will work even when ft isn't published on weekdays or cover isn't updated in kiosko website.

In the above changes i used https, make it http.. maybe this will work.

Spoiler:
Code:
    def get_cover_url(self):
        from datetime import date
        cover = 'http://img.kiosko.net/' + str(
            date.today().year
        ) + '/' + date.today().strftime('%m') + '/' + date.today(
        ).strftime('%d') + '/uk/ft_uk.750.jpg'
        br = BasicNewsRecipe.get_browser(self)
        try:
            br.open(cover)
        except:
            index = 'https://en.kiosko.net/uk/np/ft_uk.html'
            soup = self.index_to_soup(index)
            for image in soup.findAll('img', src=True):
                if image['src'].endswith('750.jpg'):
                    return 'http:' + image['src']
            self.log("\nCover unavailable")
            cover = None
        return cover


I think if datetime method wont return image.. it should go to kiosko site and find that image.

Or this would be much better,
Code:
    def get_cover_url(self):
        soup = self.index_to_soup('https://en.kiosko.net/uk/np/ft_uk.html')
        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

Last edited by unkn0wn; 10-03-2022 at 05:25 AM.
unkn0wn is offline   Reply With Quote